Skip to content

Commit 028c898

Browse files
hex2fPierre
authored andcommitted
🔐 Mock webauthn (#pgk/mock-webauthn)
Summary: Implemented a mock WebAuthn library in TypeScript for client-side WebAuthn interactions, including attestation and assertion functionalities. Highlights: • Added `package.json` with dependencies and scripts for building, linting, and testing. • Created `EC2SigningKey` class for ECDSA key generation and signing. • Added end-to-end tests for attestation and assertion using `vitest`. Read more: https://pierre.co/0x57/sdk/pgk/mock-webauthn
1 parent 922a9c1 commit 028c898

17 files changed

+997
-4
lines changed

package-lock.json

Lines changed: 221 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/mock-webauthn/.eslintrc.cjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/** @type {import("eslint").Linter.Config} */
2+
module.exports = {
3+
root: true,
4+
extends: ["@0x57/eslint-config/library.js"],
5+
parser: "@typescript-eslint/parser",
6+
parserOptions: {
7+
project: "./tsconfig.json",
8+
},
9+
ignorePatterns: [".eslintrc.cjs"],
10+
};

packages/mock-webauthn/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# @0x57/mock-webauthn
2+
3+
A loose reimplementation of [descope/virtualwebauthn](https://github.com/descope/virtualwebauthn) in TypeScript. This package is used to mock client-side WebAuthn interactions for CI testing.
4+
5+
TODO: Write docs!

packages/mock-webauthn/package.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "@0x57/mock-webauthn",
3+
"version": "0.0.0",
4+
"type": "module",
5+
"exports": {
6+
".": "./dist/index.js"
7+
},
8+
"files": [
9+
"dist"
10+
],
11+
"scripts": {
12+
"build": "tsc",
13+
"clean": "rimraf dist .turbo",
14+
"prettier": "prettier src/**/*.ts --check",
15+
"typecheck": "tsc --noEmit",
16+
"lint": "eslint . --max-warnings 0",
17+
"prepublish": "npm run clean && npm run build"
18+
},
19+
"author": "Leah Lundqvist <[email protected]>",
20+
"dependencies": {
21+
"cbor-web": "^9.0.2"
22+
},
23+
"devDependencies": {
24+
"@simplewebauthn/server": "^10.0.0"
25+
}
26+
}

0 commit comments

Comments
 (0)