Add keyring integration for git credentials#15456
Draft
jtfmumm wants to merge 1 commit intojtfm/keyring-explorationfrom
Draft
Add keyring integration for git credentials#15456jtfmumm wants to merge 1 commit intojtfm/keyring-explorationfrom
jtfmumm wants to merge 1 commit intojtfm/keyring-explorationfrom
Conversation
4a382fc to
80154a2
Compare
523f733 to
70128eb
Compare
jtfmumm
commented
Aug 22, 2025
| /// persisted to the system keyring for future use. | ||
| /// | ||
| /// Returns the previously stored credentials for this URL, if any. | ||
| pub async fn insert( |
Contributor
Author
There was a problem hiding this comment.
This method was switched to async for calling KeyringProvider::store_if_native, as was store_credentials_from_url below.
jtfmumm
commented
Aug 22, 2025
| /// Fetch the underlying Git repository at the given revision. | ||
| #[instrument(skip(self), fields(repository = %self.git.repository(), rev = ?self.git.precise()))] | ||
| pub fn fetch(self) -> Result<Fetch> { | ||
| pub async fn fetch(self, keyring_provider: Option<&KeyringProvider>) -> Result<Fetch> { |
Contributor
Author
There was a problem hiding this comment.
This method was switched to async in order to call KeyringProvider::fetch_if_native. As a result, a immediately invoked closure below was converted to a spawn_blocking call. It's worth noting that this change holds whether or not the keyring provider is configured to be native.
80154a2 to
ec49f65
Compare
b5210b0 to
ccfabfe
Compare
ccfabfe to
ce94163
Compare
ce94163 to
83dc944
Compare
83dc944 to
cb5a707
Compare
4be8581 to
9f8fb3c
Compare
9f8fb3c to
0ef62d2
Compare
0c869fd to
f2eed74
Compare
f2eed74 to
676373d
Compare
676373d to
7f3adc3
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds native keyring integration for persisting and fetching git credentials. On successful authentication for a git repo, credentials are persisted to the system keyring if
keyring-provider = "native". Future invocations will be able to find these credentials even in the absence of a git credential helper (though you must currently still provide a username on future invocations, see #10866).Credentials are stored in the system keyring with a
uv-credentials:prefix (see #14559), e.g., the keyring service for a GitHub repo would be nameduv-credentials:https://github.com/<org>/<repo>.TODO:
uv sync(there is currently only a new test foruv add). I've successfully testeduv synclocally but ideally we should have an automated test.Depends on #14559.