ccproxy.auth.manager¶
ccproxy.auth.manager
¶
Unified authentication manager interface for all providers.
AuthManager
¶
Bases: Protocol
Unified authentication manager protocol for all providers.
This protocol defines the complete interface that all authentication managers must implement, supporting both provider-specific methods (like Claude credentials) and generic methods (like auth headers) for maximum flexibility.
get_access_token
async
¶
Get valid access token.
Returns:
| Type | Description |
|---|---|
str
|
Access token string |
Raises:
| Type | Description |
|---|---|
AuthenticationError
|
If authentication fails |
get_credentials
async
¶
Get valid credentials.
Note: For non-Claude providers, this may return minimal/dummy credentials or raise AuthenticationError if not supported.
Returns:
| Type | Description |
|---|---|
BaseCredentials
|
Valid credentials |
Raises:
| Type | Description |
|---|---|
AuthenticationError
|
If authentication fails or not supported |
Source code in ccproxy/auth/manager.py
is_authenticated
async
¶
Check if current authentication is valid.
Returns:
| Type | Description |
|---|---|
bool
|
True if authenticated, False otherwise |
get_user_profile
async
¶
Get standardized user profile information.
Returns:
| Type | Description |
|---|---|
StandardProfileFields | None
|
Standardized profile details when available, otherwise |
StandardProfileFields | None
|
for providers that do not expose profile metadata. |
Source code in ccproxy/auth/manager.py
validate_credentials
async
¶
Validate that credentials are available and valid.
Returns:
| Type | Description |
|---|---|
bool
|
True if credentials are valid, False otherwise |