Skip to content

Commit

Permalink
Add keyring logs for URL and host fetches (#3212)
Browse files Browse the repository at this point in the history
So we can identify when we need to fall back to the host.
  • Loading branch information
zanieb committed Apr 24, 2024
1 parent a07adf7 commit a5abb8e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/uv-auth/src/keyring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::collections::HashSet;
use std::sync::RwLock;

use tokio::process::Command;
use tracing::{debug, instrument, warn};
use tracing::{debug, instrument, trace, warn};
use url::Url;

use crate::credentials::Credentials;
Expand Down Expand Up @@ -78,6 +78,7 @@ impl KeyringProvider {

// Check the full URL first
// <https://github.com/pypa/pip/blob/ae5fff36b0aad6e5e0037884927eaa29163c0611/src/pip/_internal/network/auth.py#L376C1-L379C14>
trace!("Checking keyring for URL {url}");
let mut password = match self.backend {
KeyringProviderBackend::Subprocess => {
self.fetch_subprocess(url.as_str(), username).await
Expand All @@ -89,6 +90,7 @@ impl KeyringProvider {
};
// And fallback to a check for the host
if password.is_none() {
trace!("Checking keyring for host {host}");
password = match self.backend {
KeyringProviderBackend::Subprocess => self.fetch_subprocess(host, username).await,
#[cfg(test)]
Expand Down

0 comments on commit a5abb8e

Please sign in to comment.