Ligare.web.config

Ligare.web’s integration with Ligare.programming.config.

Classes

Config(**data)

FlaskConfig(**data)

FlaskOpenApiConfig(**data)

FlaskSessionConfig(**data)

FlaskSessionCookieConfig(**data)

LoggingConfig(**data)

WebConfig(**data)

WebSecurityConfig(**data)

WebSecurityCorsConfig(**data)

class Ligare.web.config.Config(**data)[source]
flask: FlaskConfig | None
logging: LoggingConfig
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

post_load()[source]

This method is called by load_config after TOML data has been loaded into the pluggable config type instance.

Return type:

None

prepare_env_for_flask()[source]
update_flask_config(flask_app_config)[source]
web: WebConfig
class Ligare.web.config.FlaskConfig(**data)[source]
app_name: str
env: str
host: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

openapi: FlaskOpenApiConfig | None
port: str
session: FlaskSessionConfig | None
class Ligare.web.config.FlaskOpenApiConfig(**data)[source]
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

spec_path: str | None
swagger_url: str | None
use_swagger: bool
validate_responses: bool
class Ligare.web.config.FlaskSessionConfig(**data)[source]
cookie: FlaskSessionCookieConfig
lifetime: int | None
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

permanent: bool
refresh_each_request: bool
class Ligare.web.config.FlaskSessionCookieConfig(**data)[source]
httponly: bool
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name: str
samesite: str
secret_key: str | None
secure: bool
class Ligare.web.config.LoggingConfig(**data)[source]
format: Literal['plaintext', 'JSON']
log_level: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class Ligare.web.config.WebConfig(**data)[source]
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

security: WebSecurityConfig
class Ligare.web.config.WebSecurityConfig(**data)[source]
cors: WebSecurityCorsConfig
csp: str | None
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class Ligare.web.config.WebSecurityCorsConfig(**data)[source]
allow_credentials: bool
allow_headers: list[Union[str, Literal['*']]]
allow_methods: Sequence[Literal['GET', 'POST', 'PATCH', 'PUT', 'DELETE', 'OPTIONS', 'HEAD', 'CONNECT', 'TRACE']]
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

origins: list[str] | None