ccproxy.auth.oauth.session¶
ccproxy.auth.oauth.session
¶
OAuth session management for handling OAuth state and PKCE.
This module provides session management for OAuth flows, storing state, PKCE verifiers, and other session data during the OAuth process.
OAuthSessionManager
¶
Manages OAuth session data during authentication flows.
This is a simple in-memory implementation. In production, consider using Redis or another persistent store.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ttl_seconds
|
int
|
Time-to-live for sessions in seconds (default: 10 minutes) |
600
|
Source code in ccproxy/auth/oauth/session.py
create_session
async
¶
Create a new OAuth session.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
str
|
OAuth state parameter (session key) |
required |
data
|
dict[str, Any]
|
Session data to store |
required |
Source code in ccproxy/auth/oauth/session.py
get_session
async
¶
Retrieve session data by state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
str
|
OAuth state parameter |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any] | None
|
Session data or None if not found/expired |
Source code in ccproxy/auth/oauth/session.py
delete_session
async
¶
Delete a session.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
str
|
OAuth state parameter |
required |
Source code in ccproxy/auth/oauth/session.py
clear_all
¶
get_oauth_session_manager
¶
Get the global OAuth session manager instance.
Returns:
| Type | Description |
|---|---|
OAuthSessionManager
|
Global OAuth session manager |
Source code in ccproxy/auth/oauth/session.py
reset_oauth_session_manager
¶
Reset the global OAuth session manager.
This clears all sessions and creates a new manager. Mainly useful for testing.