#[derive(Debug, Clone, PartialEq, Eq)]
pub enum ProxyAuth {
Basic { username: String, password: String },
Ident { user_id: String },
Bearer { token: String },
}
impl ProxyAuth {
pub fn basic(username: impl Into<String>, password: impl Into<String>) -> Self {
Self::Basic {
username: username.into(),
password: password.into(),
}
}
pub fn ident(user_id: impl Into<String>) -> Self {
Self::Ident { user_id: user_id.into() }
}
pub fn bearer(token: impl Into<String>) -> Self {
Self::Bearer { token: token.into() }
}
}