Rakshitjan commited on
Commit
05793c4
·
verified ·
1 Parent(s): d9e5a4f

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +11 -11
main.py CHANGED
@@ -17,17 +17,17 @@ def get_credentials():
17
  try:
18
  # Construct the service account info dictionary
19
  service_account_info = {
20
- auth_provider_x509_cert_url : os.getenv('AUTH_PROVIDER_X509_CERT_URL')
21
- auth_uri : os.getenv('AUTH_URI')
22
- client_email : os.getenv('CLIENT_EMAIL')
23
- client_id : os.getenv('CLIENT_ID')
24
- client_x509_cert_url : os.getenv('CLIENT_X509_CERT_URL')
25
- private_key : os.getenv('PRIVATE_KEY')
26
- private_key_id : os.getenv('PRIVATE_KEY_ID')
27
- project_id : os.getenv('PROJECT_ID')
28
- service_account_type : os.getenv('SERVICE_ACCOUNT_TYPE')
29
- token_uri : os.getenv('TOKEN_URI')
30
- universe_domain : os.getenv('UNIVERSE_DOMAIN')
31
  }
32
  scope = ['https://spreadsheets.google.com/feeds', 'https://www.googleapis.com/auth/drive']
33
  creds = Credentials.from_service_account_info(service_account_info, scopes=scope)
 
17
  try:
18
  # Construct the service account info dictionary
19
  service_account_info = {
20
+ "type": os.getenv("SERVICE_ACCOUNT_TYPE"),
21
+ "project_id": os.getenv("PROJECT_ID"),
22
+ "private_key_id": os.getenv("PRIVATE_KEY_ID"),
23
+ "private_key": os.getenv("PRIVATE_KEY").replace('\\n', '\n'),
24
+ "client_email": os.getenv("CLIENT_EMAIL"),
25
+ "client_id": os.getenv("CLIENT_ID"),
26
+ "auth_uri": os.getenv("AUTH_URI"),
27
+ "token_uri": os.getenv("TOKEN_URI"),
28
+ "auth_provider_x509_cert_url": os.getenv("AUTH_PROVIDER_X509_CERT_URL"),
29
+ "client_x509_cert_url": os.getenv("CLIENT_X509_CERT_URL"),
30
+ "universe_domain": os.getenv("UNIVERSE_DOMAIN")
31
  }
32
  scope = ['https://spreadsheets.google.com/feeds', 'https://www.googleapis.com/auth/drive']
33
  creds = Credentials.from_service_account_info(service_account_info, scopes=scope)