Skip to content

Commit

Permalink
Update auth.py
Browse files Browse the repository at this point in the history
  • Loading branch information
daisieh committed Jan 11, 2025
1 parent b7833f5 commit 9d00e17
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/authx/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ def add_pending_user_to_opa(user_token):
return response, status_code


def list_pending_users_in_opa(token):
def list_pending_users_in_opa():
response, status_code = get_service_store_secret("opa", key=f"pending_users")
if status_code == 200:
response = list(response["pending_users"].keys())
Expand All @@ -773,14 +773,14 @@ def is_self_pending(token):
return response, status_code


def approve_pending_user_in_opa(user_name, token):
def approve_pending_user_in_opa(user_name):
response, status_code = get_service_store_secret("opa", key=f"pending_users")
if status_code != 200:
return response, status_code
pending_users = response["pending_users"]
if user_name in pending_users:
user_dict = pending_users[user_name]
response2, status_code = write_user_in_opa(user_dict, token)
response2, status_code = write_user_in_opa(user_dict)
if status_code == 200:
pending_users.pop(user_name)
response3, status_code = set_service_store_secret("opa", key=f"pending_users", value=json.dumps(response))
Expand All @@ -789,7 +789,7 @@ def approve_pending_user_in_opa(user_name, token):
return response, status_code


def reject_pending_user_in_opa(user_name, token):
def reject_pending_user_in_opa(user_name):
response, status_code = get_service_store_secret("opa", key=f"pending_users")
if status_code != 200:
return response, status_code
Expand All @@ -814,7 +814,7 @@ def reject_pending_user_in_opa(user_name, token):
return response, status_code


def clear_pending_users_in_opa(token):
def clear_pending_users_in_opa():
response, status_code = set_service_store_secret("opa", key="pending_users", value=json.dumps({"pending_users": {}}))
return response, status_code

Expand Down

0 comments on commit 9d00e17

Please sign in to comment.