ccproxy.auth.storage.keyring¶
ccproxy.auth.storage.keyring
¶
OS keyring storage implementation for token storage.
KeyringTokenStorage
¶
Bases: TokenStorage
OS keyring storage implementation for Claude credentials.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
service_name
|
str
|
Name of the service in the keyring |
'claude-code-proxy'
|
username
|
str
|
Username to associate with the stored credentials |
'default'
|
Source code in ccproxy/auth/storage/keyring.py
load
async
¶
Load credentials from the OS keyring.
Returns:
Type | Description |
---|---|
ClaudeCredentials | None
|
Parsed credentials if found and valid, None otherwise |
Raises:
Type | Description |
---|---|
CredentialsStorageError
|
If the stored data is invalid |
CredentialsStorageError
|
If there's an error reading from keyring |
Source code in ccproxy/auth/storage/keyring.py
save
async
¶
Save credentials to the OS keyring.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
credentials
|
ClaudeCredentials
|
Credentials to save |
required |
Returns:
Type | Description |
---|---|
bool
|
True if saved successfully, False otherwise |
Raises:
Type | Description |
---|---|
CredentialsStorageError
|
If there's an error writing to keyring |
Source code in ccproxy/auth/storage/keyring.py
exists
async
¶
Check if credentials exist in the keyring.
Returns:
Type | Description |
---|---|
bool
|
True if credentials exist, False otherwise |
Source code in ccproxy/auth/storage/keyring.py
delete
async
¶
Delete credentials from the keyring.
Returns:
Type | Description |
---|---|
bool
|
True if deleted successfully, False otherwise |
Raises:
Type | Description |
---|---|
CredentialsStorageError
|
If there's an error deleting from keyring |