Giao diện
identity / sign
Trang sinh tự động
Sinh từ ad83b0aea — chạy 820 migration lên PostgreSQL 17 rồi đọc pg_catalog. Mô tả bảng và cột lấy từ COMMENT ON. Không sửa tay: lần chạy docgen sau sẽ ghi đè.
2 bảng. Quay lại identity.
sign_in_challenges
PPI-P2-01 (03 s3.3). SECRET_BEARING multi-step WEB_ADMIN sign-in: token <id>.<secret>, only sha256(secret) stored, 10 minutes, steps PASSWORD_CHANGE? then MFA_ENROLL | MFA_VERIFY in order; no session exists until finish. Reached only through identity_flow.sign_in_challenge_*; purged by identity_flow.purge_expired_credentials.
public.sign_in_challenges · 10 cột · 7 check · 0 unique · 3 index · 0 policy · 2 trigger · RLS bật
| Cột | Kiểu | Khoá | Mô tả | |
|---|---|---|---|---|
id | uuid | NOT NULL | PK | |
secret_hash | bytea | NOT NULL | ||
account_id | uuid | NOT NULL | FK → accounts | |
app | app_code | NOT NULL | ||
steps_required | text[] | NOT NULL | ||
steps_done | text[] | NOT NULL | ||
attempt_count | integer | NOT NULL | ||
expires_at | timestamptz | NOT NULL | ||
consumed_at | timestamptz | |||
created_at | timestamptz | NOT NULL |
Khoá chính: id
Trỏ ra (1):
account_id→accounts·ON DELETE RESTRICT
Được trỏ tới: không có
sign_in_throttles
P1-03 + PPI-P1-02 (B-07). SYSTEM_ONLY temporary sign-in lockout per (kind, phone): kind = the app's account kind (identity_flow.account_kind_for_app), so a STAFF lockout never locks the CUSTOMER sign-in of the same phone. Counts attempts, never stores a password, code or token. Not the staff lock: accounts/app_memberships.status LOCKED is separate.
public.sign_in_throttles · 6 cột · 2 check · 0 unique · 2 index · 0 policy · 0 trigger · RLS bật
| Cột | Kiểu | Khoá | Mô tả | |
|---|---|---|---|---|
phone_e164 | phone_e164 | NOT NULL | PK | |
attempt_count | integer | NOT NULL | ||
window_started_at | timestamptz | NOT NULL | ||
locked_until | timestamptz | |||
last_attempt_at | timestamptz | NOT NULL | ||
kind | text | NOT NULL | PK |
Khoá chính: kind, phone_e164
Trỏ ra: không có
Được trỏ tới: không có