Make ADMIN_CLIENT_SECRET a list of a single secret

And support this change across our code. Note, this is a halfway step
where it is not a list rather than a string but still only supports a
single secret, ie one item in the list.
This commit is contained in:
David McDonald
2020-02-19 16:42:40 +00:00
parent f7f6be56c7
commit 52d3df49d4
4 changed files with 16 additions and 11 deletions

View File

@@ -61,7 +61,12 @@ def requires_admin_auth():
if client == current_app.config.get('ADMIN_CLIENT_USER_NAME'):
g.service_id = current_app.config.get('ADMIN_CLIENT_USER_NAME')
return handle_admin_key(auth_token, current_app.config.get('ADMIN_CLIENT_SECRET'))
secret = ""
if len(current_app.config.get('ADMIN_CLIENT_SECRETS')):
secret = current_app.config.get('ADMIN_CLIENT_SECRETS')[0]
return handle_admin_key(auth_token, secret)
else:
raise AuthError('Unauthorized: admin authentication token required', 401)