feat(passkey): create passkey management API endpoints#20286
feat(passkey): create passkey management API endpoints#20286MagentaManifold merged 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds passkey management capabilities to the FxA stack by introducing API endpoints to list, delete, and rename passkeys, and by surfacing passkeys in the account response.
Changes:
- Add
GET /passkeys,DELETE /passkey/{credentialId}, andPATCH /passkey/{credentialId}routes with Swagger docs and unit tests. - Update MFA action naming from
passkeys→passkeyin settings types and auth-server config defaults. - Update passkey library
renamePasskeyto return the updatedPasskeyrecord (and adjust tests accordingly).
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/fxa-settings/src/lib/types.ts | Updates MFA scope type to use passkey (singular). |
| packages/fxa-auth-server/lib/routes/passkeys.ts | Implements new passkey management endpoints. |
| packages/fxa-auth-server/lib/routes/passkeys.spec.ts | Adds/updates unit tests for new passkey routes. |
| packages/fxa-auth-server/lib/routes/account.ts | Includes passkeys in GET /account response payload + schema. |
| packages/fxa-auth-server/lib/metrics/glean/index.ts | Adds commented-out placeholders for passkey delete/rename glean events. |
| packages/fxa-auth-server/docs/swagger/passkeys-api.ts | Adds Swagger docs for list/delete/rename endpoints. |
| packages/fxa-auth-server/config/index.ts | Updates default MFA actions list to passkey. |
| packages/fxa-auth-server/bin/key_server.js | Adjusts passkey config construction call site. |
| libs/accounts/passkey/src/lib/passkey.service.ts | Changes renamePasskey to return a Passkey. |
| libs/accounts/passkey/src/lib/passkey.service.spec.ts | Updates tests for renamePasskey return value and fetch behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
169478a to
b1447be
Compare
vpomerleau
left a comment
There was a problem hiding this comment.
This looks good to me. I'd be in favour of fixing the encoding issue in this PR (seems like a small fix that doesn't justify a separate ticket and overhead)
| this.db.securityEventsByUid({ uid }), | ||
| this.db.devices(uid), | ||
| listAuthorizedClients(uid), | ||
| this.config.passkeys?.enabled |
There was a problem hiding this comment.
I'm having a doubt here if the stored passkeys should always be returned whether or not the service is enabled, similar to recovery phone 🤔 but this matches the current design
Because: * we need passkey management API endpoints This commit: * creates passkey management API endpoints Closes FXA-13070
b1447be to
5f0dbd4
Compare
Because
This pull request
Issue that this pull request solves
Closes: FXA-13070
Checklist
Put an
xin the boxes that applyHow to review (Optional)
Screenshots (Optional)
Please attach the screenshots of the changes made in case of change in user interface.
Other information (Optional)
Any other information that is important to this pull request.