Skip to content
Snippets Groups Projects
Commit 8b2fe17e authored by Duncan Meacher's avatar Duncan Meacher
Browse files

Merge branch 'validate-token-without-path' into 'master'

Fix bug in parsing tokens with pathless scope

See merge request !54
parents 3404574c c0876a78
No related branches found
No related tags found
No related merge requests found
......@@ -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