Enable system keyring integration via --keyring-provider native
#14559
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.
Proof of concept integration of system keyring for credentials, using the keyring-rs crate.
This PR adds a new keyring provider backend called
KeyringProviderBackend::Native
and configured via--keyring-provider native
. When this backend is enabled, uv auth middleware will attempt to retrieve missing credentials from the system keyring. It will also store index credentials in the system keyring upon successful authentication, enabling users to provide their credentials for an index once and successfully authenticate on future invocations.Credentials are stored in the system keyring for a "service"/username pair. For the service, this currently prefixes the index URL with
uv-credentials-
. This prefix could help prevent collisions but would also be useful for determining which keyring credentials have been set by uv. Note that this is currently using the index URL instead of the index name for the service.Left to do:
libdbus
, which is not currently installed in CI--preview
flag, unless we think it's enough that you must explicitly configure anative
keyring provider (we've discussed making it the default, but that's not the behavior here)