webauthn-p256
Advanced tools
Comparing version 0.0.5 to 0.0.6-main.20240728T072832
@@ -39,3 +39,3 @@ "use strict"; | ||
name: window.document.title, | ||
}, user, } = parameters; | ||
}, user, extensions, } = parameters; | ||
const name = (user?.name ?? name_); | ||
@@ -67,2 +67,3 @@ return { | ||
}, | ||
extensions, | ||
}, | ||
@@ -69,0 +70,0 @@ }; |
@@ -53,3 +53,3 @@ import { keccak_256 } from '@noble/hashes/sha3'; | ||
name: window.document.title, | ||
}, user, } = parameters; | ||
}, user, extensions, } = parameters; | ||
const name = (user?.name ?? name_); | ||
@@ -81,2 +81,3 @@ return { | ||
}, | ||
extensions, | ||
}, | ||
@@ -83,0 +84,0 @@ }; |
@@ -44,2 +44,6 @@ import type { Credential, OneOf, P256Credential, Prettify, PublicKeyCredentialCreationOptions } from './types.js'; | ||
/** | ||
* List of Web Authentication API credentials to use during creation or authentication. | ||
*/ | ||
extensions?: PublicKeyCredentialCreationOptions['extensions'] | undefined; | ||
/** | ||
* An object describing the relying party that requested the credential creation | ||
@@ -46,0 +50,0 @@ */ |
@@ -38,3 +38,7 @@ export type Hex = `0x${string}`; | ||
type UserVerificationRequirement = 'discouraged' | 'preferred' | 'required'; | ||
type LargeBlobSupport = { | ||
support: 'required' | 'preferred'; | ||
}; | ||
type BufferSource = ArrayBufferView | ArrayBuffer; | ||
type PrfExtension = Record<'prf', Record<'eval', Record<'first', Uint8Array>>>; | ||
interface AuthenticationExtensionsClientInputs { | ||
@@ -45,2 +49,4 @@ appid?: string; | ||
minPinLength?: boolean; | ||
prf?: PrfExtension; | ||
largeBlob?: LargeBlobSupport; | ||
} | ||
@@ -47,0 +53,0 @@ interface AuthenticatorSelectionCriteria { |
# webauthn-p256 | ||
## 0.0.6 | ||
### Patch Changes | ||
- [`f8209ba`](https://github.com/wevm/webauthn-p256/commit/f8209ba69405411f21b228f11110ce5bab2b883e) Thanks [@jxom](https://github.com/jxom)! - Added support for `extensions`. | ||
## 0.0.5 | ||
@@ -4,0 +10,0 @@ |
@@ -71,2 +71,3 @@ import { describe, expect, test } from 'vitest' | ||
], | ||
"extensions": undefined, | ||
"pubKeyCredParams": [ | ||
@@ -155,80 +156,81 @@ { | ||
).toMatchInlineSnapshot(` | ||
{ | ||
"publicKey": { | ||
"attestation": "none", | ||
"authenticatorSelection": { | ||
"authenticatorAttachment": "platform", | ||
"requireResidentKey": false, | ||
"residentKey": "preferred", | ||
"userVerification": "required", | ||
}, | ||
"challenge": Uint8Array [ | ||
105, | ||
171, | ||
180, | ||
181, | ||
160, | ||
222, | ||
75, | ||
198, | ||
42, | ||
42, | ||
32, | ||
31, | ||
141, | ||
37, | ||
186, | ||
233, | ||
], | ||
"pubKeyCredParams": [ | ||
{ | ||
"alg": -7, | ||
"type": "public-key", | ||
{ | ||
"publicKey": { | ||
"attestation": "none", | ||
"authenticatorSelection": { | ||
"authenticatorAttachment": "platform", | ||
"requireResidentKey": false, | ||
"residentKey": "preferred", | ||
"userVerification": "required", | ||
}, | ||
], | ||
"rp": { | ||
"id": "https://example.com", | ||
"name": "My Website", | ||
}, | ||
"user": { | ||
"displayName": "Foo", | ||
"id": Uint8Array [ | ||
182, | ||
8, | ||
199, | ||
66, | ||
131, | ||
243, | ||
52, | ||
225, | ||
240, | ||
71, | ||
219, | ||
191, | ||
29, | ||
170, | ||
36, | ||
7, | ||
212, | ||
29, | ||
70, | ||
137, | ||
172, | ||
166, | ||
124, | ||
66, | ||
39, | ||
150, | ||
249, | ||
54, | ||
172, | ||
206, | ||
22, | ||
183, | ||
"challenge": Uint8Array [ | ||
105, | ||
171, | ||
180, | ||
181, | ||
160, | ||
222, | ||
75, | ||
198, | ||
42, | ||
42, | ||
32, | ||
31, | ||
141, | ||
37, | ||
186, | ||
233, | ||
], | ||
"name": "Foo", | ||
"extensions": undefined, | ||
"pubKeyCredParams": [ | ||
{ | ||
"alg": -7, | ||
"type": "public-key", | ||
}, | ||
], | ||
"rp": { | ||
"id": "https://example.com", | ||
"name": "My Website", | ||
}, | ||
"user": { | ||
"displayName": "Foo", | ||
"id": Uint8Array [ | ||
182, | ||
8, | ||
199, | ||
66, | ||
131, | ||
243, | ||
52, | ||
225, | ||
240, | ||
71, | ||
219, | ||
191, | ||
29, | ||
170, | ||
36, | ||
7, | ||
212, | ||
29, | ||
70, | ||
137, | ||
172, | ||
166, | ||
124, | ||
66, | ||
39, | ||
150, | ||
249, | ||
54, | ||
172, | ||
206, | ||
22, | ||
183, | ||
], | ||
"name": "Foo", | ||
}, | ||
}, | ||
}, | ||
} | ||
`) | ||
} | ||
`) | ||
}) | ||
@@ -243,119 +245,120 @@ | ||
).toMatchInlineSnapshot(` | ||
{ | ||
"publicKey": { | ||
"attestation": "none", | ||
"authenticatorSelection": { | ||
"authenticatorAttachment": "platform", | ||
"requireResidentKey": false, | ||
"residentKey": "preferred", | ||
"userVerification": "required", | ||
}, | ||
"challenge": Uint8Array [ | ||
105, | ||
171, | ||
180, | ||
181, | ||
160, | ||
222, | ||
75, | ||
198, | ||
42, | ||
42, | ||
32, | ||
31, | ||
141, | ||
37, | ||
186, | ||
233, | ||
], | ||
"excludeCredentials": [ | ||
{ | ||
{ | ||
"publicKey": { | ||
"attestation": "none", | ||
"authenticatorSelection": { | ||
"authenticatorAttachment": "platform", | ||
"requireResidentKey": false, | ||
"residentKey": "preferred", | ||
"userVerification": "required", | ||
}, | ||
"challenge": Uint8Array [ | ||
105, | ||
171, | ||
180, | ||
181, | ||
160, | ||
222, | ||
75, | ||
198, | ||
42, | ||
42, | ||
32, | ||
31, | ||
141, | ||
37, | ||
186, | ||
233, | ||
], | ||
"excludeCredentials": [ | ||
{ | ||
"id": Uint8Array [ | ||
167, | ||
58, | ||
80, | ||
101, | ||
24, | ||
87, | ||
82, | ||
70, | ||
232, | ||
143, | ||
230, | ||
255, | ||
178, | ||
177, | ||
244, | ||
95, | ||
141, | ||
151, | ||
37, | ||
46, | ||
192, | ||
139, | ||
102, | ||
87, | ||
119, | ||
175, | ||
189, | ||
150, | ||
113, | ||
84, | ||
46, | ||
40, | ||
], | ||
"type": "public-key", | ||
}, | ||
], | ||
"extensions": undefined, | ||
"pubKeyCredParams": [ | ||
{ | ||
"alg": -7, | ||
"type": "public-key", | ||
}, | ||
], | ||
"rp": { | ||
"id": "https://example.com", | ||
"name": "My Website", | ||
}, | ||
"user": { | ||
"displayName": "Foo", | ||
"id": Uint8Array [ | ||
167, | ||
58, | ||
80, | ||
101, | ||
24, | ||
87, | ||
82, | ||
182, | ||
8, | ||
199, | ||
66, | ||
131, | ||
243, | ||
52, | ||
225, | ||
240, | ||
71, | ||
219, | ||
191, | ||
29, | ||
170, | ||
36, | ||
7, | ||
212, | ||
29, | ||
70, | ||
232, | ||
143, | ||
230, | ||
255, | ||
178, | ||
177, | ||
244, | ||
95, | ||
141, | ||
151, | ||
37, | ||
46, | ||
192, | ||
139, | ||
102, | ||
87, | ||
119, | ||
175, | ||
189, | ||
137, | ||
172, | ||
166, | ||
124, | ||
66, | ||
39, | ||
150, | ||
113, | ||
84, | ||
46, | ||
40, | ||
249, | ||
54, | ||
172, | ||
206, | ||
22, | ||
183, | ||
], | ||
"type": "public-key", | ||
"name": "Foo", | ||
}, | ||
], | ||
"pubKeyCredParams": [ | ||
{ | ||
"alg": -7, | ||
"type": "public-key", | ||
}, | ||
], | ||
"rp": { | ||
"id": "https://example.com", | ||
"name": "My Website", | ||
}, | ||
"user": { | ||
"displayName": "Foo", | ||
"id": Uint8Array [ | ||
182, | ||
8, | ||
199, | ||
66, | ||
131, | ||
243, | ||
52, | ||
225, | ||
240, | ||
71, | ||
219, | ||
191, | ||
29, | ||
170, | ||
36, | ||
7, | ||
212, | ||
29, | ||
70, | ||
137, | ||
172, | ||
166, | ||
124, | ||
66, | ||
39, | ||
150, | ||
249, | ||
54, | ||
172, | ||
206, | ||
22, | ||
183, | ||
], | ||
"name": "Foo", | ||
}, | ||
}, | ||
} | ||
`) | ||
} | ||
`) | ||
}) | ||
@@ -371,81 +374,82 @@ | ||
).toMatchInlineSnapshot(` | ||
{ | ||
"publicKey": { | ||
"attestation": "none", | ||
"authenticatorSelection": { | ||
"authenticatorAttachment": "platform", | ||
"requireResidentKey": false, | ||
"residentKey": "preferred", | ||
"userVerification": "required", | ||
}, | ||
"challenge": Uint8Array [ | ||
105, | ||
171, | ||
180, | ||
181, | ||
160, | ||
222, | ||
75, | ||
198, | ||
42, | ||
42, | ||
32, | ||
31, | ||
141, | ||
37, | ||
186, | ||
233, | ||
], | ||
"pubKeyCredParams": [ | ||
{ | ||
"alg": -7, | ||
"type": "public-key", | ||
{ | ||
"publicKey": { | ||
"attestation": "none", | ||
"authenticatorSelection": { | ||
"authenticatorAttachment": "platform", | ||
"requireResidentKey": false, | ||
"residentKey": "preferred", | ||
"userVerification": "required", | ||
}, | ||
], | ||
"rp": { | ||
"id": "https://example.com", | ||
"name": "My Website", | ||
}, | ||
"user": { | ||
"displayName": "Foo", | ||
"id": Uint8Array [ | ||
182, | ||
8, | ||
199, | ||
66, | ||
131, | ||
243, | ||
52, | ||
225, | ||
240, | ||
71, | ||
219, | ||
191, | ||
29, | ||
170, | ||
36, | ||
7, | ||
212, | ||
29, | ||
70, | ||
137, | ||
172, | ||
166, | ||
124, | ||
66, | ||
39, | ||
150, | ||
249, | ||
54, | ||
172, | ||
206, | ||
22, | ||
183, | ||
"challenge": Uint8Array [ | ||
105, | ||
171, | ||
180, | ||
181, | ||
160, | ||
222, | ||
75, | ||
198, | ||
42, | ||
42, | ||
32, | ||
31, | ||
141, | ||
37, | ||
186, | ||
233, | ||
], | ||
"name": "Foo", | ||
"extensions": undefined, | ||
"pubKeyCredParams": [ | ||
{ | ||
"alg": -7, | ||
"type": "public-key", | ||
}, | ||
], | ||
"rp": { | ||
"id": "https://example.com", | ||
"name": "My Website", | ||
}, | ||
"user": { | ||
"displayName": "Foo", | ||
"id": Uint8Array [ | ||
182, | ||
8, | ||
199, | ||
66, | ||
131, | ||
243, | ||
52, | ||
225, | ||
240, | ||
71, | ||
219, | ||
191, | ||
29, | ||
170, | ||
36, | ||
7, | ||
212, | ||
29, | ||
70, | ||
137, | ||
172, | ||
166, | ||
124, | ||
66, | ||
39, | ||
150, | ||
249, | ||
54, | ||
172, | ||
206, | ||
22, | ||
183, | ||
], | ||
"name": "Foo", | ||
}, | ||
}, | ||
}, | ||
} | ||
`) | ||
} | ||
`) | ||
}) | ||
}) |
@@ -95,2 +95,6 @@ import { keccak_256 } from '@noble/hashes/sha3' | ||
/** | ||
* List of Web Authentication API credentials to use during creation or authentication. | ||
*/ | ||
extensions?: PublicKeyCredentialCreationOptions['extensions'] | undefined | ||
/** | ||
* An object describing the relying party that requested the credential creation | ||
@@ -155,2 +159,3 @@ */ | ||
user, | ||
extensions, | ||
} = parameters | ||
@@ -183,4 +188,5 @@ const name = (user?.name ?? name_)! | ||
}, | ||
extensions, | ||
}, | ||
} as CredentialCreationOptions | ||
} |
{ | ||
"name": "webauthn-p256", | ||
"description": "P256 signature utilities for WebAuthn", | ||
"version": "0.0.5", | ||
"version": "0.0.6-main.20240728T072832", | ||
"type": "module", | ||
@@ -36,2 +36,2 @@ "main": "./_cjs/index.js", | ||
"keywords": [] | ||
} | ||
} |
@@ -73,5 +73,7 @@ export type Hex = `0x${string}` | ||
type UserVerificationRequirement = 'discouraged' | 'preferred' | 'required' | ||
type LargeBlobSupport = { | ||
support: 'required' | 'preferred' | ||
} | ||
type BufferSource = ArrayBufferView | ArrayBuffer | ||
type PrfExtension = Record<'prf', Record<'eval', Record<'first', Uint8Array>>> | ||
interface AuthenticationExtensionsClientInputs { | ||
@@ -82,2 +84,4 @@ appid?: string | ||
minPinLength?: boolean | ||
prf?: PrfExtension | ||
largeBlob?: LargeBlobSupport | ||
} | ||
@@ -84,0 +88,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
189016
3106