-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Account anonymization POST handler
#11053
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
Account anonymization POST handler
#11053
Conversation
243deab to
c1f5971
Compare
fb4238a to
2a375e4
Compare
7c03a93 to
eab1ca6
Compare
| # Fetch and anonymize account | ||
| xauthn_response = InternetArchiveAccount.s3auth(s3_access, s3_secret) | ||
| if 'error' in xauthn_response: | ||
| raise web.HTTPError("404 Not Found", {"Content-Type": "application/json"}) |
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.
A 404 isn't exactly an accurate status code for this case. This could fail for any number of reasons. How should we handle this?
Adds handling for a `test` query parameter. if `test` is "true", the account anonymization will not occur.
3fbfe9c to
123b1d4
Compare
f931ab8 to
423d546
Compare
for more information, see https://pre-commit.ci
|
|
||
| parsed_origin = urlparse(origin) | ||
| host = parsed_origin.hostname | ||
| return host == "archive.org" or host.endswith(".archive.org") |
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.
We might be safe enough with just "archive.org"
Addresses #10976
Adds new
POSThandler that can be used to anonymize Open Library accounts via archive.org.POSTrequests to/account/anonymize.jsoncontaining validx-s3-accessandx-s3-secretheaders trigger an account anonymization action on the associated account.Technical
/account/anonymize.jsonresponses200 OK400 Bad Request403 Forbidden404 Not Found500 Internal Server ErrorAdding
?test=trueto account anonymization requests will trigger the account anonymization intestmode, which will prevent the account from actually being anonymized.Testing
Screenshot
Stakeholders