Expand description
Authentication module
Provides OAuth 2.0 and API Key authentication support.
§Authentication Methods
- OAuth 2.0: Full OAuth flow with GitHub, Google, Keycloak support
- API Key: Simple API key authentication with secure hashing
§Example
use crates_docs::server::auth::{ApiKeyConfig, AuthConfig};
// Create API Key configuration
let api_key_config = ApiKeyConfig {
enabled: true,
keys: vec!["sk_live_xxx".to_string()],
header_name: "X-API-Key".to_string(),
..Default::default()
};Structs§
- ApiKey
Config - API Key configuration
- Auth
Config - Authentication configuration (unified for OAuth and API Key)
- Auth
Context - Authentication context
- Auth
Manager - Authentication manager
- Generated
ApiKey - API Key generation result.
- OAuth
Config - OAuth configuration
- Token
Info - OAuth token information
- Token
Store - Simple in-memory token store (production should use Redis or database)
Enums§
- Auth
Provider - Authentication provider type
- OAuth
Provider - OAuth provider type