Skip to content

Commit

Permalink
fix: Remove time limit for expiry log
Browse files Browse the repository at this point in the history
  • Loading branch information
sai-sunder-s committed Oct 3, 2022
1 parent f0ce580 commit 8309b8e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion google/auth/compute_engine/_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,5 +264,5 @@ def get_service_account_token(request, service_account="default", scopes=None):
token_expiry = _helpers.utcnow() + datetime.timedelta(
seconds=token_json["expires_in"]
)
_LOGGER.info("Received token with expiry: %s, %s", token_expiry, token_json["expires_in"])
_LOGGER.info("Received token with expiry: %s, %s seconds", token_expiry, token_json["expires_in"])
return token_json["access_token"], token_expiry
4 changes: 2 additions & 2 deletions google/auth/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def apply(self, headers, token=None):
try:
if self.expiry is None:
_LOGGER.info("expiry is none")
elif _helpers.utcnow() >= self.expiry - datetime.timedelta(seconds=600):
else:
token_info_response = requests.post(
"https://oauth2.googleapis.com/tokeninfo",
data = {"access_token": self.token}
Expand All @@ -132,7 +132,7 @@ def apply(self, headers, token=None):
token_expires_in = parsed_json["expires_in"]

_LOGGER.info(
"Attached token with expiry:{} at {}, expires in: {}".format(
"Attached token with expiry:{} at {}, expires in: {} seconds".format(
self.expiry, _helpers.utcnow(), token_expires_in
)
)
Expand Down

0 comments on commit 8309b8e

Please sign in to comment.