Skip to content

Commit 0b9ef8f

Browse files
committed
feat(passkeys): Add passkey manager functions
Because: - The passkey routes needs to enforce business rules before touching the database This commit: - Implements PasskeyManager with the full passkey lifecycle: register, post-auth update, list, rename, delete, and bulk delete - Guards maxPasskeysPerUser config with @min(1) to prevent accidentally disabling registration - Adds unit and integration tests for the manager Closes #FXA-13064
1 parent 2fac797 commit 0b9ef8f

7 files changed

Lines changed: 886 additions & 75 deletions

File tree

libs/accounts/passkey/src/lib/passkey.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export class PasskeyConfig {
5252
* Maximum number of passkeys a user can register.
5353
*/
5454
@IsNumber()
55-
public maxPasskeysPerUser?: number;
55+
public maxPasskeysPerUser!: number;
5656

5757
/**
5858
* Challenge expiration timeout in milliseconds.

libs/accounts/passkey/src/lib/passkey.errors.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class PasskeyError extends BaseError {
2424
/** WebAuthn credential ID (when applicable) */
2525
readonly credentialId?: string;
2626
/** Additional structured context */
27-
readonly context: Record<string, any>;
27+
readonly context: Record<string, unknown>;
2828

2929
/**
3030
* Creates a PasskeyError.
@@ -42,7 +42,7 @@ export class PasskeyError extends BaseError {
4242
message: string,
4343
info: { errno?: number; uid?: string; credentialId?: string } & Record<
4444
string,
45-
any
45+
unknown
4646
>,
4747
cause?: Error
4848
) {

0 commit comments

Comments
 (0)