Skip to content

Commit 536a574

Browse files
authored
Remote::new_with_auth (#156)
Hot fix of #154 and #153
1 parent 449047f commit 536a574

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ocipkg/src/image/remote.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ impl Remote {
1717
let client = Client::from_image_name(&image_name)?;
1818
Ok(Self { image_name, client })
1919
}
20+
21+
pub fn new_with_auth(image_name: ImageName, auth: StoredAuth) -> Result<Self> {
22+
let client = Client::from_image_name_with_auth(&image_name, auth)?;
23+
Ok(Self { image_name, client })
24+
}
25+
26+
pub fn add_basic_auth(&mut self, domain: &str, username: &str, password: &str) {
27+
self.client.add_basic_auth(domain, username, password);
28+
}
2029
}
2130

2231
impl Image for Remote {

0 commit comments

Comments
 (0)