Authentication for admin client api calls where a user and service is not required.

This commit is contained in:
Rebecca Law
2016-01-19 14:01:26 +00:00
parent 571661ceb0
commit d15e68238d
4 changed files with 30 additions and 33 deletions

View File

@@ -47,7 +47,14 @@ def requires_auth():
def fetch_client(client):
return {
"client": client,
"secret": get_unsigned_secret(client)
}
from flask import current_app
if client == current_app.config.get('ADMIN_CLIENT_USER_NAME'):
return {
"client": client,
"secret": current_app.config.get('ADMIN_CLIENT_SECRET')
}
else:
return {
"client": client,
"secret": get_unsigned_secret(client)
}