-
Notifications
You must be signed in to change notification settings - Fork 229
bug(securityEvent): Add missing security event names to db #19483
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,14 @@ | ||
| SET NAMES utf8mb4 COLLATE utf8mb4_bin; | ||
|
|
||
| -- Bump these to your next migration numbers | ||
| CALL assertPatchLevel('175'); | ||
|
|
||
| INSERT INTO securityEventNames (name) VALUES | ||
| ('account.password_upgrade_success'), | ||
| ('account.password_upgraded'), | ||
| ('account.recovery_phone_setup_failed'), | ||
| ('account.mfa_send_otp_code'), | ||
| ('account.mfa_verify_otp_code_success'), | ||
| ('account.mfa_verify_otp_code_failed'); | ||
|
|
||
| UPDATE dbMetadata SET value = '176' WHERE name = 'schema-patch-level'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| -- SET NAMES utf8mb4 COLLATE utf8mb4_bin; | ||
| -- | ||
| -- -- Remove only the rows this migration inserted. | ||
| -- DELETE FROM securityEventNames WHERE name = 'account.password_upgrade_success'; | ||
| -- DELETE FROM securityEventNames WHERE name = 'account.password_upgraded'; | ||
| -- DELETE FROM securityEventNames WHERE name = 'account.recovery_phone_setup_failed'; | ||
| -- DELETE FROM securityEventNames WHERE name = 'account.mfa_send_otp_code'; | ||
| -- DELETE FROM securityEventNames WHERE name = 'account.mfa_verify_otp_code_success'; | ||
| -- DELETE FROM securityEventNames WHERE name = 'account.mfa_verify_otp_code_failed'; | ||
| -- | ||
| -- UPDATE dbMetadata SET value = '175' WHERE name = 'schema-patch-level'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| { | ||
| "level": 175 | ||
| "level": 176 | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,17 +47,18 @@ export const EVENT_NAMES: Record<string, number> = { | |
| 'account.recovery_codes_created': 33, | ||
| 'account.recovery_codes_signin_complete': 34, | ||
| 'account.must_reset': 35, | ||
| 'account.recovery_phone_reset_password_success': 36, | ||
| 'account.recovery_phone_reset_password_complete': 36, | ||
| 'account.recovery_phone_reset_password_failed': 37, | ||
| 'account.password_upgrade_success': 38, | ||
| 'account.password_upgraded': 39, | ||
| 'account.recovery_phone_setup_failed': 40, | ||
| 'account.recovery_phone_replace_failed': 41, | ||
|
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. here,
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 was just digging into how events are written and, since they're written with whatever name is passed to Maybe it makes more sense to update the event name in the db instead of code/model? |
||
| 'account.recovery_phone_replace_complete': 42, | ||
| 'account.recovery_phone_reset_password_complete': 43, | ||
| 'account.mfa_send_otp_code': 44, | ||
| 'account.mfa_verify_otp_code_success': 45, | ||
| 'account.mfa_verify_otp_code_failed': 46, | ||
| 'account.recovery_phone_replace_complete': 38, | ||
| 'account.recovery_phone_replace_failure': 39, | ||
| 'account.two_factor_replace_success': 40, | ||
| 'account.two_factor_replace_failure': 41, | ||
| 'account.password_upgrade_success': 42, | ||
| 'account.password_upgraded': 43, | ||
| 'account.recovery_phone_setup_failed': 44, | ||
| 'account.mfa_send_otp_code': 45, | ||
| 'account.mfa_verify_otp_code_success': 46, | ||
| 'account.mfa_verify_otp_code_failed': 47, | ||
| } as const; | ||
|
|
||
| export type SecurityEventNames = keyof typeof EVENT_NAMES; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was not found in code, but the new
recovery_phone_reset_password_completeis.