Skip to content

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ộtKiểuKhoáMô tả
iduuidNOT NULLPK
secret_hashbyteaNOT NULL
account_iduuidNOT NULLFK → accounts
appapp_codeNOT NULL
steps_requiredtext[]NOT NULL
steps_donetext[]NOT NULL
attempt_countintegerNOT NULL
expires_attimestamptzNOT NULL
consumed_attimestamptz
created_attimestamptzNOT 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ộtKiểuKhoáMô tả
phone_e164phone_e164NOT NULLPK
attempt_countintegerNOT NULL
window_started_attimestamptzNOT NULL
locked_untiltimestamptz
last_attempt_attimestamptzNOT NULL
kindtextNOT NULLPK

Khoá chính: kind, phone_e164

Trỏ ra: không có

Được trỏ tới: không có

Sinh từ ad83b0aea · 820 migration · PostgreSQL 17