Skip to content

Commit 6880175

Browse files
committed
adapt to changes in gix-sec
1 parent 3a50af5 commit 6880175

File tree

2 files changed

+9
-5
lines changed
  • gix-credentials/src/protocol/context
  • gix-transport/src/client/blocking_io/http

2 files changed

+9
-5
lines changed

gix-credentials/src/protocol/context/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,8 @@ mod access {
4444
url: _,
4545
quit: _,
4646
} = &mut self;
47-
for secret_field in [password, oauth_refresh_token] {
48-
if let Some(secret) = secret_field {
49-
*secret = "<redacted>".into();
50-
}
47+
for secret in [password, oauth_refresh_token].into_iter().flatten() {
48+
*secret = "<redacted>".into();
5149
}
5250
self
5351
}

gix-transport/src/client/blocking_io/http/mod.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ impl<H: Http> Transport<H> {
243243
.map(|(user, pass)| gix_sec::identity::Account {
244244
username: user.to_string(),
245245
password: pass.to_string(),
246+
oauth_refresh_token: None,
246247
});
247248
Transport {
248249
url: url.to_bstring().to_string(),
@@ -296,7 +297,12 @@ impl<H: Http> Transport<H> {
296297

297298
#[allow(clippy::unnecessary_wraps, unknown_lints)]
298299
fn add_basic_auth_if_present(&self, headers: &mut Vec<Cow<'_, str>>) -> Result<(), client::Error> {
299-
if let Some(gix_sec::identity::Account { username, password }) = &self.identity {
300+
if let Some(gix_sec::identity::Account {
301+
username,
302+
password,
303+
oauth_refresh_token: _,
304+
}) = &self.identity
305+
{
300306
#[cfg(not(feature = "http-client-insecure-credentials"))]
301307
if self.url.starts_with("http://") {
302308
return Err(client::Error::AuthenticationRefused(

0 commit comments

Comments
 (0)