Rename ADMIN_CLIENT_USER_NAME to say CLIENT_ID

"user name" implies we're doing basic auth, which we're not. We
should use the standard terminology for bearer tokens.
This commit is contained in:
Ben Thorner
2021-07-29 12:18:10 +01:00
parent 323feedb1f
commit 3e32fc99b8
4 changed files with 8 additions and 8 deletions

View File

@@ -61,7 +61,7 @@ def requires_no_auth():
def requires_admin_auth():
requires_internal_auth(current_app.config.get('ADMIN_CLIENT_USER_NAME'))
requires_internal_auth(current_app.config.get('ADMIN_CLIENT_ID'))
def requires_internal_auth(expected_client_id):

View File

@@ -88,10 +88,10 @@ class Config(object):
API_INTERNAL_SECRETS = json.loads(os.environ.get('API_INTERNAL_SECRETS', '[]'))
# secrets that internal apps, such as the admin app or document download, must use to authenticate with the API
ADMIN_CLIENT_USER_NAME = 'notify-admin'
ADMIN_CLIENT_ID = 'notify-admin'
INTERNAL_CLIENT_API_KEYS = {
ADMIN_CLIENT_USER_NAME: API_INTERNAL_SECRETS
ADMIN_CLIENT_ID: API_INTERNAL_SECRETS
}
# encyption secret/salt
@@ -406,7 +406,7 @@ class Development(Config):
LETTER_SANITISE_BUCKET_NAME = 'development-letters-sanitise'
INTERNAL_CLIENT_API_KEYS = {
Config.ADMIN_CLIENT_USER_NAME: ['dev-notify-secret-key']
Config.ADMIN_CLIENT_ID: ['dev-notify-secret-key']
}
SECRET_KEY = 'dev-notify-secret-key'