Skip to content

Commit

Permalink
fix role_types
Browse files Browse the repository at this point in the history
  • Loading branch information
daisieh committed Jan 17, 2025
1 parent 60fc13b commit 2679bcf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/authx/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,14 +673,14 @@ def remove_program_from_opa(program_id):
def list_role_types_in_opa():
result, status_code = get_service_store_secret("opa", key=f"site_roles")
if status_code == 200:
return result['site_roles'], 200
return list(result['site_roles'].keys()), 200
return result, status_code


def get_role_type_in_opa(role_type):
result, status_code = get_service_store_secret("opa", key=f"site_roles")
if status_code == 200:
if role_type in result['site_roles']:
if role_type in list(result['site_roles'].keys()):
return {role_type: result['site_roles'][role_type]}, 200
return {"error": f"role type {role_type} does not exist"}, 404
return result, status_code
Expand Down

0 comments on commit 2679bcf

Please sign in to comment.