From 5e1df9263bdfde5cfc6c86ab40c794dd4c86d228 Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Wed, 5 Apr 2023 17:18:10 +0000 Subject: [PATCH] use transport and bump retries --- src/gam/auth/signjwt.py | 4 +++- src/gam/transport.py | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gam/auth/signjwt.py b/src/gam/auth/signjwt.py index ea4784bb..fcc8f56a 100644 --- a/src/gam/auth/signjwt.py +++ b/src/gam/auth/signjwt.py @@ -73,8 +73,10 @@ class SignJwt(google.auth.crypt.Signer): def sign(self, message): ''' Call IAM Credentials SignJWT API to get our signed JWT ''' + request = transport.create_request() try: - credentials, _ = google.auth.default(scopes='https://www.googleapis.com/auth/iam') + credentials, _ = google.auth.default(scopes='https://www.googleapis.com/auth/iam', + request=request) except google.auth.exceptions.DefaultCredentialsError as e: controlflow.system_error_exit(2, e) httpObj = transport.AuthorizedHttp( diff --git a/src/gam/transport.py b/src/gam/transport.py index 35ad4922..3cc257f5 100644 --- a/src/gam/transport.py +++ b/src/gam/transport.py @@ -9,6 +9,8 @@ from gam.var import GC_TLS_MAX_VERSION from gam.var import GC_TLS_MIN_VERSION from gam.var import GC_Values +# Bump default retries +httplib2.RETRIES = 5 def create_http(cache=None, timeout=None,