turbomcp_auth/
lib.rs

1//! # TurboMCP Auth - OAuth 2.1 and Authentication
2//!
3//! OAuth 2.1, API key authentication, and authorization functionality for the
4//! TurboMCP protocol with MCP specification compliance.
5//!
6//! ## Features
7//!
8//! - **OAuth 2.1** - RFC 8707/9728/7591 compliant with MCP resource binding
9//! - **Multi-Provider** - Google, GitHub, Microsoft, GitLab with PKCE
10//! - **API Key Auth** - Simple API key authentication provider
11//! - **Session Management** - Token storage and lifecycle management
12//! - **DPoP Support** - Optional RFC 9449 proof-of-possession tokens (feature: `dpop`)
13//!
14//! ## Architecture
15//!
16//! - `config` - Configuration types for authentication providers
17//! - `types` - Core authentication types (AuthContext, UserInfo, TokenInfo)
18//! - `providers` - Authentication provider implementations
19//!   - `api_key` - API key authentication
20//! - `manager` - Authentication manager for provider orchestration
21//! - `oauth2` - OAuth 2.1 client with authorization flows
22//!
23//! ## Feature Flags
24//!
25//! - `default` - Core authentication (no optional features)
26//! - `dpop` - Enable DPoP (RFC 9449) token binding support via `turbomcp-dpop`
27
28// Submodules
29pub mod config;
30pub mod manager;
31pub mod oauth2;
32pub mod providers;
33pub mod types;
34
35// Re-export configuration types
36#[doc(inline)]
37pub use config::*;
38
39// Re-export core types
40#[doc(inline)]
41pub use types::*;
42
43// Re-export providers
44#[doc(inline)]
45pub use providers::*;
46
47// Re-export manager
48#[doc(inline)]
49pub use manager::AuthManager;
50
51// Re-export DPoP types when feature is enabled
52#[cfg(feature = "dpop")]
53pub use turbomcp_dpop as dpop;