Skip to content

ccproxy.auth.manager

ccproxy.auth.manager

Authentication manager interfaces for centralized auth handling.

AuthManager

Bases: Protocol

Protocol for authentication managers.

get_access_token async

get_access_token()

Get valid access token.

Returns:

Type Description
str

Access token string

Raises:

Type Description
AuthenticationError

If authentication fails

Source code in ccproxy/auth/manager.py
async def get_access_token(self) -> str:
    """Get valid access token.

    Returns:
        Access token string

    Raises:
        AuthenticationError: If authentication fails
    """
    ...

get_credentials async

get_credentials()

Get valid credentials.

Returns:

Type Description
ClaudeCredentials

Valid credentials

Raises:

Type Description
AuthenticationError

If authentication fails

Source code in ccproxy/auth/manager.py
async def get_credentials(self) -> ClaudeCredentials:
    """Get valid credentials.

    Returns:
        Valid credentials

    Raises:
        AuthenticationError: If authentication fails
    """
    ...

is_authenticated async

is_authenticated()

Check if current authentication is valid.

Returns:

Type Description
bool

True if authenticated, False otherwise

Source code in ccproxy/auth/manager.py
async def is_authenticated(self) -> bool:
    """Check if current authentication is valid.

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

get_user_profile async

get_user_profile()

Get user profile information.

Returns:

Type Description
UserProfile | None

UserProfile if available, None otherwise

Source code in ccproxy/auth/manager.py
async def get_user_profile(self) -> UserProfile | None:
    """Get user profile information.

    Returns:
        UserProfile if available, None otherwise
    """
    ...

BaseAuthManager

Bases: ABC

Base class for authentication managers.

get_access_token abstractmethod async

get_access_token()

Get valid access token.

Returns:

Type Description
str

Access token string

Raises:

Type Description
AuthenticationError

If authentication fails

Source code in ccproxy/auth/manager.py
@abstractmethod
async def get_access_token(self) -> str:
    """Get valid access token.

    Returns:
        Access token string

    Raises:
        AuthenticationError: If authentication fails
    """
    pass

get_credentials abstractmethod async

get_credentials()

Get valid credentials.

Returns:

Type Description
ClaudeCredentials

Valid credentials

Raises:

Type Description
AuthenticationError

If authentication fails

Source code in ccproxy/auth/manager.py
@abstractmethod
async def get_credentials(self) -> ClaudeCredentials:
    """Get valid credentials.

    Returns:
        Valid credentials

    Raises:
        AuthenticationError: If authentication fails
    """
    pass

is_authenticated abstractmethod async

is_authenticated()

Check if current authentication is valid.

Returns:

Type Description
bool

True if authenticated, False otherwise

Source code in ccproxy/auth/manager.py
@abstractmethod
async def is_authenticated(self) -> bool:
    """Check if current authentication is valid.

    Returns:
        True if authenticated, False otherwise
    """
    pass

get_user_profile async

get_user_profile()

Get user profile information.

Returns:

Type Description
UserProfile | None

UserProfile if available, None otherwise

Source code in ccproxy/auth/manager.py
async def get_user_profile(self) -> UserProfile | None:
    """Get user profile information.

    Returns:
        UserProfile if available, None otherwise
    """
    return None