mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 19:08:04 +00:00
Publish: Warn when keyring has no password (#8827)
When trying to upload without a password but with the keyring, check that the keyring has a password for the upload URL and username and warn if it doesn't. Fixes #8781
This commit is contained in:
parent
68e3228f2b
commit
0b0d0f44f8
6 changed files with 166 additions and 10 deletions
|
@ -76,7 +76,7 @@ impl Credentials {
|
|||
}
|
||||
}
|
||||
|
||||
pub(crate) fn username(&self) -> Option<&str> {
|
||||
pub fn username(&self) -> Option<&str> {
|
||||
self.username.as_deref()
|
||||
}
|
||||
|
||||
|
@ -84,7 +84,7 @@ impl Credentials {
|
|||
self.username.clone()
|
||||
}
|
||||
|
||||
pub(crate) fn password(&self) -> Option<&str> {
|
||||
pub fn password(&self) -> Option<&str> {
|
||||
self.password.as_deref()
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ impl KeyringProvider {
|
|||
/// Returns [`None`] if no password was found for the username or if any errors
|
||||
/// are encountered in the keyring backend.
|
||||
#[instrument(skip_all, fields(url = % url.to_string(), username))]
|
||||
pub(crate) async fn fetch(&self, url: &Url, username: &str) -> Option<Credentials> {
|
||||
pub async fn fetch(&self, url: &Url, username: &str) -> Option<Credentials> {
|
||||
// Validate the request
|
||||
debug_assert!(
|
||||
url.host_str().is_some(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue