1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! OAuth 2.0 authentication support for LLM providers
//!
//! This module provides OAuth authentication support for various LLM providers,
//! starting with Anthropic Claude Pro/Max subscriptions.
//!
//! # Architecture
//!
//! - `config`: OAuth configuration types
//! - `error`: Error types for OAuth operations
//! - `flow`: OAuth 2.0 authorization code flow implementation
//! - `pkce`: PKCE (Proof Key for Code Exchange) implementation
//! - `provider`: OAuth provider trait and types
//! - `providers`: Concrete provider implementations
//! - `registry`: Provider registry for managing providers
//!
//! # Example
//!
//! ```rust,ignore
//! use stakpak_shared::oauth::{OAuthFlow, ProviderRegistry};
//!
//! // Get the Anthropic provider
//! let registry = ProviderRegistry::new();
//! let provider = registry.get("anthropic").unwrap();
//!
//! // Get OAuth config for Claude Pro/Max
//! let config = provider.oauth_config("claude-max").unwrap();
//!
//! // Start the OAuth flow
//! let mut flow = OAuthFlow::new(config);
//! let auth_url = flow.generate_auth_url();
//!
//! // User visits auth_url, gets code, then:
//! // let tokens = flow.exchange_code(code).await?;
//! // let auth = provider.post_authorize("claude-max", &tokens).await?;
//! ```
// Re-export commonly used types
pub use OAuthConfig;
pub use ;
pub use ;
pub use ;
pub use PkceChallenge;
pub use ;
pub use ;
pub use ProviderRegistry;