Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -17,17 +17,17 @@ def get_credentials():
|
|
| 17 |
try:
|
| 18 |
# Construct the service account info dictionary
|
| 19 |
service_account_info = {
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 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)
|