Skip to content
Snippets Groups Projects
Unverified Commit c0876a78 authored by Duncan Macleod's avatar Duncan Macleod
Browse files

auth: fix bug in parsing tokens with pathless scope

parent 9174b7a2
No related branches found
No related tags found
1 merge request!54Fix bug in parsing tokens with pathless scope
......@@ -93,7 +93,14 @@ def _validate_scitoken(request):
audience=audience,
)
authz, path = scope.split(":", 1)
# parse authz operation and path (if present)
try:
authz, path = scope.split(":", 1)
except ValueError:
authz = scope
path = None
# test the token
if not enforcer.test(token, authz, path):
raise RuntimeError("token enforcement failed")
current_app.logger.info('User SciToken authorised.')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment