oci_distribution/
secrets.rs1#[derive(Eq, PartialEq, Debug, Clone)]
5pub enum RegistryAuth {
6 Anonymous,
8 Basic(String, String),
10}
11
12pub(crate) trait Authenticable {
13 fn apply_authentication(self, auth: &RegistryAuth) -> Self;
14}
15
16impl Authenticable for reqwest::RequestBuilder {
17 fn apply_authentication(self, auth: &RegistryAuth) -> Self {
18 match auth {
19 RegistryAuth::Anonymous => self,
20 RegistryAuth::Basic(username, password) => self.basic_auth(username, Some(password)),
21 }
22 }
23}