cadrumo.adapters.outbound.aeat.auth.errors module¶
Shared exception taxonomy for outbound AEAT authentication.
Every class here inherits from CadrumoError, so the
core error registry binds a stable ErrorCode and
locale message key to the public auth failure surface. Certificate and Cl@ve
Móvil providers raise these errors with translated_message keys when a
provider precondition, verification probe, persisted-session check, or
configuration guard refuses to continue.
See also
adapters.outbound.aeat.auth for the public auth surface,
AeatSession for successful live
sessions, and AeatLoginAssertion
for verification outcomes that can be returned without raising.
- exception AuthConfigurationError(message=None, *, context=None, translated_message=None)[source]¶
Bases:
AuthErrorRaised when required authentication settings are missing or malformed.
This covers provider selection and configuration refusals before browser or certificate work begins. Provider-specific subclasses such as
adapters.outbound.aeat.auth.clave_movil_support.ClaveMovilConfigurationErrorkeep their own public identity while remaining catchable through this shared configuration arm.- Parameters:
- Return type:
None
- code¶
- exception AuthProviderCleanupError(message=None, *, context=None, translated_message=None)[source]¶
Bases:
AuthErrorRaised when an auth provider retains browser resources after close.
- Parameters:
- Return type:
None
- code¶
- exception AuthValidationError(message=None, *, context=None, translated_message=None)[source]¶
Bases:
AuthErrorRaised when authentication parameters or field values fail domain validation.
Auth helpers raise the registered type directly. Any future Pydantic callback that needs this refusal must translate it to a plain
ValueErrorat that callback boundary rather than adding a builtin base here.- Parameters:
- Return type:
None
- code¶
- exception AeatSessionExpiredError(message=None, *, context=None, translated_message=None)[source]¶
Bases:
AuthErrorRaised when an authenticated AEAT session is no longer usable.
Conditions feeding this error include an
AeatSessionidle deadline that has elapsed, a failed single-shot reauthentication attempt, or an HTTP 401/403 surfaced by a downstream live-read call site. The registered error code is retryable so operator flows can prompt for a fresh authentication attempt.- Parameters:
- Return type:
None
- code¶