pub struct AuthManager { /* private fields */ }Expand description
Authentication manager
Implementations§
Source§impl AuthManager
impl AuthManager
Sourcepub fn new(config: OAuthConfig) -> Result<Self>
pub fn new(config: OAuthConfig) -> Result<Self>
Create a new authentication manager
Sourcepub fn with_config(config: AuthConfig) -> Result<Self>
pub fn with_config(config: AuthConfig) -> Result<Self>
Create a new authentication manager with full config
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if authentication is enabled
Sourcepub fn config(&self) -> &OAuthConfig
pub fn config(&self) -> &OAuthConfig
Get OAuth configuration
Sourcepub fn api_key_config(&self) -> &ApiKeyConfig
pub fn api_key_config(&self) -> &ApiKeyConfig
Get API key configuration
Sourcepub fn validate_api_key(&self, key: &str) -> bool
pub fn validate_api_key(&self, key: &str) -> bool
Validate API key
Sourcepub fn generate_api_key(&self) -> Result<GeneratedApiKey>
pub fn generate_api_key(&self) -> Result<GeneratedApiKey>
Trait Implementations§
Source§impl Debug for AuthManager
impl Debug for AuthManager
Source§impl Default for AuthManager
impl Default for AuthManager
Source§fn default() -> AuthManager
fn default() -> AuthManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AuthManager
impl RefUnwindSafe for AuthManager
impl Send for AuthManager
impl Sync for AuthManager
impl Unpin for AuthManager
impl UnsafeUnpin for AuthManager
impl UnwindSafe for AuthManager
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