-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add an authentication
mode to [index]
configuration
#11600
Comments
thanks, it would be great if it can be set with an environment variable, like |
I wonder if a simple boolean In any case I'm eagerly awaiting for this option. This is currently a blocker for me to use |
I was thinking of cases where you don't want to accidentally leak credentials to another index |
Adds a new optional key `auth-policy` to `[tool.uv.index]` that sets the authentication policy for the index URL. The default is `"auto"`, which attempts to authenticate when necessary. `"always"` always attempts to authenticate and fails if the endpoint is unauthenticated. `"never"` never attempts to authenticate. These policy address two kinds of cases: * Some indexes don’t fail on unauthenticated requests; instead they just forward to the public PyPI. This can leave the user confused as to why their package is missing. The "always" policy prevents this. * "never" allows users to ensure their credentials couldn't be leaked to an unexpected index, though it will only allow for successful requests on an index that doesn't require credentials. Closes #11600
Summary
There’s a bit of design work to be done here, but the rough problem is this:
However, some indexes don’t fail on unauthenticated requests, instead they just forward to the public PyPI and now the user is confused their package is missing. The current solution is to tell users to set a username in their index URL, as that will force us to fetch credentials. However, if the username varies per user (sometimes its just a constant), they can’t commit that to the
pyproject.toml
. So, the idea is: add an authentication “mode” to thetool.uv.index
table which allows a user to explicitly say “never use authentication” or “always use authentication” for a given index.See
Example
Not a final design, but for example
The text was updated successfully, but these errors were encountered: