diff --git a/ingest_openapi.yaml b/ingest_openapi.yaml index eb0d7bc..98e990c 100644 --- a/ingest_openapi.yaml +++ b/ingest_openapi.yaml @@ -317,11 +317,11 @@ paths: application/json: schema: type: object - /user/self_authorize: + /user/self/authorize: get: - summary: List program authorizations + summary: List own program authorizations description: List authorizations for programs for the authenticated user - operationId: ingest_operations.is_self_authorized + operationId: ingest_operations.list_programs_for_self responses: 200: description: Success diff --git a/ingest_operations.py b/ingest_operations.py index debb6b1..062c8a9 100644 --- a/ingest_operations.py +++ b/ingest_operations.py @@ -362,7 +362,8 @@ def clear_pending_users(): # DAC authorization for users #### -def is_self_authorized(): +@app.route('/user/self/authorize') +def list_programs_for_self(): token = connexion.request.headers['Authorization'].split("Bearer ")[1] response, status_code = auth.get_self_in_opa(token) if status_code == 404: