Change app registry to use the credentials verification system

Allows for tokens, OAuth tokens and robot accounts to be used as well

Fixes https://jira.prod.coreos.systems/browse/QS-36
This commit is contained in:
Joseph Schorr 2017-10-27 14:55:49 -04:00 committed by Joseph Schorr
parent aa49b37ad2
commit 3bf8973fd9
3 changed files with 13 additions and 7 deletions

View file

@ -96,9 +96,13 @@ def create_user():
if kind == CredentialKind.oauth_token:
abort(400, 'Invalid oauth access token.', issue='invalid-oauth-access-token')
# Mark that the login failed.
event = userevents.get_event(username)
event.publish_event_data('docker-cli', {'action': 'loginfailure'})
if kind == CredentialKind.user:
# Mark that the login failed.
event = userevents.get_event(username)
event.publish_event_data('docker-cli', {'action': 'loginfailure'})
abort(400, result.error_message, issue='login-failure')
# Default case: Just fail.
abort(400, result.error_message, issue='login-failure')
if result.has_user: