-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request account removal #447
Merged
cassidysymons
merged 33 commits into
biocore:master-overhaul
from
charles-cowart:request_account_removal
Jan 6, 2023
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
100524d
Added user-level request-account-deletion support.
charles-cowart d4e53e5
Added unit-testing, cancel method.
charles-cowart b466adc
Added delete/ignore support, logging.
charles-cowart 857754f
Added notification email for when an account is deleted
charles-cowart e61d607
Test removal of send_email()
charles-cowart a2ac112
Toggle disable_auth flag
charles-cowart 6cadc8a
Reinstate send_mail()
charles-cowart c0f6b15
Remove disable_authentication from server_config.json
charles-cowart e1b35f9
Bugfix
charles-cowart cb31db9
Undo send_email()
charles-cowart 2954b83
Revert "Bugfix"
charles-cowart 8df7639
Reapplied fixes
charles-cowart 252a10f
Formatting changes based on feedback.
charles-cowart 5081cb1
Updated recent formatting changes
charles-cowart fffbe33
Updated based on feedback.
charles-cowart 76f747b
Commented out send_mail() in allow_removal_request()
charles-cowart dedc72d
Uncommenting send_email() to obtain CI results
charles-cowart 2fbabb3
Remove send notification email when deleting user
charles-cowart 0709309
Removed vestigial email notification-related code
charles-cowart 15b39a9
Rename 0101.sql to 0102.sql
charles-cowart 825e42c
Merge branch 'master' into request_account_removal
charles-cowart 93355ea
Update vioscreen_repo.py
charles-cowart 288bc16
Resolve name conflict
charles-cowart 9f1f00b
Merge branch 'master-overhaul' into request_account_removal
charles-cowart 59612f0
Commits don't occur in repos
charles-cowart 1a3b7f6
Account queue now records admin id instead of sub
charles-cowart 4b8f945
Added unittests for removal_queue_repo.py
charles-cowart 782423d
New cleanup code targets only ids created for testing
charles-cowart 56f47b1
Endpoint added for cancel_request_remove_account()
charles-cowart 885005d
Changed disposition to enum type
charles-cowart f3b9e45
Update server.py
cassidysymons 9df1430
Update vioscreen_repo.py
cassidysymons 490738e
Rename 0110.sql to 0111.sql
cassidysymons File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from flask import jsonify | ||
from microsetta_private_api.repo.transaction import Transaction | ||
from microsetta_private_api.repo.removal_queue_repo import RemovalQueueRepo | ||
from microsetta_private_api.api._account import _validate_account_access | ||
|
||
|
||
def check_request_remove_account(account_id, token_info): | ||
# raises 401 if method fails | ||
_validate_account_access(token_info, account_id) | ||
|
||
with Transaction() as t: | ||
rq_repo = RemovalQueueRepo(t) | ||
status = rq_repo.check_request_remove_account(account_id) | ||
result = {'account_id': account_id, 'status': status} | ||
return jsonify(result), 200 | ||
|
||
|
||
def request_remove_account(account_id, token_info): | ||
# raises 401 if method fails | ||
_validate_account_access(token_info, account_id) | ||
|
||
with Transaction() as t: | ||
rq_repo = RemovalQueueRepo(t) | ||
rq_repo.request_remove_account(account_id) | ||
t.commit() | ||
|
||
return jsonify(code=200, message="Request Accepted"), 200 | ||
|
||
|
||
def cancel_request_remove_account(account_id, token_info): | ||
# raises 401 if method fails | ||
_validate_account_access(token_info, account_id) | ||
|
||
with Transaction() as t: | ||
rq_repo = RemovalQueueRepo(t) | ||
rq_repo.cancel_request_remove_account(account_id) | ||
t.commit() | ||
|
||
return jsonify(code=200, message="Request Accepted"), 200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
verify this has an endpoint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Endpoint added. I apparently added cancel_request_remove_account () for completeness. The UI doesn't use this functionality because we didn't want the user to cancel a request once they made it, and do it again. The UI will instead show a 'Your account deletion request is being reviewed.' msg instead.