From fe286f348606ba15e369918550f9f73c707a4c5f Mon Sep 17 00:00:00 2001 From: Scott Leggett Date: Tue, 23 Feb 2021 11:44:45 +0800 Subject: [PATCH] fix: unconditionally refresh api token in test suite --- tests/tasks/api/refresh_token.py | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/tests/tasks/api/refresh_token.py b/tests/tasks/api/refresh_token.py index ee228d6e53..305c4f9bef 100755 --- a/tests/tasks/api/refresh_token.py +++ b/tests/tasks/api/refresh_token.py @@ -16,16 +16,11 @@ access_token = jwt.decode(grant['access_token'], verify=False) -current_time = int(time.time()) - -if current_time < access_token['exp']: - print grant_raw -else: - data = {'client_id': 'auth-server', - 'client_secret': auth_server_client_secret, - 'grant_type': 'refresh_token', - 'refresh_token': grant['refresh_token']} - - r = requests.post(url = "http://keycloak:8080/auth/realms/lagoon/protocol/openid-connect/token", data = data) - print r.text +data = {'client_id': 'auth-server', + 'client_secret': auth_server_client_secret, + 'grant_type': 'refresh_token', + 'refresh_token': grant['refresh_token']} + +r = requests.post(url = "http://keycloak:8080/auth/realms/lagoon/protocol/openid-connect/token", data = data) +print r.text