Rakshitjan commited on
Commit
7e96c71
·
verified ·
1 Parent(s): 5141c51

Update main.py

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