Skip to content

Commit

Permalink
verifying visa issuer
Browse files Browse the repository at this point in the history
  • Loading branch information
costero-e committed Mar 27, 2024
1 parent a3119ac commit 7e44629
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions permissions/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ async def get_user_info(access_token):
for visa_dataset in visa_datasets:
try:
visa = jwt.decode(visa_dataset, options={"verify_signature": False}, algorithms=["RS256"])
if visa['iss']==conf.lsaai_issuer:
pass
elif visa['iss']==conf.idp_issuer:
pass
else:
raise web.HTTPUnauthorized('invalid token')
dataset_url = visa["ga4gh_visa_v1"]["value"]
dataset_url_splitted = dataset_url.split('/')
visa_dataset = dataset_url_splitted[-1]
Expand Down

0 comments on commit 7e44629

Please sign in to comment.