Skip to content

Commit

Permalink
Merge pull request #150 from CanDIG/daisieh/remove-user-email
Browse files Browse the repository at this point in the history
  • Loading branch information
daisieh authored Jan 8, 2025
2 parents 51e45bd + b342619 commit 811a5e1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 54 deletions.
34 changes: 0 additions & 34 deletions ingest_openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -206,40 +206,6 @@ paths:
application/json:
schema:
type: object
/program/{program_id}/email/{email}:
parameters:
- in: path
name: program_id
schema:
type: string
required: true
- in: path
name: email
schema:
type: string
required: true
post:
summary: Add user access for a dataset
description: Add user access for a dataset
operationId: ingest_operations.add_user_access
responses:
200:
description: Success
content:
application/json:
schema:
type: object
delete:
summary: Delete user access for a dataset
description: Delete user access for a dataset
operationId: ingest_operations.remove_user_access
responses:
200:
description: Success
content:
application/json:
schema:
type: object
/user/pending/request:
post:
summary: Add pending user
Expand Down
23 changes: 3 additions & 20 deletions ingest_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,27 +281,8 @@ def remove_program(program_id):
return response, 500


@app.route('/program/<path:program_id>/email/<path:email>')
def add_user_access(program_id, email):
token = connexion.request.headers['Authorization'].split("Bearer ")[1]
try:
result, status_code = add_user_to_dataset(email, program_id, token)
return result, status_code
except Exception as e:
return {"error": str(e)}, 500


@app.route('/program/<path:program_id>/email/<path:email>')
def remove_user_access(program_id, email):
token = connexion.request.headers['Authorization'].split("Bearer ")[1]
try:
result, status_code = remove_user_from_dataset(email, program_id, token)
return result, status_code
except Exception as e:
return {"error": str(e)}, 500

####
# Pending users
# Pending users: approving a pending user creates a CanDIG-authorized user
####

def add_pending_user():
Expand Down Expand Up @@ -358,6 +339,7 @@ def clear_pending_users():
response, status_code = auth.clear_pending_users_in_opa(token)
return response, status_code


####
# DAC authorization for users
####
Expand Down Expand Up @@ -441,6 +423,7 @@ def remove_program_for_user(user_id, program_id):
return response, status_code
return {"error": f"No program {program_id} found for user"}, status_code


@app.route('/get-token')
def get_token():
# Attempt to grab the token via session_id
Expand Down

0 comments on commit 811a5e1

Please sign in to comment.