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