forked from astral-sh/uv
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply from-URL credentials in authentication middleware (astral-sh#2449)
## Summary Right now, the middleware doesn't apply credentials that were _originally_ sourced from a URL. This requires that we call `with_url_encoded_auth` whenever we create a request to ensure that any credentials that were passed in as part of an index URL (for example) are respected. This PR modifies `uv-auth` to instead apply those credentials in the middleware itself. This seems preferable to me. As far as I can tell, we can _only_ add in-URL credentials to the store ourselves (since in-URL credentials are converted to headers by the time they reach the middleware). And if we ever _didn't_ apply those credentials to new URLs, it'd be a bug in the logic that precedes the middleware (i.e., us forgetting to call `with_url_encoded_auth`). ## Test Plan `cargo run pip install` with an authenticated index.
- Loading branch information
1 parent
10abeae
commit 8463d6d
Showing
5 changed files
with
17 additions
and
62 deletions.
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
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