nid-webauthn-emulator 0.2.9 → 0.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +3 -7
- package/README.md +3 -7
- package/dist/src/webauthn/cose-key.d.ts +1 -1
- package/package.json +12 -9
package/README.ja.md
CHANGED
|
@@ -208,7 +208,7 @@ Vitest/Jest などで WebAuthn API を差し替えたい場合は、`src/test-ut
|
|
|
208
208
|
```TypeScript
|
|
209
209
|
import { createPasskeysEmulator } from "nid-webauthn-emulator";
|
|
210
210
|
|
|
211
|
-
const {
|
|
211
|
+
const { methods, addPasskey } = createPasskeysEmulator({
|
|
212
212
|
origin: "http://localhost",
|
|
213
213
|
rpId: "localhost",
|
|
214
214
|
autofill: true, // false にすると isConditionalMediationAvailable が false を返す
|
|
@@ -220,12 +220,8 @@ params?.existingPasskeys?.forEach((passkey) => {
|
|
|
220
220
|
});
|
|
221
221
|
|
|
222
222
|
// 既存の実装を消し、エミュレータを差し込む
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
Object.defineProperty(window.navigator, "credentials", undefinedProperty);
|
|
226
|
-
|
|
227
|
-
vi.spyOn(window, "PublicKeyCredential", "get").mockReturnValue(methods.publicKeyCredentials);
|
|
228
|
-
vi.spyOn(window.navigator, "credentials", "get").mockReturnValue(methods.credentialsContainer);
|
|
223
|
+
vi.stubGlobal("PublicKeyCredential", methods.publicKeyCredentials);
|
|
224
|
+
vi.stubGlobal("navigator", { credentials: methods.credentialsContainer });
|
|
229
225
|
```
|
|
230
226
|
|
|
231
227
|
## ライセンス
|
package/README.md
CHANGED
|
@@ -217,7 +217,7 @@ If you want to swap out WebAuthn APIs in Vitest/Jest, you can mock `PublicKeyCre
|
|
|
217
217
|
```TypeScript
|
|
218
218
|
import { createPasskeysEmulator } from "nid-webauthn-emulator";
|
|
219
219
|
|
|
220
|
-
const {
|
|
220
|
+
const { methods, addPasskey } = createPasskeysEmulator({
|
|
221
221
|
origin: "http://localhost",
|
|
222
222
|
rpId: "localhost",
|
|
223
223
|
autofill: true, // returns false from isConditionalMediationAvailable when set to false
|
|
@@ -229,12 +229,8 @@ params?.existingPasskeys?.forEach((passkey) => {
|
|
|
229
229
|
});
|
|
230
230
|
|
|
231
231
|
// remove existing implementations and inject the emulator
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
Object.defineProperty(window.navigator, "credentials", undefinedProperty);
|
|
235
|
-
|
|
236
|
-
vi.spyOn(window, "PublicKeyCredential", "get").mockReturnValue(methods.publicKeyCredentials);
|
|
237
|
-
vi.spyOn(window.navigator, "credentials", "get").mockReturnValue(methods.credentialsContainer);
|
|
232
|
+
vi.stubGlobal("PublicKeyCredential", methods.publicKeyCredentials);
|
|
233
|
+
vi.stubGlobal("navigator", { credentials: methods.credentialsContainer });
|
|
238
234
|
```
|
|
239
235
|
|
|
240
236
|
## License
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nid-webauthn-emulator",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.11",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"test",
|
|
6
6
|
"e2e",
|
|
@@ -12,22 +12,25 @@
|
|
|
12
12
|
],
|
|
13
13
|
"author": "Nikkei Inc.",
|
|
14
14
|
"license": "MIT",
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"provenance": true
|
|
17
|
+
},
|
|
15
18
|
"main": "dist/src/index.js",
|
|
16
19
|
"types": "dist/src/index.d.ts",
|
|
17
20
|
"devDependencies": {
|
|
18
|
-
"@biomejs/biome": "^2.
|
|
19
|
-
"@jest/globals": "^30.
|
|
20
|
-
"@simplewebauthn/server": "^13.
|
|
21
|
+
"@biomejs/biome": "^2.4.9",
|
|
22
|
+
"@jest/globals": "^30.3.0",
|
|
23
|
+
"@simplewebauthn/server": "^13.3.0",
|
|
21
24
|
"@tsconfig/recommended": "^1.0.13",
|
|
22
|
-
"@types/node": "^
|
|
23
|
-
"jest": "^30.
|
|
24
|
-
"ts-jest": "^29.4.
|
|
25
|
+
"@types/node": "^25.5.0",
|
|
26
|
+
"jest": "^30.3.0",
|
|
27
|
+
"ts-jest": "^29.4.6",
|
|
25
28
|
"ts-node": "^10.9.2",
|
|
26
29
|
"typescript": "^5.9.3"
|
|
27
30
|
},
|
|
28
31
|
"dependencies": {
|
|
29
|
-
"cbor": "^10.0.
|
|
30
|
-
"tldts": "^7.0.
|
|
32
|
+
"cbor": "^10.0.12",
|
|
33
|
+
"tldts": "^7.0.27"
|
|
31
34
|
},
|
|
32
35
|
"scripts": {
|
|
33
36
|
"check": "biome check .",
|