Handle PyPI unrecognized device login confirmation#48
Open
anth-volk wants to merge 2 commits into
Open
Conversation
Owner
|
Thank you for the PR. Unfortunately it's 1) over-complicated and 2) I'm not going to accept the debug auth option. |
Author
|
The code is complicated because PyPI offers a few different pathways on login. It could throw the new-ish "unauthorized login" page and request email verification, or it might not, and this code was aimed at handling both and keeping funcs as CLEAN and single-use as possible. --debug-auth grew out of testing I was doing, but I can understand why you might not want it. I'd be happy to either withdraw this or modify it, however you see fit, but every time I've used the tool without these modifications, the newer email verification request page breaks the tool for me. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
--debug-authoption for auth redirect/page-title diagnostics and sanitized HTML snapshotsContext
PyPI added login verification protections for unrecognized TOTP logins, documented here: https://blog.pypi.org/posts/2025-11-14-login-verification/
This also addresses the failure mode discussed in #42, where deletion reached the release page step but failed with a misleading missing-CSRF error after PyPI served a login-confirmation page instead: #42
Tests
env PYTHONPATH=src/main/python python -m unittest discover -s src/unittest/python -p '*tests.py'uvx --from pybuilder pyb -v