Skip to content

feat(admin-panel): show passkey info in account search#20248

Merged
MagentaManifold merged 1 commit intomainfrom
FXA-13076
Mar 25, 2026
Merged

feat(admin-panel): show passkey info in account search#20248
MagentaManifold merged 1 commit intomainfrom
FXA-13076

Conversation

@MagentaManifold
Copy link
Copy Markdown
Contributor

Because

  • support agents need to see passkeys on accounts

This pull request

  • show passkey info in admin panel

Issue that this pull request solves

Closes: FXA-13076

Checklist

Put an x in the boxes that apply

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.
  • I have added necessary documentation (if appropriate).
  • I have verified that my changes render correctly in RTL (if appropriate).
  • I have manually reviewed all AI generated code.

Screenshots (Optional)

image

Other information (Optional)

Any other information that is important to this pull request.

@MagentaManifold MagentaManifold requested a review from a team as a code owner March 24, 2026 19:16
Copilot AI review requested due to automatic review settings March 24, 2026 19:16
@MagentaManifold
Copy link
Copy Markdown
Contributor Author

MagentaManifold commented Mar 24, 2026

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

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Passkey and passkeys to shared admin-server API types and include passkeys in account search responses.
  • Introduce FidoMdsService to 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.

Comment thread packages/fxa-admin-server/src/backend/fido-mds.service.ts
Comment thread packages/fxa-admin-server/src/backend/fido-mds.service.spec.ts Outdated
Comment thread packages/fxa-admin-server/src/backend/fido-mds.service.spec.ts
Comment thread packages/fxa-admin-panel/src/components/PageAccountSearch/Account/index.tsx Outdated
Comment thread packages/fxa-admin-panel/src/components/PageAccountSearch/Account/index.tsx Outdated
Comment thread packages/fxa-admin-server/src/rest/account/account.controller.ts Outdated
Comment thread packages/fxa-admin-panel/src/components/PageAccountSearch/Account/index.test.tsx Outdated
Comment thread packages/fxa-admin-server/src/backend/fido-mds.service.ts Outdated
Comment thread packages/fxa-admin-server/src/backend/fido-mds.service.spec.ts Outdated
jest.spyOn(Date, 'now').mockRestore();
});

it('returns undefined and allows retry when fetch fails', async () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"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.

Comment thread packages/fxa-admin-server/src/backend/fido-mds.service.spec.ts Outdated
expect(mockFetch).toHaveBeenCalledTimes(2);
});

it('returns undefined and allows retry when server returns non-ok status', async () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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...

Comment thread packages/fxa-admin-server/src/backend/fido-mds.service.ts Outdated
Comment thread packages/fxa-admin-server/src/backend/fido-mds.service.ts Outdated
Comment thread packages/fxa-admin-server/src/backend/fido-mds.service.ts Outdated
Comment thread packages/fxa-admin-server/src/backend/fido-mds.service.ts Outdated
Comment thread packages/fxa-admin-server/src/backend/fido-mds.service.ts Outdated
Comment thread packages/fxa-admin-server/src/backend/fido-mds.service.ts Outdated
Comment thread packages/fxa-admin-server/src/backend/fido-mds.service.ts
Comment thread packages/fxa-admin-server/src/rest/account/account.controller.ts
Copy link
Copy Markdown
Contributor

@dschom dschom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! R+WC

Because:

* support agents need to see passkeys on accounts

This commit:

* show passkey info in admin panel

Closes FXA-13076
@MagentaManifold
Copy link
Copy Markdown
Contributor Author

The failing test is irrelevant to this PR, so I'm gonna merge now

@MagentaManifold MagentaManifold merged commit e8cd48b into main Mar 25, 2026
18 of 20 checks passed
@MagentaManifold MagentaManifold deleted the FXA-13076 branch March 25, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants