pub struct AuthConfig {
pub mode: AuthMode,
pub jwt_secret: Option<Vec<u8>>,
pub api_keys_path: PathBuf,
pub rate_limit_rpm: u32,
}Expand description
Authentication configuration for the API server.
Fields§
§mode: AuthModeWhether auth is enabled or bypassed.
jwt_secret: Option<Vec<u8>>HMAC-SHA256 secret for JWT signing. None when mode == Off.
api_keys_path: PathBufPath to the API keys JSON file.
rate_limit_rpm: u32Maximum requests per minute per API key.
Implementations§
Source§impl AuthConfig
impl AuthConfig
Sourcepub fn from_env() -> Result<Self, AuthConfigError>
pub fn from_env() -> Result<Self, AuthConfigError>
Build auth configuration from environment variables.
§Environment variables
AA_AUTH:"on"(default) or"off"(bypass mode)AA_JWT_SECRET: HMAC key for JWT, required when auth is enabledAA_API_KEYS_PATH: path to API keys file (default~/.aa/api-keys.json)AA_RATE_LIMIT_RPM: requests per minute per key (default 1000)
Trait Implementations§
Source§impl Clone for AuthConfig
impl Clone for AuthConfig
Source§fn clone(&self) -> AuthConfig
fn clone(&self) -> AuthConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AuthConfig
impl RefUnwindSafe for AuthConfig
impl Send for AuthConfig
impl Sync for AuthConfig
impl Unpin for AuthConfig
impl UnsafeUnpin for AuthConfig
impl UnwindSafe for AuthConfig
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