-
Notifications
You must be signed in to change notification settings - Fork 747
feat(mfa): add schema for recovery codes factor #2725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| /* auth_migration: 20260824000000 */ | ||
| do $$ begin | ||
| alter type {{ index .Options "Namespace" }}.factor_type add value 'recovery_code'; | ||
| exception | ||
| when duplicate_object then null; | ||
| end $$; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| /* auth_migration: 20260824000001 */ | ||
| create table if not exists {{ index .Options "Namespace" }}.mfa_recovery_code_sets ( | ||
| id uuid primary key, | ||
| user_id uuid not null unique references {{ index .Options "Namespace" }}.users (id) on delete cascade, | ||
| mfa_factor_id uuid not null unique references {{ index .Options "Namespace" }}.mfa_factors (id) on delete cascade, | ||
| failed_verification_count integer not null default 0 check (failed_verification_count >= 0), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what do you think about
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't have a strong opinion as both make sense. The verification terminology comes from the It boils down to building the feature around the specific MFA terminology versus having something more generic: #2725 (comment) |
||
| verification_locked_until timestamptz, | ||
|
fadymak marked this conversation as resolved.
fadymak marked this conversation as resolved.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: wondering if
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's for consistency between |
||
| created_at timestamptz not null default now(), | ||
| updated_at timestamptz not null default now() | ||
|
fadymak marked this conversation as resolved.
fadymak marked this conversation as resolved.
|
||
| ); | ||
|
|
||
| /* auth_migration: 20260824000001 */ | ||
| create table if not exists {{ index .Options "Namespace" }}.mfa_recovery_codes ( | ||
| id uuid primary key, | ||
| mfa_recovery_code_set_id uuid not null references {{ index .Options "Namespace" }}.mfa_recovery_code_sets (id) on delete cascade, | ||
| code_hash text not null, | ||
|
fadymak marked this conversation as resolved.
annabkr marked this conversation as resolved.
|
||
| consumed_at timestamptz, | ||
|
fadymak marked this conversation as resolved.
|
||
| created_at timestamptz not null default now() | ||
| ); | ||
|
|
||
| /* auth_migration: 20260824000001 */ | ||
| create index if not exists mfa_recovery_codes_set_id_idx | ||
| on {{ index .Options "Namespace" }}.mfa_recovery_codes (mfa_recovery_code_set_id); | ||
Uh oh!
There was an error while loading. Please reload this page.