95680c9960
Email-canonical get-or-create, peppered-hash one-time codes with 10-min TTL, single-use, 5-attempt cap, and 60s resend cooldown; uniform new-or-known (no enumeration, §6.6). All identity rules in the domain layer once (INV-6); scenario + invariant tests green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
32 lines
764 B
Python
32 lines
764 B
Python
"""accounts domain — identity: account records, one-time-code issue/verify, account lookup.
|
|
|
|
Owns INV-2 (email canonical key) and INV-3 (one-time codes handled like secrets). Knows
|
|
nothing about storefronts (that is the storefronts domain, SLICE-3). Imported via this
|
|
package surface only (§6.2).
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
from .errors import (
|
|
AccountsError,
|
|
CodeExhausted,
|
|
CodeExpired,
|
|
CodeMismatch,
|
|
InvalidEmail,
|
|
ResendCooldown,
|
|
)
|
|
from .models import Account
|
|
from .service import get_account, request_code, verify
|
|
|
|
__all__ = [
|
|
"Account",
|
|
"AccountsError",
|
|
"InvalidEmail",
|
|
"ResendCooldown",
|
|
"CodeMismatch",
|
|
"CodeExpired",
|
|
"CodeExhausted",
|
|
"request_code",
|
|
"verify",
|
|
"get_account",
|
|
]
|