ccproxy.auth.storage.json_file¶
ccproxy.auth.storage.json_file
¶
JSON file storage implementation for token storage.
JsonFileTokenStorage
¶
Bases: TokenStorage
JSON file storage implementation for Claude credentials with keyring fallback.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path
|
Path
|
Path to the JSON credentials file |
required |
Source code in ccproxy/auth/storage/json_file.py
load
async
¶
Load credentials from JSON file .
Returns:
Type | Description |
---|---|
ClaudeCredentials | None
|
Parsed credentials if found and valid, None otherwise |
Raises:
Type | Description |
---|---|
CredentialsInvalidError
|
If the JSON file is invalid |
CredentialsStorageError
|
If there's an error reading the file |
Source code in ccproxy/auth/storage/json_file.py
save
async
¶
Save credentials to both keyring and JSON file.
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 the file |
Source code in ccproxy/auth/storage/json_file.py
exists
async
¶
Check if credentials file exists.
Returns:
Type | Description |
---|---|
bool
|
True if file exists, False otherwise |
delete
async
¶
Delete credentials from both keyring and file.
Returns:
Type | Description |
---|---|
bool
|
True if deleted successfully, False otherwise |
Raises:
Type | Description |
---|---|
CredentialsStorageError
|
If there's an error deleting the file |