crates_docs/server/auth/mod.rs
1//! Authentication module
2//!
3//! Provides OAuth 2.0 and API Key authentication support.
4//!
5//! # Authentication Methods
6//!
7//! - **OAuth 2.0**: Full OAuth flow with GitHub, Google, Keycloak support
8//! - **API Key**: Simple API key authentication with secure hashing
9//!
10//! # Example
11//!
12//! ```rust,no_run
13//! use crates_docs::server::auth::{ApiKeyConfig, AuthConfig};
14//!
15//! // Create API Key configuration
16//! let api_key_config = ApiKeyConfig {
17//! enabled: true,
18//! keys: vec!["sk_live_xxx".to_string()],
19//! header_name: "X-API-Key".to_string(),
20//! ..Default::default()
21//! };
22//! ```
23
24mod config;
25mod manager;
26mod token;
27mod types;
28
29#[cfg(test)]
30mod tests;
31
32#[cfg(feature = "api-key")]
33pub use config::ApiKeyConfig;
34pub use config::{AuthConfig, OAuthConfig};
35pub use manager::AuthManager;
36pub use token::{TokenInfo, TokenStore};
37#[cfg(feature = "api-key")]
38pub use types::GeneratedApiKey;
39pub use types::{AuthContext, AuthProvider, OAuthProvider};