-
Notifications
You must be signed in to change notification settings - Fork 928
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
No keyring support for authentication #1520
Comments
This seems reasonable. We'll need to find a Rust equivalent to https://pypi.org/project/keyring/ |
keyring is a cli app already. Probably want to add support for existing Python one first to maximize compatibility. Different auth methods need different plugins. AWS, Azure and Google Cloud each have their own plugins to use the more secure auth methods (no username/password). Then you could migrate to a native only solution. |
Agreed that calling the cli is probably easiest. The cli equivalent of what pip is calling in python is really simple: |
https://pip.pypa.io/en/stable/topics/authentication/#using-keyring-as-a-command-line-application |
Thanks for the details! Much appreciated. |
I'd also discourage this approach. There are many Python plugins to https://github.com/Microsoft/artifacts-keyring |
<!-- Thank you for contributing to uv! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? - Does this pull request include references to any relevant issues? --> ## Summary <!-- What's the purpose of the change? What does it do, and why? --> Adds basic keyring auth support for `uv` commands. Adds clone of `pip`'s `--keyring-provider subprocess` argument (using CLI `keyring` tool). See issue: #1520 ## Test Plan <!-- How was it tested? --> Hard to write full-suite unit tests due to reliance on `process::Command` for `keyring` cli Manually tested end-to-end in a project with GCP artifact registry using keyring password: ```bash ➜ uv pip uninstall watchdog Uninstalled 1 package in 46ms - watchdog==4.0.0 ➜ cargo run -- pip install --index-url https://<redacted>/python/simple/ --extra-index-url https://<redacted>/pypi-mirror/simple/ watchdog Finished dev [unoptimized + debuginfo] target(s) in 0.18s Running `target/debug/uv pip install --index-url 'https://<redacted>/python/simple/' --extra-index-url 'https://<redacted>/pypi-mirror/simple/' watchdog` error: HTTP status client error (401 Unauthorized) for url (https://<redacted>/pypi-mirror/simple/watchdog/) ➜ cargo run -- pip install --keyring-provider subprocess --index-url https://<redacted>/python/simple/ --extra-index-url https://<redacted>/pypi-mirror/simple/ watchdog Finished dev [unoptimized + debuginfo] target(s) in 0.17s Running `target/debug/uv pip install --keyring-provider subprocess --index-url 'https://<redacted>/python/simple/' --extra-index-url 'https://<redacted>/pypi-mirror/simple/' watchdog` Resolved 1 package in 2.34s Installed 1 package in 27ms + watchdog==4.0.0 ``` `requirements.txt` ``` # # This file is autogenerated by pip-compile with Python 3.10 # by the following command: # # .bin/generate-requirements # --index-url https://<redacted>/python/simple/ --extra-index-url https://<redacted>/pypi-mirror/simple/ ... ``` ```bash ➜ cargo run -- pip install --keyring-provider subprocess -r requirements.txt Finished dev [unoptimized + debuginfo] target(s) in 0.19s Running `target/debug/uv pip install --keyring-provider subprocess -r requirements.txt` Resolved 205 packages in 23.52s Built <redacted> ... Downloaded 47 packages in 19.32s Installed 195 packages in 276ms + <redacted> ... ``` --------- Co-authored-by: Thomas Gilgenast <thomas@vant.ai> Co-authored-by: Zanie Blue <contact@zanie.dev>
As of #2254 |
Sorry for continuing on this topic, but I'm trying to create a Here's what I've tried so far:
Interestingly, when I use standard pip, I can install my private package without any issues. Here's the code that works:
Am I missing something? Any help would be appreciated! |
Try |
Thanks, it worked when I used this command:
Does this not defeat the purpose of using a keyring? |
@jonataseduardo keyring requires a username to retrieve a password via the CLI — you can just provide the username in the index URL you don't need to include the token too. |
Sure! The command
worked. I had forgotten to include the It would be helpful to include something like the following in the documentation:
Thanks a lot! |
It appears
uv
does not have support for keyring like pip does.https://pip.pypa.io/en/stable/topics/authentication/#keyring-support
The text was updated successfully, but these errors were encountered: