Load flask principal permissions even for web and api endpoints.
This commit is contained in:
parent
23cbcb2979
commit
9278871381
6 changed files with 33 additions and 15 deletions
|
@ -41,8 +41,8 @@ def process_basic_auth():
|
|||
ctx = _request_ctx_stack.top
|
||||
ctx.authenticated_user = authenticated
|
||||
|
||||
identity_changed.send(app, identity=Identity(authenticated.username))
|
||||
|
||||
identity_changed.send(app, identity=Identity(authenticated.username,
|
||||
'username'))
|
||||
return
|
||||
|
||||
# We weren't able to authenticate via basic auth.
|
||||
|
@ -85,7 +85,7 @@ def process_token():
|
|||
ctx = _request_ctx_stack.top
|
||||
ctx.validated_token = validated
|
||||
|
||||
identity_changed.send(app, identity=Identity(validated.code))
|
||||
identity_changed.send(app, identity=Identity(validated.code, 'token'))
|
||||
|
||||
return
|
||||
|
||||
|
@ -111,4 +111,4 @@ def extract_namespace_repo_from_session(f):
|
|||
abort(400)
|
||||
|
||||
return f(session['namespace'], session['repository'], *args, **kwargs)
|
||||
return wrapper
|
||||
return wrapper
|
||||
|
|
Reference in a new issue