ox 1.2.0 → 1.3.0
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/CHANGELOG.md +34 -0
- package/dist/core/AbiFunction.d.ts +1 -1
- package/dist/core/AbiFunction.d.ts.map +1 -1
- package/dist/core/AbiFunction.js +6 -2
- package/dist/core/AbiFunction.js.map +1 -1
- package/dist/core/AbiParameters.d.ts +1 -1
- package/dist/core/AbiParameters.d.ts.map +1 -1
- package/dist/core/AbiParameters.js +1 -13
- package/dist/core/AbiParameters.js.map +1 -1
- package/dist/core/AesGcm.d.ts +36 -1
- package/dist/core/AesGcm.d.ts.map +1 -1
- package/dist/core/AesGcm.js +44 -0
- package/dist/core/AesGcm.js.map +1 -1
- package/dist/core/Ed25519.d.ts +46 -1
- package/dist/core/Ed25519.d.ts.map +1 -1
- package/dist/core/Ed25519.js +43 -0
- package/dist/core/Ed25519.js.map +1 -1
- package/dist/core/Engine.d.ts +1 -1
- package/dist/core/Engine.d.ts.map +1 -1
- package/dist/core/Engine.js.map +1 -1
- package/dist/core/Hash.d.ts +164 -1
- package/dist/core/Hash.d.ts.map +1 -1
- package/dist/core/Hash.js +172 -0
- package/dist/core/Hash.js.map +1 -1
- package/dist/core/Hex.d.ts.map +1 -1
- package/dist/core/Hex.js +1 -4
- package/dist/core/Hex.js.map +1 -1
- package/dist/core/Rlp.d.ts +32 -0
- package/dist/core/Rlp.d.ts.map +1 -1
- package/dist/core/Rlp.js +146 -0
- package/dist/core/Rlp.js.map +1 -1
- package/dist/core/Secp256k1.d.ts +46 -1
- package/dist/core/Secp256k1.d.ts.map +1 -1
- package/dist/core/Secp256k1.js +48 -0
- package/dist/core/Secp256k1.js.map +1 -1
- package/dist/core/WebAuthn.d.ts +224 -0
- package/dist/core/WebAuthn.d.ts.map +1 -0
- package/dist/core/WebAuthn.js +343 -0
- package/dist/core/WebAuthn.js.map +1 -0
- package/dist/core/WebAuthnP256.d.ts +46 -50
- package/dist/core/WebAuthnP256.d.ts.map +1 -1
- package/dist/core/WebAuthnP256.js +44 -50
- package/dist/core/WebAuthnP256.js.map +1 -1
- package/dist/core/internal/abiParameters.d.ts +7 -87
- package/dist/core/internal/abiParameters.d.ts.map +1 -1
- package/dist/core/internal/abiParameters.js +339 -194
- package/dist/core/internal/abiParameters.js.map +1 -1
- package/dist/core/internal/engine.d.ts +35 -2
- package/dist/core/internal/engine.d.ts.map +1 -1
- package/dist/core/internal/engine.js +12 -1
- package/dist/core/internal/engine.js.map +1 -1
- package/dist/core/internal/hash.d.ts +10 -0
- package/dist/core/internal/hash.d.ts.map +1 -1
- package/dist/core/internal/hash.js +26 -1
- package/dist/core/internal/hash.js.map +1 -1
- package/dist/index.d.ts +23 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -14
- package/dist/index.js.map +1 -1
- package/dist/node/Engine.d.ts +1 -1
- package/dist/node/Engine.d.ts.map +1 -1
- package/dist/node/Engine.js.map +1 -1
- package/dist/node/Hash.d.ts +6 -4
- package/dist/node/Hash.d.ts.map +1 -1
- package/dist/node/Hash.js +35 -3
- package/dist/node/Hash.js.map +1 -1
- package/dist/tempo/AuthorizationTempo.d.ts +6 -6
- package/dist/tempo/AuthorizationTempo.js +6 -6
- package/dist/tempo/KeyAuthorization.d.ts +3 -8
- package/dist/tempo/KeyAuthorization.d.ts.map +1 -1
- package/dist/tempo/KeyAuthorization.js +3 -8
- package/dist/tempo/KeyAuthorization.js.map +1 -1
- package/dist/tempo/SignatureEnvelope.d.ts +8 -8
- package/dist/tempo/SignatureEnvelope.js +8 -8
- package/dist/wasm/Engine.d.ts +1 -1
- package/dist/wasm/Engine.d.ts.map +1 -1
- package/dist/wasm/Engine.js.map +1 -1
- package/dist/wasm/Hash.d.ts +1 -1
- package/dist/wasm/Hash.d.ts.map +1 -1
- package/dist/wasm/Hash.js +5 -0
- package/dist/wasm/Hash.js.map +1 -1
- package/dist/wasm/internal/blake3.d.ts +10 -1
- package/dist/wasm/internal/blake3.d.ts.map +1 -1
- package/dist/wasm/internal/blake3.js +12 -1
- package/dist/wasm/internal/blake3.js.map +1 -1
- package/dist/wasm/internal/blake3.wasm.d.ts +3 -1
- package/dist/wasm/internal/blake3.wasm.d.ts.map +1 -1
- package/dist/wasm/internal/blake3.wasm.js +3 -1
- package/dist/wasm/internal/blake3.wasm.js.map +1 -1
- package/dist/wasm/internal/hash.d.ts +9 -0
- package/dist/wasm/internal/hash.d.ts.map +1 -1
- package/dist/wasm/internal/hash.js +13 -1
- package/dist/wasm/internal/hash.js.map +1 -1
- package/dist/wasm/internal/hashState.d.ts +25 -0
- package/dist/wasm/internal/hashState.d.ts.map +1 -0
- package/dist/wasm/internal/hashState.js +105 -0
- package/dist/wasm/internal/hashState.js.map +1 -0
- package/dist/wasm/internal/hashes.d.ts +12 -1
- package/dist/wasm/internal/hashes.d.ts.map +1 -1
- package/dist/wasm/internal/hashes.js +18 -1
- package/dist/wasm/internal/hashes.js.map +1 -1
- package/dist/wasm/internal/hashes.wasm.d.ts +11 -3
- package/dist/wasm/internal/hashes.wasm.d.ts.map +1 -1
- package/dist/wasm/internal/hashes.wasm.js +11 -3
- package/dist/wasm/internal/hashes.wasm.js.map +1 -1
- package/dist/webauthn/Authentication.d.ts +2 -0
- package/dist/webauthn/Authentication.d.ts.map +1 -1
- package/dist/webauthn/Authentication.js +2 -1
- package/dist/webauthn/Authentication.js.map +1 -1
- package/dist/webauthn/Registration.d.ts.map +1 -1
- package/dist/webauthn/Registration.js +2 -1
- package/dist/webauthn/Registration.js.map +1 -1
- package/dist/webauthn/Types.d.ts +27 -6
- package/dist/webauthn/Types.d.ts.map +1 -1
- package/dist/webauthn/internal/utils.d.ts.map +1 -1
- package/dist/webauthn/internal/utils.js +35 -9
- package/dist/webauthn/internal/utils.js.map +1 -1
- package/dist/zod/TypedData.d.ts +2 -2
- package/package.json +9 -1
- package/src/benchmarks/Ox.bench.ts +6 -0
- package/src/benchmarks/OxNode.bench.ts +8 -0
- package/src/benchmarks/OxV0.bench.ts +4 -0
- package/src/benchmarks/OxWasm.bench.ts +22 -0
- package/src/core/AbiFunction.ts +5 -5
- package/src/core/AbiParameters.ts +8 -20
- package/src/core/AesGcm.ts +86 -1
- package/src/core/Ed25519.ts +87 -1
- package/src/core/Engine.ts +1 -0
- package/src/core/Hash.ts +262 -1
- package/src/core/Hex.ts +1 -4
- package/src/core/Rlp.ts +172 -5
- package/src/core/Secp256k1.ts +92 -1
- package/src/core/WebAuthn.ts +579 -0
- package/src/core/WebAuthnP256.ts +47 -50
- package/src/core/_test/AbiFunction.test.ts +9 -0
- package/src/core/_test/AbiParameters.differential.fuzz.ts +156 -0
- package/src/core/_test/AbiParameters.encode.test.ts +22 -0
- package/src/core/_test/AbiParameters.fuzz.ts +4 -0
- package/src/core/_test/AesGcm.test.ts +76 -0
- package/src/core/_test/Ed25519.test-d.ts +13 -1
- package/src/core/_test/Ed25519.test.ts +120 -1
- package/src/core/_test/Engine.test-d.ts +9 -0
- package/src/core/_test/Engine.test.ts +1 -1
- package/src/core/_test/Hash.test-d.ts +23 -0
- package/src/core/_test/Hash.test.ts +179 -1
- package/src/core/_test/Hex.test.ts +2 -0
- package/src/core/_test/Rlp.test-d.ts +18 -0
- package/src/core/_test/Rlp.test.ts +109 -0
- package/src/core/_test/Secp256k1.test-d.ts +14 -0
- package/src/core/_test/Secp256k1.test.ts +91 -1
- package/src/core/_test/WebAuthn.test-d.ts +142 -0
- package/src/core/_test/WebAuthn.test.ts +766 -0
- package/src/core/_test/index.test.ts +1 -0
- package/src/core/internal/abiParameters.ts +466 -326
- package/src/core/internal/engine.ts +47 -2
- package/src/core/internal/hash.ts +53 -1
- package/src/index.ts +24 -14
- package/src/node/Engine.ts +1 -0
- package/src/node/Hash.ts +43 -6
- package/src/node/_test/Engine.test-d.ts +1 -0
- package/src/node/_test/Engine.test.ts +2 -0
- package/src/node/_test/Hash.test-d.ts +10 -0
- package/src/node/_test/Hash.test.ts +46 -0
- package/src/tempo/AuthorizationTempo.ts +6 -6
- package/src/tempo/KeyAuthorization.ts +3 -8
- package/src/tempo/SignatureEnvelope.ts +8 -8
- package/src/version.ts +1 -1
- package/src/wasm/Engine.ts +1 -0
- package/src/wasm/Hash.ts +10 -0
- package/src/wasm/_test/Engine.test-d.ts +1 -0
- package/src/wasm/_test/Engine.test.ts +5 -0
- package/src/wasm/_test/Hash.browser.test.ts +28 -0
- package/src/wasm/_test/Hash.test-d.ts +16 -0
- package/src/wasm/_test/Hash.test.ts +250 -1
- package/src/wasm/internal/blake3.ts +23 -2
- package/src/wasm/internal/blake3.wasm.ts +4 -1
- package/src/wasm/internal/hash.ts +27 -1
- package/src/wasm/internal/hashState.ts +154 -0
- package/src/wasm/internal/hashes.ts +56 -15
- package/src/wasm/internal/hashes.wasm.ts +15 -3
- package/src/webauthn/Authentication.ts +4 -0
- package/src/webauthn/Registration.ts +2 -0
- package/src/webauthn/Types.ts +32 -2
- package/src/webauthn/_test/Authentication.test.ts +123 -1
- package/src/webauthn/_test/Registration.test.ts +26 -6
- package/src/webauthn/_test/WebAuthn.browser.test.ts +28 -0
- package/src/webauthn/internal/utils.ts +41 -8
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebAuthn.d.ts","sourceRoot":"","sources":["../../src/core/WebAuthn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAEpD,OAAO,KAAK,cAAc,MAAM,+BAA+B,CAAA;AAC/D,OAAO,KAAK,KAAK,UAAU,MAAM,2BAA2B,CAAA;AAC5D,OAAO,KAAK,YAAY,MAAM,6BAA6B,CAAA;AAC3D,OAAO,KAAK,KAAK,KAAK,MAAM,sBAAsB,CAAA;AAElD,cAAc,mBAAmB,CAAA;AAIjC,oE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AS,CAAC,KAAK,CAAC;IACnE,SAAkB,IAAI,uCAAsC;gBAEhD,EAAE,KAAK,EAAE,GAAE;QAAE,KAAK,CAAC,EAAE,KAAK,GAAG,SAAS,CAAA;KAAO;CAK1D"}
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
import * as Bytes from './Bytes.js';
|
|
2
|
+
import * as Errors from './Errors.js';
|
|
3
|
+
import * as Hex from './Hex.js';
|
|
4
|
+
import * as WebAuthnP256 from './WebAuthnP256.js';
|
|
5
|
+
import * as Authentication from '../webauthn/Authentication.js';
|
|
6
|
+
import * as Registration from '../webauthn/Registration.js';
|
|
7
|
+
export * from './WebAuthnP256.js';
|
|
8
|
+
const defaultPrfInput = Bytes.fromString('ox.webauthn.prf.v1');
|
|
9
|
+
/**
|
|
10
|
+
* Creates a WebAuthn credential and optionally returns its credential-bound
|
|
11
|
+
* PRF output.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts twoslash
|
|
15
|
+
* import { Secp256k1, WebAuthn } from 'ox'
|
|
16
|
+
*
|
|
17
|
+
* const credential = await WebAuthn.createCredential({
|
|
18
|
+
* name: 'Example',
|
|
19
|
+
* prf: true
|
|
20
|
+
* })
|
|
21
|
+
* const privateKey = Secp256k1.fromPrf(credential.prf)
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* `prf: true` uses the stable input `ox.webauthn.prf.v1`. Pass
|
|
25
|
+
* `{ input }` to use an application-owned input instead.
|
|
26
|
+
*
|
|
27
|
+
* When credential creation enables PRF but does not return an output, this
|
|
28
|
+
* function performs a follow-up assertion. The user may be prompted twice.
|
|
29
|
+
*
|
|
30
|
+
* If PRF evaluation fails after registration, the thrown error retains the
|
|
31
|
+
* created credential on its `credential` property.
|
|
32
|
+
*
|
|
33
|
+
* :::warning
|
|
34
|
+
*
|
|
35
|
+
* PRF output is secret application-held key material. Native
|
|
36
|
+
* `credential.raw.toJSON()` output includes extension results, so do not
|
|
37
|
+
* serialize or send the raw credential.
|
|
38
|
+
*
|
|
39
|
+
* PRF-derived keys are software keys. Code on any origin allowed to use the
|
|
40
|
+
* same RP ID can request the same output after user verification.
|
|
41
|
+
*
|
|
42
|
+
* :::
|
|
43
|
+
*
|
|
44
|
+
* @param options - Credential creation and PRF options.
|
|
45
|
+
* @returns The credential, with a copied PRF output when requested.
|
|
46
|
+
*/
|
|
47
|
+
export async function createCredential(options) {
|
|
48
|
+
if (!('prf' in options) || options.prf === undefined)
|
|
49
|
+
return WebAuthnP256.createCredential(options);
|
|
50
|
+
if ('publicKey' in options)
|
|
51
|
+
throw new InvalidOptionsError();
|
|
52
|
+
const rpId = options.rp?.id;
|
|
53
|
+
const { authenticatorSelection = {
|
|
54
|
+
requireResidentKey: true,
|
|
55
|
+
residentKey: 'required',
|
|
56
|
+
}, challenge = Hex.random(32), createFn, extensions, getFn, prf, timeout, ...rest } = options;
|
|
57
|
+
assertExtensions(extensions);
|
|
58
|
+
const input = getPrfInput(prf);
|
|
59
|
+
const credential = await Registration.create({
|
|
60
|
+
...rest,
|
|
61
|
+
authenticatorSelection: {
|
|
62
|
+
...authenticatorSelection,
|
|
63
|
+
userVerification: 'required',
|
|
64
|
+
},
|
|
65
|
+
challenge,
|
|
66
|
+
...(createFn && { createFn }),
|
|
67
|
+
extensions: {
|
|
68
|
+
...extensions,
|
|
69
|
+
prf: {
|
|
70
|
+
eval: {
|
|
71
|
+
first: input,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
...(timeout !== undefined && { timeout }),
|
|
76
|
+
});
|
|
77
|
+
const result = (() => {
|
|
78
|
+
try {
|
|
79
|
+
return credential.raw.getClientExtensionResults().prf;
|
|
80
|
+
}
|
|
81
|
+
catch (cause) {
|
|
82
|
+
throw new PrfEvaluationFailedError({
|
|
83
|
+
cause: cause,
|
|
84
|
+
credential,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
})();
|
|
88
|
+
const output = result?.results?.first;
|
|
89
|
+
if (output !== undefined)
|
|
90
|
+
return {
|
|
91
|
+
...credential,
|
|
92
|
+
prf: parsePrfOutput(output, {
|
|
93
|
+
credential,
|
|
94
|
+
}),
|
|
95
|
+
};
|
|
96
|
+
if (result?.enabled !== true)
|
|
97
|
+
throw new PrfNotSupportedError({
|
|
98
|
+
credential,
|
|
99
|
+
});
|
|
100
|
+
try {
|
|
101
|
+
const result = await getCredential({
|
|
102
|
+
credentialId: credential.id,
|
|
103
|
+
...(getFn && { getFn }),
|
|
104
|
+
prf: {
|
|
105
|
+
input,
|
|
106
|
+
},
|
|
107
|
+
...(rpId && { rpId }),
|
|
108
|
+
...(timeout !== undefined && { timeout }),
|
|
109
|
+
});
|
|
110
|
+
if (result.id !== credential.id)
|
|
111
|
+
throw new Error(`Expected credential "${credential.id}", but received "${result.id}".`);
|
|
112
|
+
return {
|
|
113
|
+
...credential,
|
|
114
|
+
prf: result.prf,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
catch (cause) {
|
|
118
|
+
throw new PrfEvaluationFailedError({
|
|
119
|
+
cause: cause,
|
|
120
|
+
credential,
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Requests a WebAuthn credential and returns its credential-bound PRF output.
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* ```ts twoslash
|
|
129
|
+
* import { Secp256k1, WebAuthn } from 'ox'
|
|
130
|
+
*
|
|
131
|
+
* const { prf } = await WebAuthn.getCredential({
|
|
132
|
+
* credentialId: 'oZ48...',
|
|
133
|
+
* prf: true
|
|
134
|
+
* })
|
|
135
|
+
* const privateKey = Secp256k1.fromPrf(prf)
|
|
136
|
+
* ```
|
|
137
|
+
*
|
|
138
|
+
* `prf: true` uses the stable input `ox.webauthn.prf.v1`. Pass
|
|
139
|
+
* `{ input }` to use an application-owned input instead.
|
|
140
|
+
*
|
|
141
|
+
* When more than one credential can be selected, check `result.id`
|
|
142
|
+
* before using the PRF output.
|
|
143
|
+
*
|
|
144
|
+
* :::warning
|
|
145
|
+
*
|
|
146
|
+
* PRF output is secret application-held key material. Native
|
|
147
|
+
* `response.raw.toJSON()` output includes extension results, so do not
|
|
148
|
+
* serialize or send the raw response.
|
|
149
|
+
*
|
|
150
|
+
* :::
|
|
151
|
+
*
|
|
152
|
+
* @param options - Credential request and PRF options.
|
|
153
|
+
* @returns The requested credential and a copied 32-byte PRF output.
|
|
154
|
+
*/
|
|
155
|
+
export async function getCredential(options) {
|
|
156
|
+
if ('publicKey' in options)
|
|
157
|
+
throw new InvalidOptionsError();
|
|
158
|
+
const { challenge = Hex.random(32), extensions, getFn = (options) => window.navigator.credentials.get(options), prf, ...rest } = options;
|
|
159
|
+
assertExtensions(extensions);
|
|
160
|
+
const input = getPrfInput(prf);
|
|
161
|
+
const request = Authentication.getOptions({
|
|
162
|
+
...rest,
|
|
163
|
+
challenge,
|
|
164
|
+
extensions: {
|
|
165
|
+
...extensions,
|
|
166
|
+
prf: {
|
|
167
|
+
eval: {
|
|
168
|
+
first: input,
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
userVerification: 'required',
|
|
173
|
+
});
|
|
174
|
+
const raw = await (async () => {
|
|
175
|
+
try {
|
|
176
|
+
return (await getFn(request));
|
|
177
|
+
}
|
|
178
|
+
catch (cause) {
|
|
179
|
+
throw new GetCredentialFailedError({
|
|
180
|
+
cause: cause,
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
})();
|
|
184
|
+
if (!raw)
|
|
185
|
+
throw new GetCredentialFailedError();
|
|
186
|
+
const response = {
|
|
187
|
+
id: raw.id,
|
|
188
|
+
raw,
|
|
189
|
+
};
|
|
190
|
+
const output = (() => {
|
|
191
|
+
try {
|
|
192
|
+
return response.raw.getClientExtensionResults().prf?.results?.first;
|
|
193
|
+
}
|
|
194
|
+
catch (cause) {
|
|
195
|
+
throw new PrfEvaluationFailedError({
|
|
196
|
+
cause: cause,
|
|
197
|
+
response,
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
})();
|
|
201
|
+
if (output === undefined)
|
|
202
|
+
throw new PrfUnavailableError({
|
|
203
|
+
response,
|
|
204
|
+
});
|
|
205
|
+
return {
|
|
206
|
+
...response,
|
|
207
|
+
prf: parsePrfOutput(output, {
|
|
208
|
+
response,
|
|
209
|
+
}),
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
function getPrfInput(prf) {
|
|
213
|
+
return (prf === true ? defaultPrfInput : prf.input).slice();
|
|
214
|
+
}
|
|
215
|
+
function parsePrfOutput(value, context) {
|
|
216
|
+
if (ArrayBuffer.isView(value)) {
|
|
217
|
+
if (value.byteLength !== 32)
|
|
218
|
+
throw new InvalidPrfOutputError({
|
|
219
|
+
...context,
|
|
220
|
+
size: value.byteLength,
|
|
221
|
+
});
|
|
222
|
+
return new Uint8Array(value.buffer, value.byteOffset, value.byteLength).slice();
|
|
223
|
+
}
|
|
224
|
+
const arrayBufferSize = getArrayBufferSize(value);
|
|
225
|
+
if (arrayBufferSize !== undefined) {
|
|
226
|
+
if (arrayBufferSize !== 32)
|
|
227
|
+
throw new InvalidPrfOutputError({
|
|
228
|
+
...context,
|
|
229
|
+
size: arrayBufferSize,
|
|
230
|
+
});
|
|
231
|
+
return new Uint8Array(value).slice();
|
|
232
|
+
}
|
|
233
|
+
if (typeof value === 'object' &&
|
|
234
|
+
value !== null &&
|
|
235
|
+
'length' in value &&
|
|
236
|
+
typeof value.length === 'number') {
|
|
237
|
+
if (value.length !== 32)
|
|
238
|
+
throw new InvalidPrfOutputError({
|
|
239
|
+
...context,
|
|
240
|
+
size: value.length,
|
|
241
|
+
});
|
|
242
|
+
const output = new Uint8Array(32);
|
|
243
|
+
for (let index = 0; index < output.length; index++) {
|
|
244
|
+
const byte = value[index];
|
|
245
|
+
if (typeof byte !== 'number' ||
|
|
246
|
+
!Number.isInteger(byte) ||
|
|
247
|
+
byte < 0 ||
|
|
248
|
+
byte > 255)
|
|
249
|
+
throw new InvalidPrfOutputError(context);
|
|
250
|
+
output[index] = byte;
|
|
251
|
+
}
|
|
252
|
+
return output;
|
|
253
|
+
}
|
|
254
|
+
throw new InvalidPrfOutputError(context);
|
|
255
|
+
}
|
|
256
|
+
function getArrayBufferSize(value) {
|
|
257
|
+
try {
|
|
258
|
+
return Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, 'byteLength')?.get?.call(value);
|
|
259
|
+
}
|
|
260
|
+
catch {
|
|
261
|
+
return undefined;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
function assertExtensions(extensions) {
|
|
265
|
+
if (extensions?.prf)
|
|
266
|
+
throw new InvalidExtensionError();
|
|
267
|
+
}
|
|
268
|
+
/** Thrown when a caller supplies the managed `prf` extension. */
|
|
269
|
+
export class InvalidExtensionError extends Errors.BaseError {
|
|
270
|
+
name = 'WebAuthn.InvalidExtensionError';
|
|
271
|
+
constructor() {
|
|
272
|
+
super('The `prf` extension is managed by this function.');
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
/** Thrown when raw credential options are combined with managed PRF evaluation. */
|
|
276
|
+
export class InvalidOptionsError extends Errors.BaseError {
|
|
277
|
+
name = 'WebAuthn.InvalidOptionsError';
|
|
278
|
+
constructor() {
|
|
279
|
+
super('The `publicKey` option cannot be combined with managed PRF evaluation.');
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
/** Thrown when a WebAuthn PRF result is not a valid 32-byte output. */
|
|
283
|
+
export class InvalidPrfOutputError extends Errors.BaseError {
|
|
284
|
+
/** Credential that returned the invalid PRF output, when created in this operation. */
|
|
285
|
+
credential;
|
|
286
|
+
/** Authentication response that returned the invalid PRF output, when available. */
|
|
287
|
+
response;
|
|
288
|
+
name = 'WebAuthn.InvalidPrfOutputError';
|
|
289
|
+
constructor({ credential, response, size, }) {
|
|
290
|
+
super(size === undefined
|
|
291
|
+
? 'Expected a 32-byte PRF output.'
|
|
292
|
+
: `Expected a 32-byte PRF output, but received ${size} bytes.`);
|
|
293
|
+
this.credential = credential;
|
|
294
|
+
this.response = response;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
/** Thrown when a created credential does not support PRF evaluation. */
|
|
298
|
+
export class PrfNotSupportedError extends Errors.BaseError {
|
|
299
|
+
/** Credential that was created before PRF support was determined. */
|
|
300
|
+
credential;
|
|
301
|
+
name = 'WebAuthn.PrfNotSupportedError';
|
|
302
|
+
constructor({ credential }) {
|
|
303
|
+
super('The created credential does not support PRF evaluation.');
|
|
304
|
+
this.credential = credential;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
/** Thrown when a credential assertion does not return a PRF output. */
|
|
308
|
+
export class PrfUnavailableError extends Errors.BaseError {
|
|
309
|
+
/** Authentication response that did not contain a PRF output. */
|
|
310
|
+
response;
|
|
311
|
+
name = 'WebAuthn.PrfUnavailableError';
|
|
312
|
+
constructor({ response }) {
|
|
313
|
+
super('The credential did not return a PRF output.');
|
|
314
|
+
this.response = response;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
/** Thrown when WebAuthn PRF evaluation fails after a credential ceremony. */
|
|
318
|
+
export class PrfEvaluationFailedError extends Errors.BaseError {
|
|
319
|
+
/** Credential that was created before PRF evaluation failed, when available. */
|
|
320
|
+
credential;
|
|
321
|
+
/** Authentication response produced before PRF evaluation failed, when available. */
|
|
322
|
+
response;
|
|
323
|
+
name = 'WebAuthn.PrfEvaluationFailedError';
|
|
324
|
+
constructor({ cause, credential, response, }) {
|
|
325
|
+
super(credential
|
|
326
|
+
? 'Created a credential, but failed to evaluate its PRF.'
|
|
327
|
+
: 'Failed to evaluate the credential PRF.', {
|
|
328
|
+
cause,
|
|
329
|
+
});
|
|
330
|
+
this.credential = credential;
|
|
331
|
+
this.response = response;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
/** Thrown when a WebAuthn credential request fails. */
|
|
335
|
+
export class GetCredentialFailedError extends Errors.BaseError {
|
|
336
|
+
name = 'WebAuthn.GetCredentialFailedError';
|
|
337
|
+
constructor({ cause } = {}) {
|
|
338
|
+
super('Failed to request credential.', {
|
|
339
|
+
cause,
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
//# sourceMappingURL=WebAuthn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebAuthn.js","sourceRoot":"","sources":["../../src/core/WebAuthn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAE/B,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,cAAc,MAAM,+BAA+B,CAAA;AAE/D,OAAO,KAAK,YAAY,MAAM,6BAA6B,CAAA;AAG3D,cAAc,mBAAmB,CAAA;AAEjC,MAAM,eAAe,GAAG,KAAK,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAA;AAe9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAEpC,OAAgB;IAChB,IAAI,CAAC,CAAC,KAAK,IAAI,OAAO,CAAC,IAAI,OAAO,CAAC,GAAG,KAAK,SAAS;QAClD,OAAO,YAAY,CAAC,gBAAgB,CAAC,OAAO,CAAU,CAAA;IACxD,IAAI,WAAW,IAAI,OAAO;QAAE,MAAM,IAAI,mBAAmB,EAAE,CAAA;IAE3D,MAAM,IAAI,GAAG,OAAO,CAAC,EAAE,EAAE,EAAE,CAAA;IAC3B,MAAM,EACJ,sBAAsB,GAAG;QACvB,kBAAkB,EAAE,IAAI;QACxB,WAAW,EAAE,UAAU;KACxB,EACD,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,EAC1B,QAAQ,EACR,UAAU,EACV,KAAK,EACL,GAAG,EACH,OAAO,EACP,GAAG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,CAAC,SAAgB;IACjD,IAAI,GAAG,mCAAmC,CAAA;IAE5D,YAAY,EAAE,KAAK,KAAoC,EAAE;QACvD,KAAK,CAAC,+BAA+B,EAAE;YACrC,KAAK;SACN,CAAC,CAAA;IACJ,CAAC;CACF"}
|
|
@@ -12,9 +12,9 @@ export declare const createChallenge: Uint8Array;
|
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
14
|
* ```ts twoslash
|
|
15
|
-
* import {
|
|
15
|
+
* import { WebAuthn } from 'ox'
|
|
16
16
|
*
|
|
17
|
-
* const credential = await
|
|
17
|
+
* const credential = await WebAuthn.createCredential({
|
|
18
18
|
* name: 'Example'
|
|
19
19
|
* }) // [!code focus]
|
|
20
20
|
* // @log: {
|
|
@@ -23,7 +23,7 @@ export declare const createChallenge: Uint8Array;
|
|
|
23
23
|
* // @log: raw: PublicKeyCredential {},
|
|
24
24
|
* // @log: }
|
|
25
25
|
*
|
|
26
|
-
* const { metadata, signature } = await
|
|
26
|
+
* const { metadata, signature } = await WebAuthn.sign({
|
|
27
27
|
* credentialId: credential.id,
|
|
28
28
|
* challenge: '0xdeadbeef'
|
|
29
29
|
* })
|
|
@@ -39,27 +39,25 @@ export declare namespace createCredential {
|
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
41
|
* Gets the authenticator data which contains information about the
|
|
42
|
-
* processing of an authenticator request (ie. from `
|
|
42
|
+
* processing of an authenticator request (ie. from `WebAuthn.sign`).
|
|
43
43
|
*
|
|
44
44
|
* :::warning
|
|
45
45
|
*
|
|
46
46
|
* This function is mainly for testing purposes or for manually constructing
|
|
47
47
|
* autenticator data. In most cases you will not need this function.
|
|
48
48
|
* `authenticatorData` is typically returned as part of the
|
|
49
|
-
* {@link ox#
|
|
49
|
+
* {@link ox#WebAuthn.(sign:function)} response (ie. an authenticator response).
|
|
50
50
|
*
|
|
51
51
|
* :::
|
|
52
52
|
*
|
|
53
53
|
* @example
|
|
54
54
|
* ```ts twoslash
|
|
55
|
-
* import {
|
|
55
|
+
* import { WebAuthn } from 'ox'
|
|
56
56
|
*
|
|
57
|
-
* const authenticatorData =
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* }
|
|
62
|
-
* )
|
|
57
|
+
* const authenticatorData = WebAuthn.getAuthenticatorData({
|
|
58
|
+
* rpId: 'example.com',
|
|
59
|
+
* signCount: 420
|
|
60
|
+
* })
|
|
63
61
|
* // @log: "0xa379a6f6eeafb9a55e378c118034e2751e682fab9f2d30ab13d2125586ce194705000001a4"
|
|
64
62
|
* ```
|
|
65
63
|
*
|
|
@@ -69,20 +67,18 @@ export declare namespace createCredential {
|
|
|
69
67
|
* Include a credential ID and public key in the authenticator data (for registration responses):
|
|
70
68
|
*
|
|
71
69
|
* ```ts twoslash
|
|
72
|
-
* import { P256,
|
|
70
|
+
* import { P256, WebAuthn } from 'ox'
|
|
73
71
|
*
|
|
74
72
|
* const { publicKey } = P256.createKeyPair()
|
|
75
73
|
*
|
|
76
|
-
* const authenticatorData =
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
* publicKey
|
|
83
|
-
* }
|
|
74
|
+
* const authenticatorData = WebAuthn.getAuthenticatorData({
|
|
75
|
+
* rpId: 'example.com',
|
|
76
|
+
* flag: 0x41, // UP + AT
|
|
77
|
+
* credential: {
|
|
78
|
+
* id: new Uint8Array(32),
|
|
79
|
+
* publicKey
|
|
84
80
|
* }
|
|
85
|
-
* )
|
|
81
|
+
* })
|
|
86
82
|
* ```
|
|
87
83
|
*
|
|
88
84
|
* @param options - Options to construct the authenticator data.
|
|
@@ -95,22 +91,22 @@ export declare namespace getAuthenticatorData {
|
|
|
95
91
|
}
|
|
96
92
|
/**
|
|
97
93
|
* Constructs the Client Data in stringified JSON format which represents client data that
|
|
98
|
-
* was passed to `credentials.get()` in {@link ox#
|
|
94
|
+
* was passed to `credentials.get()` in {@link ox#WebAuthn.(sign:function)}.
|
|
99
95
|
*
|
|
100
96
|
* :::warning
|
|
101
97
|
*
|
|
102
98
|
* This function is mainly for testing purposes or for manually constructing
|
|
103
99
|
* client data. In most cases you will not need this function.
|
|
104
100
|
* `clientDataJSON` is typically returned as part of the
|
|
105
|
-
* {@link ox#
|
|
101
|
+
* {@link ox#WebAuthn.(sign:function)} response (ie. an authenticator response).
|
|
106
102
|
*
|
|
107
103
|
* :::
|
|
108
104
|
*
|
|
109
105
|
* @example
|
|
110
106
|
* ```ts twoslash
|
|
111
|
-
* import {
|
|
107
|
+
* import { WebAuthn } from 'ox'
|
|
112
108
|
*
|
|
113
|
-
* const clientDataJSON =
|
|
109
|
+
* const clientDataJSON = WebAuthn.getClientDataJSON({
|
|
114
110
|
* challenge: '0xdeadbeef',
|
|
115
111
|
* origin: 'https://example.com'
|
|
116
112
|
* })
|
|
@@ -138,19 +134,17 @@ export declare namespace getClientDataJSON {
|
|
|
138
134
|
*
|
|
139
135
|
* @example
|
|
140
136
|
* ```ts twoslash
|
|
141
|
-
* import { P256,
|
|
137
|
+
* import { P256, WebAuthn } from 'ox'
|
|
142
138
|
*
|
|
143
139
|
* const { publicKey } = P256.createKeyPair()
|
|
144
140
|
*
|
|
145
|
-
* const attestationObject =
|
|
146
|
-
* {
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
* }
|
|
153
|
-
* )
|
|
141
|
+
* const attestationObject = WebAuthn.getAttestationObject({
|
|
142
|
+
* authData: WebAuthn.getAuthenticatorData({
|
|
143
|
+
* rpId: 'example.com',
|
|
144
|
+
* flag: 0x41,
|
|
145
|
+
* credential: { id: new Uint8Array(32), publicKey }
|
|
146
|
+
* })
|
|
147
|
+
* })
|
|
154
148
|
* ```
|
|
155
149
|
*
|
|
156
150
|
* @param options - Options to construct the attestation object.
|
|
@@ -167,9 +161,9 @@ export declare namespace getAttestationObject {
|
|
|
167
161
|
*
|
|
168
162
|
* @example
|
|
169
163
|
* ```ts twoslash
|
|
170
|
-
* import {
|
|
164
|
+
* import { WebAuthn } from 'ox'
|
|
171
165
|
*
|
|
172
|
-
* const options =
|
|
166
|
+
* const options = WebAuthn.getCredentialCreationOptions({
|
|
173
167
|
* name: 'Example'
|
|
174
168
|
* })
|
|
175
169
|
*
|
|
@@ -190,9 +184,9 @@ export declare namespace getCredentialCreationOptions {
|
|
|
190
184
|
*
|
|
191
185
|
* @example
|
|
192
186
|
* ```ts twoslash
|
|
193
|
-
* import {
|
|
187
|
+
* import { WebAuthn } from 'ox'
|
|
194
188
|
*
|
|
195
|
-
* const options =
|
|
189
|
+
* const options = WebAuthn.getCredentialRequestOptions({
|
|
196
190
|
* challenge: '0xdeadbeef'
|
|
197
191
|
* })
|
|
198
192
|
*
|
|
@@ -218,15 +212,15 @@ export declare namespace getCredentialRequestOptions {
|
|
|
218
212
|
*
|
|
219
213
|
* This function is mainly for testing purposes or for manually constructing
|
|
220
214
|
* signing payloads. In most cases you will not need this function and
|
|
221
|
-
* instead use {@link ox#
|
|
215
|
+
* instead use {@link ox#WebAuthn.(sign:function)}.
|
|
222
216
|
*
|
|
223
217
|
* :::
|
|
224
218
|
*
|
|
225
219
|
* @example
|
|
226
220
|
* ```ts twoslash
|
|
227
|
-
* import {
|
|
221
|
+
* import { WebAuthn, WebCryptoP256 } from 'ox'
|
|
228
222
|
*
|
|
229
|
-
* const { metadata, payload } =
|
|
223
|
+
* const { metadata, payload } = WebAuthn.getSignPayload({
|
|
230
224
|
* // [!code focus]
|
|
231
225
|
* challenge: '0xdeadbeef' // [!code focus]
|
|
232
226
|
* }) // [!code focus]
|
|
@@ -266,13 +260,13 @@ export declare namespace getSignPayload {
|
|
|
266
260
|
*
|
|
267
261
|
* @example
|
|
268
262
|
* ```ts twoslash
|
|
269
|
-
* import {
|
|
263
|
+
* import { WebAuthn } from 'ox'
|
|
270
264
|
*
|
|
271
|
-
* const credential = await
|
|
265
|
+
* const credential = await WebAuthn.createCredential({
|
|
272
266
|
* name: 'Example'
|
|
273
267
|
* })
|
|
274
268
|
*
|
|
275
|
-
* const { metadata, signature } = await
|
|
269
|
+
* const { metadata, signature } = await WebAuthn.sign({
|
|
276
270
|
* // [!code focus]
|
|
277
271
|
* credentialId: credential.id, // [!code focus]
|
|
278
272
|
* challenge: '0xdeadbeef' // [!code focus]
|
|
@@ -303,18 +297,18 @@ export declare namespace sign {
|
|
|
303
297
|
*
|
|
304
298
|
* @example
|
|
305
299
|
* ```ts twoslash
|
|
306
|
-
* import {
|
|
300
|
+
* import { WebAuthn } from 'ox'
|
|
307
301
|
*
|
|
308
|
-
* const credential = await
|
|
302
|
+
* const credential = await WebAuthn.createCredential({
|
|
309
303
|
* name: 'Example'
|
|
310
304
|
* })
|
|
311
305
|
*
|
|
312
|
-
* const { metadata, signature } = await
|
|
306
|
+
* const { metadata, signature } = await WebAuthn.sign({
|
|
313
307
|
* credentialId: credential.id,
|
|
314
308
|
* challenge: '0xdeadbeef'
|
|
315
309
|
* })
|
|
316
310
|
*
|
|
317
|
-
* const result = await
|
|
311
|
+
* const result = await WebAuthn.verify({
|
|
318
312
|
* // [!code focus]
|
|
319
313
|
* metadata, // [!code focus]
|
|
320
314
|
* challenge: '0xdeadbeef', // [!code focus]
|
|
@@ -333,4 +327,6 @@ export declare namespace verify {
|
|
|
333
327
|
type ErrorType = Authentication.verify.ErrorType;
|
|
334
328
|
}
|
|
335
329
|
export type { AttestationConveyancePreference, AuthenticationExtensionsClientInputs, AuthenticatorAttachment, AuthenticatorSelectionCriteria, AuthenticatorTransport, BufferSource, COSEAlgorithmIdentifier, Credential, CredentialCreationOptions, CredentialMediationRequirement, CredentialRequestOptions, LargeBlobSupport, PrfExtension, PublicKeyCredential, PublicKeyCredentialCreationOptions, PublicKeyCredentialDescriptor, PublicKeyCredentialEntity, PublicKeyCredentialParameters, PublicKeyCredentialRequestOptions, PublicKeyCredentialRpEntity, PublicKeyCredentialType, PublicKeyCredentialUserEntity, ResidentKeyRequirement, UserVerificationRequirement, } from '../webauthn/Types.js';
|
|
330
|
+
/** @deprecated Use `WebAuthn` instead. */
|
|
331
|
+
declare module './WebAuthnP256.js' { }
|
|
336
332
|
//# sourceMappingURL=WebAuthnP256.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebAuthnP256.d.ts","sourceRoot":"","sources":["../../src/core/WebAuthnP256.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,+BAA+B,CAAA;AAC/D,OAAO,KAAK,aAAa,MAAM,8BAA8B,CAAA;AAC7D,OAAO,KAAK,KAAK,WAAW,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,YAAY,MAAM,6BAA6B,CAAA;AAE3D,2CAA2C;AAC3C,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,UAAU,CAAA;AAEnD,8CAA8C;AAC9C,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC,YAAY,CAAA;AAEnD,eAAO,MAAM,eAAe,YAA+B,CAAA;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,gBAAgB,CAAC,OAAO,GAChC,OAAO,CAAC,cAAc,CAAC,CAEzB;AAED,MAAM,CAAC,OAAO,WAAW,gBAAgB,CAAC;IACxC,KAAK,OAAO,GAAG,YAAY,CAAC,MAAM,CAAC,OAAO,CAAA;IAC1C,KAAK,SAAS,GAAG,YAAY,CAAC,MAAM,CAAC,SAAS,CAAA;CAC/C;AAED
|
|
1
|
+
{"version":3,"file":"WebAuthnP256.d.ts","sourceRoot":"","sources":["../../src/core/WebAuthnP256.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,+BAA+B,CAAA;AAC/D,OAAO,KAAK,aAAa,MAAM,8BAA8B,CAAA;AAC7D,OAAO,KAAK,KAAK,WAAW,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,YAAY,MAAM,6BAA6B,CAAA;AAE3D,2C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