Skip to content

identity / mfa ​

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 đè.

3 bảng. Quay lại identity.

mfa_factors ​

P1-07. SECRET_BEARING Admin MFA factor (TOTP), one live (non-REMOVED) row per account. The secret is AES-256-GCM sealed outside the DB; attempt/lock columns are the MFA lockout (AD-AUTH-05-locked).

public.mfa_factors · 17 cột · 10 check · 0 unique · 2 index · 0 policy · 0 trigger · RLS bật

CộtKiểuKhoáMô tả
iduuidNOT NULLPK
account_iduuidNOT NULLFK → accounts
factor_typetextNOT NULL
statustextNOT NULL
totp_ciphertextbyteaNOT NULL
totp_noncebyteaNOT NULL
totp_key_idtextNOT NULL
enroll_expires_attimestamptzNOT NULL
verified_attimestamptz
last_used_stepbigint
attempt_countintegerNOT NULL
attempt_window_started_attimestamptz
locked_untiltimestamptz
removed_attimestamptz
removed_reasontext
created_attimestamptzNOT NULL
versionintegerNOT NULL

Khoá chính: id

Trỏ ra (1):

  • account_id → accounts · ON DELETE RESTRICT

Được trỏ tới (2): mfa_reset_requests, mfa_step_up_grants

mfa_reset_requests ​

P1-07. PERM_GATED maker/checker MFA reset (AD-03 mfa_reset.request, AD-04 mfa_reset.approve); one open request per target; executes on approval; COMPLETED when the target re-enrolls.

public.mfa_reset_requests · 14 cột · 8 check · 0 unique · 2 index · 0 policy · 2 trigger · RLS bật

CộtKiểuKhoáMô tả
iduuidNOT NULLPK
target_account_iduuidNOT NULLFK → accounts
requested_byuuidNOT NULLFK → accounts
reasontextNOT NULL
statustextNOT NULL
requested_attimestamptzNOT NULL
expires_attimestamptzNOT NULL
approved_byuuidFK → accounts
approved_attimestamptz
removed_factor_iduuidFK → mfa_factors
revoked_sessionsinteger
completed_attimestamptz
correlation_idcorrelation_refNOT NULL
versionintegerNOT NULL

Khoá chính: id

Trỏ ra (4):

  • approved_by → accounts · ON DELETE RESTRICT
  • removed_factor_id → mfa_factors · ON DELETE RESTRICT
  • requested_by → accounts · ON DELETE RESTRICT
  • target_account_id → accounts · ON DELETE RESTRICT

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

mfa_step_up_grants ​

P1-07. SYSTEM_ONLY step-up grant: one MFA verification -> one privileged command, bound to account, app, Supabase session, action (matrix res.act) and expiry; consumed once inside the command transaction.

public.mfa_step_up_grants · 12 cột · 4 check · 0 unique · 2 index · 0 policy · 2 trigger · RLS bật

CộtKiểuKhoáMô tả
iduuidNOT NULLPK
account_iduuidNOT NULLFK → accounts
appapp_codeNOT NULL
factor_iduuidNOT NULLFK → mfa_factors
session_iduuidNOT NULL
actiontextNOT NULL
expires_attimestamptzNOT NULL
consumed_attimestamptz
revoked_attimestamptz
revoked_reasontext
created_attimestamptzNOT NULL
correlation_idcorrelation_refNOT NULL

Khoá chính: id

Trỏ ra (2):

  • account_id → accounts · ON DELETE RESTRICT
  • factor_id → mfa_factors · ON DELETE RESTRICT

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

Sinh từ ad83b0aea · 820 migration · PostgreSQL 17