Skip to content

Commit

Permalink
Merge pull request #17 from i4Trust/python-til
Browse files Browse the repository at this point in the history
Fix role evaluation
  • Loading branch information
dwendland authored Jun 7, 2023
2 parents 0224f62 + 4f2822b commit 9dafdf8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/util/issuer_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@ def decode_token_with_jwk(token, conf):

# Check if credential contains necessary role
def check_role(credential_roles, required_role, provider_id):

# Loop over credential roles and look for required role
for r in credential_roles:
if 'target' in r and r['target'] == provider_id:
if 'names' in r['target']:
r_names = r['target']['names']
if 'names' in r:
r_names = r['names']
if required_role in r_names:
return True

Expand Down

0 comments on commit 9dafdf8

Please sign in to comment.