aeat.adapters.outbound.aeat.auth._clave_movil_support module¶
Shared support surface for the ClaveMovilAuthProvider.
The helpers here keep the live Cl@ve Movil page driver small: they build the
RemoteStateGuardPolicy used for allowed browser actions, classify the
configured DNI/NIE identity, redact diagnostic URL fields, and attach the
closed ClaveMovilFailureMode taxonomy to provider errors.
- auth_browser_action_policy(settings)[source]¶
Build the remote-state guard policy for Cl@ve Movil browser actions.
The page-flow mixin uses the returned
RemoteStateGuardPolicybefore continuing through AEAT’s own-name representation gate.- Return type:
- Parameters:
settings (Settings)
- exception ClaveMovilConfigurationError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
AuthConfigurationErrorConfiguration fault for the
ClaveMovilAuthProvider.Raised before or during form driving when required local Cl@ve Movil settings, such as DNI/NIE identity or non-QR contrast fields, are missing or malformed. It subclasses
AuthConfigurationErrorso callers can treat it as a local configuration error rather than a live AEAT timeout.- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception ClaveMovilApprovalTimeoutError(message=None, *, failure_mode=None, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
AuthErrorLive Cl@ve Movil timeout carrying provider failure diagnostics.
ClaveMovilAuthProviderand its page-flow mixin raise thisAuthErrorwhen AEAT browser state never reaches the expected selector, wait state, or post-auth landing page.failure_modeis stored both on the exception and incontextas aClaveMovilFailureModevalue; timeout contexts may also include a diagnostic id and operator phone state reporting options.- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- class ClaveMovilFailureMode(*values)[source]¶
Bases:
StrEnumClosed failure taxonomy for
ClaveMovilApprovalTimeoutError.- INITIAL_NAVIGATION_TIMEOUT¶
- PENDING_PETITION_BLOCKED¶
- PUSH_WAIT_STATE_NOT_REACHED¶
- AUTH_COMPLETION_TIMEOUT¶
- APPROVAL_TIMEOUT¶
- classify_identity(raw)[source]¶
Return the configured Cl@ve identity kind as
DNIorNIE.Values outside the provider-supported DNI/NIE formats raise
ClaveMovilConfigurationError; CIF-style organization identifiers are intentionally rejected by the Cl@ve Movil flow.
- extract_verification_code_from_html(html)[source]¶
Extract the AEAT Cl@ve Movil verification code from rendered HTML.
- url_diagnostic(value)[source]¶
Return redacted URL components for auth diagnostic contexts.
The returned mapping keeps host, path, and query-key names only, so
ClaveMovilApprovalTimeoutErrorcontexts can explain where the browser was without persisting query values.