feat(admin-panel): show passkey info in account search#20248
feat(admin-panel): show passkey info in account search#20248MagentaManifold merged 1 commit intomainfrom
Conversation
|
You will need to manually insert passkey entries into DB to test it out, and you'll need to use a real authenticator aaguid to test out authenticator detection |
There was a problem hiding this comment.
Pull request overview
Adds passkey visibility to the FxA admin account search response/UI, including resolving a human-readable authenticator name via the FIDO Metadata Service (MDS).
Changes:
- Add
Passkeyandpasskeysto shared admin-server API types and include passkeys in account search responses. - Introduce
FidoMdsServiceto fetch/cache AAGUID → authenticator name mappings from FIDO MDS. - Render passkeys in the admin panel account details page and add corresponding UI tests.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/fxa-admin-server/src/types.ts | Adds Passkey type and passkeys field on Account. |
| packages/fxa-admin-server/src/rest/account/account.controller.ts | Queries passkeys from DB and enriches with authenticator name via MDS. |
| packages/fxa-admin-server/src/backend/fido-mds.service.ts | New service to fetch/cache authenticator names from FIDO MDS. |
| packages/fxa-admin-server/src/backend/fido-mds.service.spec.ts | Unit tests for MDS fetching/caching behavior. |
| packages/fxa-admin-server/src/backend/backend.module.ts | Registers/exports FidoMdsService for DI. |
| packages/fxa-admin-panel/src/components/PageAccountSearch/Account/index.tsx | Displays passkeys table in account search results. |
| packages/fxa-admin-panel/src/components/PageAccountSearch/Account/index.test.tsx | Adds UI coverage for empty/non-empty passkeys display. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| jest.spyOn(Date, 'now').mockRestore(); | ||
| }); | ||
|
|
||
| it('returns undefined and allows retry when fetch fails', async () => { |
There was a problem hiding this comment.
I don't really get the point of this test. It seems like it's just testing that when you remove the mock it works again...
There was a problem hiding this comment.
"Retry" means it uses stale data if fetch fails, and try to fetch again on the next query. It really is just to check that refreshedAt is not updated when fetch fails, but since refreshedAt is a private value, we test the external behavior instead.
| expect(mockFetch).toHaveBeenCalledTimes(2); | ||
| }); | ||
|
|
||
| it('returns undefined and allows retry when server returns non-ok status', async () => { |
There was a problem hiding this comment.
This says it allows retry, but I don't see a retry like in the test case above. As mentioned before, I don't see why testing the 'retry' is necessary...
adf8af4 to
fc4c0cd
Compare
Because: * support agents need to see passkeys on accounts This commit: * show passkey info in admin panel Closes FXA-13076
fc4c0cd to
a43fed1
Compare
|
The failing test is irrelevant to this PR, so I'm gonna merge now |
Because
This pull request
Issue that this pull request solves
Closes: FXA-13076
Checklist
Put an
xin the boxes that applyScreenshots (Optional)
Other information (Optional)
Any other information that is important to this pull request.