diff --git a/ocipkg/src/image/remote.rs b/ocipkg/src/image/remote.rs index 40da836..9399943 100644 --- a/ocipkg/src/image/remote.rs +++ b/ocipkg/src/image/remote.rs @@ -1,5 +1,5 @@ use crate::{ - distribution::Client, + distribution::{Client, StoredAuth}, image::{Image, ImageBuilder}, Digest, ImageName, }; @@ -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 { + 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 {