Skip to content

Commit a3cd9b6

Browse files
dschomclaude
andcommitted
feat(security-events): Add passkey security event names
Add 5 passkey security event names to EVENT_NAMES registry and create DB migration to insert them into securityEventNames table. Events: - account.passkey.registration_success - account.passkey.registration_failure - account.passkey.removed - account.passkey.authentication_success - account.passkey.authentication_failure Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
1 parent d5d8a1f commit a3cd9b6

4 files changed

Lines changed: 24 additions & 1 deletion

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CALL assertPatchLevel('182');
2+
3+
INSERT INTO securityEventNames(name) VALUES ('account.passkey.registration_success');
4+
INSERT INTO securityEventNames(name) VALUES ('account.passkey.registration_failure');
5+
INSERT INTO securityEventNames(name) VALUES ('account.passkey.removed');
6+
INSERT INTO securityEventNames(name) VALUES ('account.passkey.authentication_success');
7+
INSERT INTO securityEventNames(name) VALUES ('account.passkey.authentication_failure');
8+
9+
UPDATE dbMetadata SET value = '183' WHERE name = 'schema-patch-level';
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
-- SET NAMES utf8mb4 COLLATE utf8mb4_bin;
2+
--
3+
-- DELETE FROM securityEventNames WHERE name = 'account.passkey.registration_success';
4+
-- DELETE FROM securityEventNames WHERE name = 'account.passkey.registration_failure';
5+
-- DELETE FROM securityEventNames WHERE name = 'account.passkey.removed';
6+
-- DELETE FROM securityEventNames WHERE name = 'account.passkey.authentication_success';
7+
-- DELETE FROM securityEventNames WHERE name = 'account.passkey.authentication_failure';
8+
--
9+
-- UPDATE dbMetadata SET value = '182' WHERE name = 'schema-patch-level';
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"level": 182
2+
"level": 183
33
}

packages/fxa-shared/db/models/auth/security-event.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ export const EVENT_NAMES: Record<string, number> = {
6767
'account.signin_confirm_bypass_known_ip': 48,
6868
'account.signin_confirm_bypass_new_account': 49,
6969
'account.signin_confirm_bypass_known_device': 50,
70+
'account.passkey.registration_success': 51,
71+
'account.passkey.registration_failure': 52,
72+
'account.passkey.removed': 53,
73+
'account.passkey.authentication_success': 54,
74+
'account.passkey.authentication_failure': 55,
7075
} as const;
7176

7277
export type SecurityEventNames = keyof typeof EVENT_NAMES;

0 commit comments

Comments
 (0)