aeat.adapters.outbound.aeat.auth._clave_movil_metadata module

Cl@ve Móvil persisted-session metadata records.

adapters.outbound.aeat.auth.ClaveMovilAuthProvider stores ClaveMovilSessionMetadata inside the encrypted adapters.outbound.aeat.auth._session_store.PersistedBrowserSession metadata mapping. The record binds the Playwright storage state to the operator identity, post-auth landing URL, verification code, and resume deadline observed during the human-in-the-loop login flow.

Application callers later narrow this provider-owned shape to the common application.auth.PersistedAuthSession reuse contract.

AEAT_CLAVE_MOVIL_METADATA_SCHEMA_VERSION: Final[int]

Schema version for Cl@ve Móvil ClaveMovilSessionMetadata records.

class ClaveMovilSessionMetadata(**data)[source]

Bases: BaseModel

Provider-owned metadata stored with encrypted Cl@ve Móvil storage state.

provider_kind keeps the encrypted object distinguishable from certificate-auth metadata. storage_state_sha256 lets resume paths reject stale or mismatched browser state, while landing_url lets live probes verify an already-authenticated page without re-entering AEAT’s Cl@ve selector. The same operational fields are projected into adapters.outbound.aeat.auth.ClaveMovilSessionDetail when a session is rebuilt.

Parameters:
schema_version: int
provider_kind: AuthProviderKind
identity_nif: str
authenticated_at: datetime
idle_deadline: datetime
storage_state_sha256: str
used_non_qr_fallback: bool
verification_code: str | None
landing_url: str | None