Registration#
Модели#
AccountDraft(credentials=..., profile=..., details=...)
AccountCreated(remote_id=..., verification=..., session=..., meta=...)
Flow#
flow = account_registration(
CredentialsModel,
service=service,
store=store,
context_factory=context_factory,
provider=None,
verification=None,
session_lifecycle=None,
max_verification_steps=3,
deadline=None,
clock=...,
cancelled=...,
)
result = await flow.create(draft)
create(...) возвращает CompleteRegistration или PendingRegistration.
Синхронный вариант создаётся через sync_account_registration(...).
AccountDraft разделяет credentials, profile и operation-specific details.
Credentials model должна содержать ровно один field с AccountIdentifier(). Store сохраняет
normalized identifier, remote ID, verification state и optional session.
AccountCreated может вернуть сразу session, один VerificationChallenge или завершённый
account без session. max_verification_steps, deadline и cancelled ограничивают lifecycle и не
зависят от HTTP transport.
Registration service вызывает scoped SDK через переданный context_factory. Ошибка remote API не
фиксирует частично завершённый state; reservation и transitions сохраняются на documented
state/event boundaries.