Skip to content

Commit

Permalink
RemoteBuilder::new_with_auth and add_basic_auth (#154)
Browse files Browse the repository at this point in the history
Hot fix of #153. These methods are forwarded from `RemoteBuilder` to
`Client`
  • Loading branch information
termoshtt authored Jun 5, 2024
1 parent 745850b commit 3a3d466
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion ocipkg/src/image/remote.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::{
distribution::Client,
distribution::{Client, StoredAuth},
image::{Image, ImageBuilder},
Digest, ImageName,
};
Expand Down Expand Up @@ -44,6 +44,15 @@ impl RemoteBuilder {
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 ImageBuilder for RemoteBuilder {
Expand Down

0 comments on commit 3a3d466

Please sign in to comment.