Skip to content

feat(libs): Create scaffolding for passkeys library#19984

Merged
vpomerleau merged 1 commit intomainfrom
FXA-12900
Feb 10, 2026
Merged

feat(libs): Create scaffolding for passkeys library#19984
vpomerleau merged 1 commit intomainfrom
FXA-12900

Conversation

@vpomerleau
Copy link
Copy Markdown
Contributor

Because

  • We are starting passkeys implementation, this sets the base foundation

This pull request

  • Creates libs/accounts/passkey with layered architecture (Service/Manager/Repository)
  • Adds PasskeyConfig class with WebAuthn-specific configuration properties
  • Adds PasskeyError base class with proper JSDoc for errno pattern
  • Creates placeholder files (repository, types) for database implementation
  • Documents architecture, WebAuthn concepts, and development workflow in README
  • Sets up unit and integration test infrastructure

Issue that this pull request solves

Closes: FXA-12900

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

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.

@vpomerleau vpomerleau requested a review from a team as a code owner February 3, 2026 07:08
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/accounts/passkey/src",
"projectType": "library",
"tags": ["scope:shared:lib"],
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.

👍 glad this tag is in here, it's often overlooked.

Copy link
Copy Markdown
Contributor

@nshirley nshirley left a comment

Choose a reason for hiding this comment

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

Just a few comments, I wouldn't say any of them are blocking but curious your thoughts on my comment in the repository layer!

Comment thread libs/accounts/passkey/src/lib/passkey.config.ts
* @property {Error} [cause] - The underlying error if provided
* @property {object} info - The structured info object with errno and context
*/
constructor(message: string, info: Record<string, any>, cause?: Error) {
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 ran into this when adding tests, but it would be nice to define info as a a union like:

Suggested change
constructor(message: string, info: Record<string, any>, cause?: Error) {
constructor(message: string, info: { errno: number, uid: string, credentialId: string } & Record<string, any>, cause?: Error) {

That way, we can definitely access those noted params in the doc comment, info.errno and not have to use square braces info['errno']

Just makes the other classes that extend this, and tests, a bit neater

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.

info: Record<string, any> is aligned with the format used in the recovery phone lib - considering that the shape of info may vary (with uid, credentialId not always being included for example), I wonder if the looser type may still be preferable? I could update the comment to mark uid, credentialId as examples vs defined arguments.

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.

That makes sense. I'm good leaving it as is and then I can include the change in my PR for further discussion!

Comment thread libs/accounts/passkey/src/lib/passkey.manager.in.spec.ts Outdated
Comment thread libs/accounts/passkey/src/lib/passkey.repository.ts
Comment thread libs/accounts/passkey/src/lib/passkey.service.spec.ts Outdated
Comment thread libs/accounts/passkey/jest.config.ts
Comment thread libs/accounts/passkey/README.md
Comment thread libs/accounts/passkey/README.md
Comment thread tsconfig.base.json
Because:

* We are starting passkeys implementation, this sets the base foundation

This commit:

* Creates libs/accounts/passkey with layered architecture (Service/Manager/Repository)
* Adds PasskeyConfig class with WebAuthn-specific configuration properties
* Adds PasskeyError base class with proper JSDoc for errno pattern
* Creates placeholder files (repository, types) for database implementation
* Documents architecture, WebAuthn concepts, and development workflow in README
* Sets up unit and integration test infrastructure

Closes #FXA-12900
Copy link
Copy Markdown
Contributor

@nshirley nshirley left a comment

Choose a reason for hiding this comment

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

Looks like a really solid foundation for further work! I see some tests failed but I don't see how your changes would have done that - it looks like circle has an outage at the moment.

@vpomerleau vpomerleau merged commit 77926dc into main Feb 10, 2026
19 of 20 checks passed
@vpomerleau vpomerleau deleted the FXA-12900 branch February 10, 2026 01:21
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.

3 participants