From a7951bf424f532b35c961c1aca24404ad5b257e4 Mon Sep 17 00:00:00 2001
From: Matevz Erzen <matevz.erzen@xlab.si>
Date: Tue, 22 Mar 2022 16:57:43 +0100
Subject: [PATCH] Minor bug fix

---
 MANIFEST                                     | 2 +-
 forward_evidence/clouditor_authentication.py | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/MANIFEST b/MANIFEST
index ca1dc8e..784075e 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 77bb580..592f510 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.
-- 
GitLab