pub struct AuthState {
pub proxy_api_key: Option<SecretString>,
pub proxy_token: Option<SecretString>,
pub proxy_auth_keys: HashMap<String, AuthKeyEntry>,
}Expand description
Auth configuration extracted from ProxyConfig.
Used as axum state for the auth middleware.
Fields§
§proxy_api_key: Option<SecretString>Optional simple auth key.
proxy_token: Option<SecretString>Optional simple token auth.
proxy_auth_keys: HashMap<String, AuthKeyEntry>Role-based auth mapping from API keys to roles.
Implementations§
Source§impl AuthState
impl AuthState
Sourcepub fn from_config(config: &ProxyConfig) -> Self
pub fn from_config(config: &ProxyConfig) -> Self
Creates an AuthState from a ProxyConfig.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AuthState
impl RefUnwindSafe for AuthState
impl Send for AuthState
impl Sync for AuthState
impl Unpin for AuthState
impl UnsafeUnpin for AuthState
impl UnwindSafe for AuthState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more