diff --git a/MANIFEST b/MANIFEST index ca1dc8e07a5c99740b09e2fe680049b013735901..784075e05b795840d8b1c9856fd67683a065eed9 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1,2 +1,2 @@ -VERSION=v0.0.10 +VERSION=v0.0.11 SERVICE=evidence-collector diff --git a/forward_evidence/clouditor_authentication.py b/forward_evidence/clouditor_authentication.py index 77bb580b23af19c3d26f683e2b531cdc2bfe080d..592f51061fe721ce209aec659958239c28ee072f 100644 --- a/forward_evidence/clouditor_authentication.py +++ b/forward_evidence/clouditor_authentication.py @@ -34,10 +34,10 @@ class ClouditorAuthentication(object): token = json.loads(access_token_response.text) self.__access_token = token['access_token'] - self.__token_expiration_time = datetime.utcnow() + timedelta(seconds=token['expires_in']) + self.__token_expiration_time = datetime.utcnow() + timedelta(seconds=(token['expires_in'] - 10)) self.logger.info("New OAuth2 token successfully acquired") - self.logger.debug("OAuth2 token expiring at: " + str(self.__token_expiration_time - 10)) + self.logger.debug("OAuth2 token expiring at: " + str(self.__token_expiration_time)) def get_token(self): # In practice this condition isn't even needed as every scheduled job creates new ClouditorAuthentication object and acquires new token.