Skip to content

Commit

Permalink
Remote::new_with_auth (#156)
Browse files Browse the repository at this point in the history
Hot fix of #154 and #153
  • Loading branch information
termoshtt committed Jun 5, 2024
1 parent 449047f commit 536a574
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ocipkg/src/image/remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ impl Remote {
let client = Client::from_image_name(&image_name)?;
Ok(Self { image_name, client })
}

pub fn new_with_auth(image_name: ImageName, auth: StoredAuth) -> Result<Self> {
let client = Client::from_image_name_with_auth(&image_name, auth)?;
Ok(Self { image_name, client })
}

pub fn add_basic_auth(&mut self, domain: &str, username: &str, password: &str) {
self.client.add_basic_auth(domain, username, password);
}
}

impl Image for Remote {
Expand Down

0 comments on commit 536a574

Please sign in to comment.