aeat.core._config_support module

Support types and defaults for the central settings facade.

This module holds the closed settings enums and derived records consumed by Settings: authentication provider selectors (AuthProviderKindSetting, CertificateBackend), secret storage selection (SecretStoreBackend), LLM provider selection (LLMProviderSetting), and database routing via StorageRouteKind and StorageRouteClassification.

The route records are produced by classify_storage_route(); output language strings are coerced to OutputLanguage; and AEAT URL defaults are read from load_external_constants().

class SecretStoreBackend(*values)[source]

Bases: StrEnum

Supported backends for the master-key secret store.

Settings exposes this closed set through aeat_secret_store_backend so storage custody and operator setup share one spelling for automatic, keyring, file-backed, and explicitly unsecured secret storage.

AUTO
KEYRING
FILE
UNSECURED
unwrap_optional_secret(value)[source]

Return the cleartext of an optional pydantic.SecretStr.

Optional Cl@ve and certificate settings use this helper at adapter boundaries so unset secrets materialise as "" rather than leaking pydantic.SecretStr wrappers into string handling.

Return type:

str

Parameters:

value (SecretStr | None)

class LLMProviderSetting(*values)[source]

Bases: StrEnum

Closed set of LLM provider names accepted by Settings.

ANTHROPIC
OPENAI
GEMINI
LOCAL
class CertificateBackend(*values)[source]

Bases: StrEnum

Closed catalogue of supported AEAT certificate-handshake backends.

PLAYWRIGHT_CONTEXT
HTTPX_FALLBACK
class AuthProviderKindSetting(*values)[source]

Bases: StrEnum

Settings-shape selector for the active AEAT authentication provider.

CERTIFICATE
CLAVE_MOVIL
CLAVE_PERMANENTE
class StorageRouteKind(*values)[source]

Bases: StrEnum

Resolved primary database route classification.

Members distinguish operator-supplied database URLs from computed active bucket routes and cold root-fallback routes. The storage write policy consumes this value through inspect_storage_write_policy().

EXPLICIT_DATABASE_URL
ACTIVE_BUCKET_DATABASE
ROOT_FALLBACK_DATABASE
class StorageRouteClassification(**data)[source]

Bases: BaseModel

Strict classification of the effective primary database route.

Instances are returned by classify_storage_route() and carry the effective StorageRouteKind, original database URL, SQLite path when derivable, and active bucket id for bucket-attached routes.

Parameters:
kind: StorageRouteKind
database_url: str
database_path: Path | None
bucket_id: str
default_clave_sede_access_url_template()[source]

Return the configured Cl@ve Movil selector access URL template.

Return type:

str

default_clave_permanente_sede_access_url_template()[source]

Return the configured Cl@ve Permanente selector access URL template.

Return type:

str

default_sede_expedientes_path()[source]

Return the configured AEAT Sede expedientes summary path.

Return type:

str

default_status_detail_url_template()[source]

Return the configured AEAT expediente status detail URL template.

Return type:

str

default_status_notificaciones_path()[source]

Return the configured AEAT notifications status path.

Return type:

str

default_aeat_sede_origin()[source]

Return the configured AEAT Sede origin.

Return type:

str

default_aeat_sede_origin_with_slash()[source]

Return the configured AEAT Sede origin with a trailing slash.

Return type:

str

class JustificanteParserBackendSetting(*values)[source]

Bases: StrEnum

Settings-shape selector for the justificante PDF parsing backend.

PDFPLUMBER
coerce_output_language_setting(value)[source]

Coerce an env-var output-language string to an OutputLanguage.

Returns None for invalid input so Settings validation can decide how to fall back or report the bad value.

Return type:

OutputLanguage | None

Parameters:

value (str)