Skip to content

ccproxy.config.core

ccproxy.config.core

Core configuration settings - server, HTTP, CORS, logging, and plugins.

ServerSettings

Bases: BaseModel

Server-specific configuration settings.

HTTPSettings

Bases: BaseModel

HTTP client configuration settings.

Controls how the core HTTP client handles compression and other HTTP-level settings.

CORSSettings

Bases: BaseModel

CORS-specific configuration settings.

LoggingSettings

Bases: BaseModel

Centralized logging configuration - core app only.

validate_log_level classmethod

validate_log_level(value)

Validate and normalize log level.

Source code in ccproxy/config/core.py
@field_validator("level", mode="before")
@classmethod
def validate_log_level(cls, value: LogLevelName | str) -> LogLevelName:
    """Validate and normalize log level."""
    if isinstance(value, str):
        candidate = value.upper()
    else:
        candidate = value

    if candidate not in LOG_LEVEL_OPTIONS:
        raise ValueError(
            f"Invalid log level: {value}. Must be one of {list(LOG_LEVEL_OPTIONS)}"
        )

    return cast(LogLevelName, candidate)

validate_log_format classmethod

validate_log_format(value)

Validate and normalize log format.

Source code in ccproxy/config/core.py
@field_validator("format", mode="before")
@classmethod
def validate_log_format(cls, value: LogFormatName | str) -> LogFormatName:
    """Validate and normalize log format."""
    if isinstance(value, str):
        candidate = value.lower()
    else:
        candidate = value

    if candidate not in LOG_FORMAT_OPTIONS:
        raise ValueError(
            f"Invalid log format: {value}. Must be one of {list(LOG_FORMAT_OPTIONS)}"
        )

    return cast(LogFormatName, candidate)

PluginDiscoverySettings

Bases: BaseModel

Configuration for filesystem plugin discovery.