Fix copydocs.py authentication errors
#11679
Open
+18
−6
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.
Closes #11628
Updates the
usernameused for authentication in thecopydocsscript. Theusernamenow matches that of the local/people/openlibraryaccount.Makes the following changes to the
OpenLibraryAPI class:loginmethods now authenticate via the local HTML login handlerTechnical
A recent update to the JSON login handler removed the ability to authenticate with username and password, and using S3 credentials triggers an S3 service call in the
audit_accountsfunction. Until and unless these calls are mocked in local development environments, the HTML login handler must be used to authenticate locally.Successful authentication requests to the HTML login handler always redirect. These redirected responses were missing the
Set-Cookieheader, which is needed to make authenticated calls with theOpenLibraryclient.Important
The
OpenLibraryclient is used bymanage-imports.py. Jobs using this script should be closely monitored for authentication errors after this is deployed.Testing
Run
copydocslocally, and expect books to be imported from openlibrary.org.Screenshot
Stakeholders