From 43ddf5b709fc99e1adebfbeda91d97e39fd05b89 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Wed, 29 Jan 2020 16:04:03 -0500 Subject: [PATCH] Fix bug accessing auth tokens --- client-api/pvc-api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client-api/pvc-api.py b/client-api/pvc-api.py index 81578acf..0f403a51 100755 --- a/client-api/pvc-api.py +++ b/client-api/pvc-api.py @@ -160,7 +160,7 @@ def Authenticator(function): return function(*args, **kwargs) # Key header-based authentication if 'X-Api-Key' in flask.request.headers: - if any(token for token in secret_tokens if flask.request.headers.get('X-Api-Key') == token): + if any(token for token in config['auth_tokens'] if flask.request.headers.get('X-Api-Key') == token.get('token')): return function(*args, **kwargs) else: return {"message":"X-Api-Key Authentication failed"}, 401