Skip to content

Conversation

@woodruffw
Copy link
Contributor

@woodruffw woodruffw commented Jan 23, 2026

This is my last intended change to PEP 807 before submitting to another round of review.

What I've done here is make the discovery flow (which was already defined in the PEP) reversible: the previous flow used a strong trapdoor function (SHA-256) to compute the "discovery key," which effectively meant that indices would need to precompute every valid discovery key. This quickly becomes infeasible (or at least very annoying) for index topologies with ~thousands of distinct upload endpoints, particularly if those endpoints can vary by case, escaping, etc.

The alternative is much simpler: instead of using a trapdoor function, we compute the discovery key as a query-safe URL encoding. This is completely reversible, less opaque, and is equally built into Python (with quote_plus).


📚 Documentation preview 📚: https://pep-previews--4791.org.readthedocs.build/

Signed-off-by: William Woodruff <william@astral.sh>
@woodruffw woodruffw requested a review from dstufft as a code owner January 23, 2026 18:30
@hugovk hugovk merged commit 39375d2 into python:main Jan 23, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants