Skip to content

ccproxy.auth.models.credentials

ccproxy.auth.models.credentials

Base credentials protocol for all authentication implementations.

BaseCredentials

Bases: Protocol

Protocol that all credential implementations must follow.

This defines the contract for credentials without depending on any specific provider implementation.

is_expired

is_expired()

Check if the credentials are expired.

Returns:

Type Description
bool

True if expired, False otherwise

Source code in ccproxy/auth/models/credentials.py
def is_expired(self) -> bool:
    """Check if the credentials are expired.

    Returns:
        True if expired, False otherwise
    """
    ...

to_dict

to_dict()

Convert credentials to dictionary for storage.

Returns:

Type Description
dict[str, Any]

Dictionary representation of credentials

Source code in ccproxy/auth/models/credentials.py
def to_dict(self) -> dict[str, Any]:
    """Convert credentials to dictionary for storage.

    Returns:
        Dictionary representation of credentials
    """
    ...

from_dict classmethod

from_dict(data)

Create credentials from dictionary.

Parameters:

Name Type Description Default
data dict[str, Any]

Dictionary containing credential data

required

Returns:

Type Description
BaseCredentials

Credentials instance

Source code in ccproxy/auth/models/credentials.py
@classmethod
def from_dict(cls, data: dict[str, Any]) -> "BaseCredentials":
    """Create credentials from dictionary.

    Args:
        data: Dictionary containing credential data

    Returns:
        Credentials instance
    """
    ...