@metamask-previews/passkey-controller 3.1.0-preview-4f4c98e → 3.1.0-preview-eb263b0ee
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 +0 -1
- package/dist/PasskeyController-method-action-types.cjs +7 -0
- package/dist/PasskeyController-method-action-types.cjs.map +1 -0
- package/dist/{PasskeyController-method-action-types.d.ts → PasskeyController-method-action-types.d.cts} +2 -2
- package/dist/PasskeyController-method-action-types.d.cts.map +1 -0
- package/dist/PasskeyController-method-action-types.d.mts +204 -0
- package/dist/PasskeyController-method-action-types.d.mts.map +1 -0
- package/dist/{PasskeyController-method-action-types.js → PasskeyController-method-action-types.mjs} +1 -1
- package/dist/PasskeyController-method-action-types.mjs.map +1 -0
- package/dist/PasskeyController.cjs +685 -0
- package/dist/PasskeyController.cjs.map +1 -0
- package/dist/{PasskeyController.d.ts → PasskeyController.d.cts} +6 -6
- package/dist/PasskeyController.d.cts.map +1 -0
- package/dist/PasskeyController.d.mts +208 -0
- package/dist/PasskeyController.d.mts.map +1 -0
- package/dist/{PasskeyController.js → PasskeyController.mjs} +15 -15
- package/dist/PasskeyController.mjs.map +1 -0
- package/dist/ceremony-manager.cjs +135 -0
- package/dist/ceremony-manager.cjs.map +1 -0
- package/dist/{ceremony-manager.d.ts → ceremony-manager.d.cts} +2 -2
- package/dist/ceremony-manager.d.cts.map +1 -0
- package/dist/ceremony-manager.d.mts +72 -0
- package/dist/ceremony-manager.d.mts.map +1 -0
- package/dist/{ceremony-manager.js → ceremony-manager.mjs} +1 -1
- package/dist/ceremony-manager.mjs.map +1 -0
- package/dist/constants.cjs +39 -0
- package/dist/constants.cjs.map +1 -0
- package/dist/{constants.d.ts → constants.d.cts} +12 -12
- package/dist/constants.d.cts.map +1 -0
- package/dist/constants.d.mts +36 -0
- package/dist/constants.d.mts.map +1 -0
- package/dist/{constants.js → constants.mjs} +1 -1
- package/dist/constants.mjs.map +1 -0
- package/dist/errors.cjs +57 -0
- package/dist/errors.cjs.map +1 -0
- package/dist/{errors.d.ts → errors.d.cts} +2 -2
- package/dist/errors.d.cts.map +1 -0
- package/dist/errors.d.mts +34 -0
- package/dist/errors.d.mts.map +1 -0
- package/dist/{errors.js → errors.mjs} +1 -1
- package/dist/errors.mjs.map +1 -0
- package/dist/index.cjs +15 -0
- package/dist/index.cjs.map +1 -0
- package/dist/{index.d.ts → index.d.cts} +8 -8
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +8 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +5 -0
- package/dist/index.mjs.map +1 -0
- package/dist/key-derivation.cjs +44 -0
- package/dist/key-derivation.cjs.map +1 -0
- package/dist/{key-derivation.d.ts → key-derivation.d.cts} +3 -3
- package/dist/key-derivation.d.cts.map +1 -0
- package/dist/key-derivation.d.mts +20 -0
- package/dist/key-derivation.d.mts.map +1 -0
- package/dist/{key-derivation.js → key-derivation.mjs} +5 -5
- package/dist/key-derivation.mjs.map +1 -0
- package/dist/logger.cjs +9 -0
- package/dist/logger.cjs.map +1 -0
- package/dist/logger.d.cts +5 -0
- package/dist/logger.d.cts.map +1 -0
- package/dist/logger.d.mts +5 -0
- package/dist/logger.d.mts.map +1 -0
- package/dist/logger.mjs +6 -0
- package/dist/logger.mjs.map +1 -0
- package/dist/types.cjs +4 -0
- package/dist/types.cjs.map +1 -0
- package/dist/{types.d.ts → types.d.cts} +6 -6
- package/dist/types.d.cts.map +1 -0
- package/dist/types.d.mts +132 -0
- package/dist/types.d.mts.map +1 -0
- package/dist/types.mjs +2 -0
- package/dist/types.mjs.map +1 -0
- package/dist/utils/crypto.cjs +66 -0
- package/dist/utils/crypto.cjs.map +1 -0
- package/dist/utils/{crypto.d.ts → crypto.d.cts} +1 -1
- package/dist/utils/crypto.d.cts.map +1 -0
- package/dist/utils/crypto.d.mts +37 -0
- package/dist/utils/crypto.d.mts.map +1 -0
- package/dist/utils/{crypto.js → crypto.mjs} +7 -7
- package/dist/utils/crypto.mjs.map +1 -0
- package/dist/utils/encoding.cjs +42 -0
- package/dist/utils/encoding.cjs.map +1 -0
- package/dist/utils/{encoding.d.ts → encoding.d.cts} +1 -1
- package/dist/utils/encoding.d.cts.map +1 -0
- package/dist/utils/encoding.d.mts +22 -0
- package/dist/utils/encoding.d.mts.map +1 -0
- package/dist/utils/{encoding.js → encoding.mjs} +2 -2
- package/dist/utils/encoding.mjs.map +1 -0
- package/dist/webauthn/constants.cjs +74 -0
- package/dist/webauthn/constants.cjs.map +1 -0
- package/dist/webauthn/{constants.d.ts → constants.d.cts} +1 -1
- package/dist/webauthn/constants.d.cts.map +1 -0
- package/dist/webauthn/constants.d.mts +68 -0
- package/dist/webauthn/constants.d.mts.map +1 -0
- package/dist/webauthn/{constants.js → constants.mjs} +1 -1
- package/dist/webauthn/constants.mjs.map +1 -0
- package/dist/webauthn/decode-attestation-object.cjs +18 -0
- package/dist/webauthn/decode-attestation-object.cjs.map +1 -0
- package/dist/webauthn/{decode-attestation-object.d.ts → decode-attestation-object.d.cts} +2 -2
- package/dist/webauthn/decode-attestation-object.d.cts.map +1 -0
- package/dist/webauthn/decode-attestation-object.d.mts +10 -0
- package/dist/webauthn/decode-attestation-object.d.mts.map +1 -0
- package/dist/webauthn/{decode-attestation-object.js → decode-attestation-object.mjs} +2 -2
- package/dist/webauthn/decode-attestation-object.mjs.map +1 -0
- package/dist/webauthn/decode-client-data-json.cjs +17 -0
- package/dist/webauthn/decode-client-data-json.cjs.map +1 -0
- package/dist/webauthn/{decode-client-data-json.d.ts → decode-client-data-json.d.cts} +2 -2
- package/dist/webauthn/decode-client-data-json.d.cts.map +1 -0
- package/dist/webauthn/decode-client-data-json.d.mts +9 -0
- package/dist/webauthn/decode-client-data-json.d.mts.map +1 -0
- package/dist/webauthn/{decode-client-data-json.js → decode-client-data-json.mjs} +2 -2
- package/dist/webauthn/decode-client-data-json.mjs.map +1 -0
- package/dist/webauthn/match-expected-rp-id.cjs +26 -0
- package/dist/webauthn/match-expected-rp-id.cjs.map +1 -0
- package/dist/webauthn/{match-expected-rp-id.d.ts → match-expected-rp-id.d.cts} +1 -1
- package/dist/webauthn/match-expected-rp-id.d.cts.map +1 -0
- package/dist/webauthn/match-expected-rp-id.d.mts +11 -0
- package/dist/webauthn/match-expected-rp-id.d.mts.map +1 -0
- package/dist/webauthn/{match-expected-rp-id.js → match-expected-rp-id.mjs} +4 -4
- package/dist/webauthn/match-expected-rp-id.mjs.map +1 -0
- package/dist/webauthn/parse-authenticator-data.cjs +69 -0
- package/dist/webauthn/parse-authenticator-data.cjs.map +1 -0
- package/dist/webauthn/{parse-authenticator-data.d.ts → parse-authenticator-data.d.cts} +2 -2
- package/dist/webauthn/parse-authenticator-data.d.cts.map +1 -0
- package/dist/webauthn/parse-authenticator-data.d.mts +10 -0
- package/dist/webauthn/parse-authenticator-data.d.mts.map +1 -0
- package/dist/webauthn/{parse-authenticator-data.js → parse-authenticator-data.mjs} +2 -2
- package/dist/webauthn/parse-authenticator-data.mjs.map +1 -0
- package/dist/webauthn/types.cjs +3 -0
- package/dist/webauthn/types.cjs.map +1 -0
- package/dist/webauthn/{types.d.ts → types.d.cts} +2 -2
- package/dist/webauthn/types.d.cts.map +1 -0
- package/dist/webauthn/types.d.mts +113 -0
- package/dist/webauthn/types.d.mts.map +1 -0
- package/dist/webauthn/types.mjs +2 -0
- package/dist/webauthn/types.mjs.map +1 -0
- package/dist/webauthn/verify-authentication-response.cjs +133 -0
- package/dist/webauthn/verify-authentication-response.cjs.map +1 -0
- package/dist/webauthn/{verify-authentication-response.d.ts → verify-authentication-response.d.cts} +3 -3
- package/dist/webauthn/verify-authentication-response.d.cts.map +1 -0
- package/dist/webauthn/verify-authentication-response.d.mts +64 -0
- package/dist/webauthn/verify-authentication-response.d.mts.map +1 -0
- package/dist/webauthn/{verify-authentication-response.js → verify-authentication-response.mjs} +9 -9
- package/dist/webauthn/verify-authentication-response.mjs.map +1 -0
- package/dist/webauthn/verify-registration-response.cjs +242 -0
- package/dist/webauthn/verify-registration-response.cjs.map +1 -0
- package/dist/webauthn/{verify-registration-response.d.ts → verify-registration-response.d.cts} +3 -3
- package/dist/webauthn/verify-registration-response.d.cts.map +1 -0
- package/dist/webauthn/verify-registration-response.d.mts +81 -0
- package/dist/webauthn/verify-registration-response.d.mts.map +1 -0
- package/dist/webauthn/{verify-registration-response.js → verify-registration-response.mjs} +11 -11
- package/dist/webauthn/verify-registration-response.mjs.map +1 -0
- package/dist/webauthn/verify-signature.cjs +176 -0
- package/dist/webauthn/verify-signature.cjs.map +1 -0
- package/dist/webauthn/{verify-signature.d.ts → verify-signature.d.cts} +1 -1
- package/dist/webauthn/verify-signature.d.cts.map +1 -0
- package/dist/webauthn/verify-signature.d.mts +21 -0
- package/dist/webauthn/verify-signature.d.mts.map +1 -0
- package/dist/webauthn/{verify-signature.js → verify-signature.mjs} +7 -7
- package/dist/webauthn/verify-signature.mjs.map +1 -0
- package/package.json +17 -12
- package/dist/PasskeyController-method-action-types.d.ts.map +0 -1
- package/dist/PasskeyController-method-action-types.js.map +0 -1
- package/dist/PasskeyController.d.ts.map +0 -1
- package/dist/PasskeyController.js.map +0 -1
- package/dist/ceremony-manager.d.ts.map +0 -1
- package/dist/ceremony-manager.js.map +0 -1
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js.map +0 -1
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -5
- package/dist/index.js.map +0 -1
- package/dist/key-derivation.d.ts.map +0 -1
- package/dist/key-derivation.js.map +0 -1
- package/dist/logger.d.ts +0 -4
- package/dist/logger.d.ts.map +0 -1
- package/dist/logger.js +0 -6
- package/dist/logger.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
- package/dist/utils/crypto.d.ts.map +0 -1
- package/dist/utils/crypto.js.map +0 -1
- package/dist/utils/encoding.d.ts.map +0 -1
- package/dist/utils/encoding.js.map +0 -1
- package/dist/webauthn/constants.d.ts.map +0 -1
- package/dist/webauthn/constants.js.map +0 -1
- package/dist/webauthn/decode-attestation-object.d.ts.map +0 -1
- package/dist/webauthn/decode-attestation-object.js.map +0 -1
- package/dist/webauthn/decode-client-data-json.d.ts.map +0 -1
- package/dist/webauthn/decode-client-data-json.js.map +0 -1
- package/dist/webauthn/match-expected-rp-id.d.ts.map +0 -1
- package/dist/webauthn/match-expected-rp-id.js.map +0 -1
- package/dist/webauthn/parse-authenticator-data.d.ts.map +0 -1
- package/dist/webauthn/parse-authenticator-data.js.map +0 -1
- package/dist/webauthn/types.d.ts.map +0 -1
- package/dist/webauthn/types.js +0 -2
- package/dist/webauthn/types.js.map +0 -1
- package/dist/webauthn/verify-authentication-response.d.ts.map +0 -1
- package/dist/webauthn/verify-authentication-response.js.map +0 -1
- package/dist/webauthn/verify-registration-response.d.ts.map +0 -1
- package/dist/webauthn/verify-registration-response.js.map +0 -1
- package/dist/webauthn/verify-signature.d.ts.map +0 -1
- package/dist/webauthn/verify-signature.js.map +0 -1
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
5
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
+
};
|
|
7
|
+
var _CeremonyManager_instances, _CeremonyManager_registrationMap, _CeremonyManager_authenticationMap, _CeremonyManager_getMap, _CeremonyManager_pruneExpired, _CeremonyManager_enforceCapacity;
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.CeremonyManager = exports.MAX_CONCURRENT_PASSKEY_CEREMONIES = exports.CEREMONY_MAX_AGE_MS = exports.CEREMONY_TTL_SLACK_MS = exports.WEBAUTHN_TIMEOUT_MS = void 0;
|
|
10
|
+
/** WebAuthn `timeout` for credential creation and assertion (ms). */
|
|
11
|
+
exports.WEBAUTHN_TIMEOUT_MS = 60000;
|
|
12
|
+
/**
|
|
13
|
+
* Extra allowance beyond {@link WEBAUTHN_TIMEOUT_MS} before in-memory
|
|
14
|
+
* ceremony state is discarded (covers slow UX, multi-step enrollment, and
|
|
15
|
+
* clock skew).
|
|
16
|
+
*/
|
|
17
|
+
exports.CEREMONY_TTL_SLACK_MS = 120000;
|
|
18
|
+
/**
|
|
19
|
+
* Maximum age for in-flight registration or authentication ceremony state
|
|
20
|
+
* (between options and verified response). This bounds the lifetime of a
|
|
21
|
+
* single WebAuthn ceremony only; it is not a user login session timeout.
|
|
22
|
+
*/
|
|
23
|
+
exports.CEREMONY_MAX_AGE_MS = exports.WEBAUTHN_TIMEOUT_MS + exports.CEREMONY_TTL_SLACK_MS;
|
|
24
|
+
/**
|
|
25
|
+
* Upper bound on concurrent in-memory ceremonies per flow type (registration
|
|
26
|
+
* vs authentication), for abuse / leak protection.
|
|
27
|
+
*/
|
|
28
|
+
exports.MAX_CONCURRENT_PASSKEY_CEREMONIES = 16;
|
|
29
|
+
/**
|
|
30
|
+
* In-memory store for in-flight WebAuthn ceremonies (registration vs authentication),
|
|
31
|
+
* keyed by base64url challenge. Enforces TTL and a per-flow size cap; not user session state.
|
|
32
|
+
*/
|
|
33
|
+
class CeremonyManager {
|
|
34
|
+
constructor() {
|
|
35
|
+
_CeremonyManager_instances.add(this);
|
|
36
|
+
_CeremonyManager_registrationMap.set(this, new Map());
|
|
37
|
+
_CeremonyManager_authenticationMap.set(this, new Map());
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Records registration ceremony state after pruning expired rows and evicting oldest if at cap.
|
|
41
|
+
*
|
|
42
|
+
* @param challenge - Same base64url challenge as in the creation options `challenge` field.
|
|
43
|
+
* @param ceremony - Payload to retrieve when the registration response returns.
|
|
44
|
+
*/
|
|
45
|
+
saveRegistrationCeremony(challenge, ceremony) {
|
|
46
|
+
__classPrivateFieldGet(this, _CeremonyManager_instances, "m", _CeremonyManager_pruneExpired).call(this, 'registration');
|
|
47
|
+
__classPrivateFieldGet(this, _CeremonyManager_instances, "m", _CeremonyManager_enforceCapacity).call(this, 'registration');
|
|
48
|
+
__classPrivateFieldGet(this, _CeremonyManager_registrationMap, "f").set(challenge, ceremony);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Records authentication ceremony state after pruning expired rows and evicting oldest if at cap.
|
|
52
|
+
*
|
|
53
|
+
* @param challenge - Same base64url challenge as in the request options `challenge` field.
|
|
54
|
+
* @param ceremony - Payload to retrieve when the assertion response returns.
|
|
55
|
+
*/
|
|
56
|
+
saveAuthenticationCeremony(challenge, ceremony) {
|
|
57
|
+
__classPrivateFieldGet(this, _CeremonyManager_instances, "m", _CeremonyManager_pruneExpired).call(this, 'authentication');
|
|
58
|
+
__classPrivateFieldGet(this, _CeremonyManager_instances, "m", _CeremonyManager_enforceCapacity).call(this, 'authentication');
|
|
59
|
+
__classPrivateFieldGet(this, _CeremonyManager_authenticationMap, "f").set(challenge, ceremony);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Returns registration ceremony for a challenge, pruning expired entries on this map first.
|
|
63
|
+
*
|
|
64
|
+
* @param challenge - Base64url challenge from decoded `clientDataJSON` (matches stored key).
|
|
65
|
+
* @returns Stored ceremony, or `undefined` if none or expired.
|
|
66
|
+
*/
|
|
67
|
+
getRegistrationCeremony(challenge) {
|
|
68
|
+
__classPrivateFieldGet(this, _CeremonyManager_instances, "m", _CeremonyManager_pruneExpired).call(this, 'registration');
|
|
69
|
+
return __classPrivateFieldGet(this, _CeremonyManager_registrationMap, "f").get(challenge);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Returns authentication ceremony for a challenge, pruning expired entries on this map first.
|
|
73
|
+
*
|
|
74
|
+
* @param challenge - Base64url challenge from decoded `clientDataJSON` (matches stored key).
|
|
75
|
+
* @returns Stored ceremony, or `undefined` if none or expired.
|
|
76
|
+
*/
|
|
77
|
+
getAuthenticationCeremony(challenge) {
|
|
78
|
+
__classPrivateFieldGet(this, _CeremonyManager_instances, "m", _CeremonyManager_pruneExpired).call(this, 'authentication');
|
|
79
|
+
return __classPrivateFieldGet(this, _CeremonyManager_authenticationMap, "f").get(challenge);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Removes a registration ceremony by challenge.
|
|
83
|
+
*
|
|
84
|
+
* @param challenge - Map key for the ceremony to remove.
|
|
85
|
+
* @returns Whether an entry was deleted.
|
|
86
|
+
*/
|
|
87
|
+
deleteRegistrationCeremony(challenge) {
|
|
88
|
+
return __classPrivateFieldGet(this, _CeremonyManager_registrationMap, "f").delete(challenge);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Removes an authentication ceremony by challenge.
|
|
92
|
+
*
|
|
93
|
+
* @param challenge - Map key for the ceremony to remove.
|
|
94
|
+
* @returns Whether an entry was deleted.
|
|
95
|
+
*/
|
|
96
|
+
deleteAuthenticationCeremony(challenge) {
|
|
97
|
+
return __classPrivateFieldGet(this, _CeremonyManager_authenticationMap, "f").delete(challenge);
|
|
98
|
+
}
|
|
99
|
+
/** Drops all in-flight registration and authentication ceremonies. */
|
|
100
|
+
clear() {
|
|
101
|
+
__classPrivateFieldGet(this, _CeremonyManager_registrationMap, "f").clear();
|
|
102
|
+
__classPrivateFieldGet(this, _CeremonyManager_authenticationMap, "f").clear();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
exports.CeremonyManager = CeremonyManager;
|
|
106
|
+
_CeremonyManager_registrationMap = new WeakMap(), _CeremonyManager_authenticationMap = new WeakMap(), _CeremonyManager_instances = new WeakSet(), _CeremonyManager_getMap = function _CeremonyManager_getMap(ceremonyType) {
|
|
107
|
+
return ceremonyType === 'registration'
|
|
108
|
+
? __classPrivateFieldGet(this, _CeremonyManager_registrationMap, "f")
|
|
109
|
+
: __classPrivateFieldGet(this, _CeremonyManager_authenticationMap, "f");
|
|
110
|
+
}, _CeremonyManager_pruneExpired = function _CeremonyManager_pruneExpired(ceremonyType) {
|
|
111
|
+
const now = Date.now();
|
|
112
|
+
const map = __classPrivateFieldGet(this, _CeremonyManager_instances, "m", _CeremonyManager_getMap).call(this, ceremonyType);
|
|
113
|
+
for (const [key, ceremony] of map) {
|
|
114
|
+
if (now - ceremony.createdAt > exports.CEREMONY_MAX_AGE_MS) {
|
|
115
|
+
map.delete(key);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}, _CeremonyManager_enforceCapacity = function _CeremonyManager_enforceCapacity(ceremonyType) {
|
|
119
|
+
const map = __classPrivateFieldGet(this, _CeremonyManager_instances, "m", _CeremonyManager_getMap).call(this, ceremonyType);
|
|
120
|
+
while (map.size >= exports.MAX_CONCURRENT_PASSKEY_CEREMONIES) {
|
|
121
|
+
let oldestKey;
|
|
122
|
+
let oldestTime = Infinity;
|
|
123
|
+
for (const [mapKey, ceremony] of map) {
|
|
124
|
+
if (ceremony.createdAt < oldestTime) {
|
|
125
|
+
oldestTime = ceremony.createdAt;
|
|
126
|
+
oldestKey = mapKey;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
if (oldestKey === undefined) {
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
map.delete(oldestKey);
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
//# sourceMappingURL=ceremony-manager.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ceremony-manager.cjs","sourceRoot":"","sources":["../src/ceremony-manager.ts"],"names":[],"mappings":";;;;;;;;;AAKA,qEAAqE;AACxD,QAAA,mBAAmB,GAAG,KAAM,CAAC;AAE1C;;;;GAIG;AACU,QAAA,qBAAqB,GAAG,MAAO,CAAC;AAE7C;;;;GAIG;AACU,QAAA,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QAAQ,CAAC,SAAS,CAAC;gBAChC,SAAS,GAAG,MAAM,CAAC;YACrB,CAAC;QACH,CAAC;QACD,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC5B,MAAM;QACR,CAAC;QACD,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACxB,CAAC;AACH,CAAC","sourcesContent":["import type {\n PasskeyAuthenticationCeremony,\n PasskeyRegistrationCeremony,\n} from './types.js';\n\n/** WebAuthn `timeout` for credential creation and assertion (ms). */\nexport const WEBAUTHN_TIMEOUT_MS = 60_000;\n\n/**\n * Extra allowance beyond {@link WEBAUTHN_TIMEOUT_MS} before in-memory\n * ceremony state is discarded (covers slow UX, multi-step enrollment, and\n * clock skew).\n */\nexport const CEREMONY_TTL_SLACK_MS = 120_000;\n\n/**\n * Maximum age for in-flight registration or authentication ceremony state\n * (between options and verified response). This bounds the lifetime of a\n * single WebAuthn ceremony only; it is not a user login session timeout.\n */\nexport const CEREMONY_MAX_AGE_MS = WEBAUTHN_TIMEOUT_MS + CEREMONY_TTL_SLACK_MS;\n\n/**\n * Upper bound on concurrent in-memory ceremonies per flow type (registration\n * vs authentication), for abuse / leak protection.\n */\nexport const MAX_CONCURRENT_PASSKEY_CEREMONIES = 16;\n\ntype CeremonyFlow = 'registration' | 'authentication';\n\n/**\n * In-memory store for in-flight WebAuthn ceremonies (registration vs authentication),\n * keyed by base64url challenge. Enforces TTL and a per-flow size cap; not user session state.\n */\nexport class CeremonyManager {\n readonly #registrationMap = new Map<string, PasskeyRegistrationCeremony>();\n\n readonly #authenticationMap = new Map<\n string,\n PasskeyAuthenticationCeremony\n >();\n\n /**\n * Challenge-keyed map for prune/capacity helpers.\n *\n * @param ceremonyType - Which in-flight ceremony map to use.\n * @returns The registration or authentication ceremony map for the given flow.\n */\n #getMap(\n ceremonyType: CeremonyFlow,\n ): Map<string, PasskeyRegistrationCeremony | PasskeyAuthenticationCeremony> {\n return ceremonyType === 'registration'\n ? this.#registrationMap\n : this.#authenticationMap;\n }\n\n #pruneExpired(ceremonyType: CeremonyFlow): void {\n const now = Date.now();\n const map = this.#getMap(ceremonyType);\n for (const [key, ceremony] of map) {\n if (now - ceremony.createdAt > CEREMONY_MAX_AGE_MS) {\n map.delete(key);\n }\n }\n }\n\n /**\n * Removes the oldest entry (by `createdAt`) until size is below the cap.\n *\n * @param ceremonyType - Which in-flight ceremony map to evict from.\n */\n #enforceCapacity(ceremonyType: CeremonyFlow): void {\n const map = this.#getMap(ceremonyType);\n while (map.size >= MAX_CONCURRENT_PASSKEY_CEREMONIES) {\n let oldestKey: string | undefined;\n let oldestTime = Infinity;\n for (const [mapKey, ceremony] of map) {\n if (ceremony.createdAt < oldestTime) {\n oldestTime = ceremony.createdAt;\n oldestKey = mapKey;\n }\n }\n if (oldestKey === undefined) {\n break;\n }\n map.delete(oldestKey);\n }\n }\n\n /**\n * Records registration ceremony state after pruning expired rows and evicting oldest if at cap.\n *\n * @param challenge - Same base64url challenge as in the creation options `challenge` field.\n * @param ceremony - Payload to retrieve when the registration response returns.\n */\n saveRegistrationCeremony(\n challenge: string,\n ceremony: PasskeyRegistrationCeremony,\n ): void {\n this.#pruneExpired('registration');\n this.#enforceCapacity('registration');\n this.#registrationMap.set(challenge, ceremony);\n }\n\n /**\n * Records authentication ceremony state after pruning expired rows and evicting oldest if at cap.\n *\n * @param challenge - Same base64url challenge as in the request options `challenge` field.\n * @param ceremony - Payload to retrieve when the assertion response returns.\n */\n saveAuthenticationCeremony(\n challenge: string,\n ceremony: PasskeyAuthenticationCeremony,\n ): void {\n this.#pruneExpired('authentication');\n this.#enforceCapacity('authentication');\n this.#authenticationMap.set(challenge, ceremony);\n }\n\n /**\n * Returns registration ceremony for a challenge, pruning expired entries on this map first.\n *\n * @param challenge - Base64url challenge from decoded `clientDataJSON` (matches stored key).\n * @returns Stored ceremony, or `undefined` if none or expired.\n */\n getRegistrationCeremony(\n challenge: string,\n ): PasskeyRegistrationCeremony | undefined {\n this.#pruneExpired('registration');\n return this.#registrationMap.get(challenge);\n }\n\n /**\n * Returns authentication ceremony for a challenge, pruning expired entries on this map first.\n *\n * @param challenge - Base64url challenge from decoded `clientDataJSON` (matches stored key).\n * @returns Stored ceremony, or `undefined` if none or expired.\n */\n getAuthenticationCeremony(\n challenge: string,\n ): PasskeyAuthenticationCeremony | undefined {\n this.#pruneExpired('authentication');\n return this.#authenticationMap.get(challenge);\n }\n\n /**\n * Removes a registration ceremony by challenge.\n *\n * @param challenge - Map key for the ceremony to remove.\n * @returns Whether an entry was deleted.\n */\n deleteRegistrationCeremony(challenge: string): boolean {\n return this.#registrationMap.delete(challenge);\n }\n\n /**\n * Removes an authentication ceremony by challenge.\n *\n * @param challenge - Map key for the ceremony to remove.\n * @returns Whether an entry was deleted.\n */\n deleteAuthenticationCeremony(challenge: string): boolean {\n return this.#authenticationMap.delete(challenge);\n }\n\n /** Drops all in-flight registration and authentication ceremonies. */\n clear(): void {\n this.#registrationMap.clear();\n this.#authenticationMap.clear();\n }\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PasskeyAuthenticationCeremony, PasskeyRegistrationCeremony } from
|
|
1
|
+
import type { PasskeyAuthenticationCeremony, PasskeyRegistrationCeremony } from "./types.cjs";
|
|
2
2
|
/** WebAuthn `timeout` for credential creation and assertion (ms). */
|
|
3
3
|
export declare const WEBAUTHN_TIMEOUT_MS = 60000;
|
|
4
4
|
/**
|
|
@@ -69,4 +69,4 @@ export declare class CeremonyManager {
|
|
|
69
69
|
/** Drops all in-flight registration and authentication ceremonies. */
|
|
70
70
|
clear(): void;
|
|
71
71
|
}
|
|
72
|
-
//# sourceMappingURL=ceremony-manager.d.
|
|
72
|
+
//# sourceMappingURL=ceremony-manager.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ceremony-manager.d.cts","sourceRoot":"","sources":["../src/ceremony-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,6BAA6B,EAC7B,2BAA2B,EAC5B,oBAAmB;AAEpB,qEAAqE;AACrE,eAAO,MAAM,mBAAmB,QAAS,CAAC;AAE1C;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,SAAU,CAAC;AAE7C;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,QAA8C,CAAC;AAE/E;;;GAGG;AACH,eAAO,MAAM,iCAAiC,KAAK,CAAC;AAIpD;;;GAGG;AACH,qBAAa,eAAe;;IAuD1B;;;;;OAKG;IACH,wBAAwB,CACtB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,2BAA2B,GACpC,IAAI;IAMP;;;;;OAKG;IACH,0BAA0B,CACxB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,6BAA6B,GACtC,IAAI;IAMP;;;;;OAKG;IACH,uBAAuB,CACrB,SAAS,EAAE,MAAM,GAChB,2BAA2B,GAAG,SAAS;IAK1C;;;;;OAKG;IACH,yBAAyB,CACvB,SAAS,EAAE,MAAM,GAChB,6BAA6B,GAAG,SAAS;IAK5C;;;;;OAKG;IACH,0BAA0B,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAItD;;;;;OAKG;IACH,4BAA4B,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAIxD,sEAAsE;IACtE,KAAK,IAAI,IAAI;CAId"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { PasskeyAuthenticationCeremony, PasskeyRegistrationCeremony } from "./types.mjs";
|
|
2
|
+
/** WebAuthn `timeout` for credential creation and assertion (ms). */
|
|
3
|
+
export declare const WEBAUTHN_TIMEOUT_MS = 60000;
|
|
4
|
+
/**
|
|
5
|
+
* Extra allowance beyond {@link WEBAUTHN_TIMEOUT_MS} before in-memory
|
|
6
|
+
* ceremony state is discarded (covers slow UX, multi-step enrollment, and
|
|
7
|
+
* clock skew).
|
|
8
|
+
*/
|
|
9
|
+
export declare const CEREMONY_TTL_SLACK_MS = 120000;
|
|
10
|
+
/**
|
|
11
|
+
* Maximum age for in-flight registration or authentication ceremony state
|
|
12
|
+
* (between options and verified response). This bounds the lifetime of a
|
|
13
|
+
* single WebAuthn ceremony only; it is not a user login session timeout.
|
|
14
|
+
*/
|
|
15
|
+
export declare const CEREMONY_MAX_AGE_MS: number;
|
|
16
|
+
/**
|
|
17
|
+
* Upper bound on concurrent in-memory ceremonies per flow type (registration
|
|
18
|
+
* vs authentication), for abuse / leak protection.
|
|
19
|
+
*/
|
|
20
|
+
export declare const MAX_CONCURRENT_PASSKEY_CEREMONIES = 16;
|
|
21
|
+
/**
|
|
22
|
+
* In-memory store for in-flight WebAuthn ceremonies (registration vs authentication),
|
|
23
|
+
* keyed by base64url challenge. Enforces TTL and a per-flow size cap; not user session state.
|
|
24
|
+
*/
|
|
25
|
+
export declare class CeremonyManager {
|
|
26
|
+
#private;
|
|
27
|
+
/**
|
|
28
|
+
* Records registration ceremony state after pruning expired rows and evicting oldest if at cap.
|
|
29
|
+
*
|
|
30
|
+
* @param challenge - Same base64url challenge as in the creation options `challenge` field.
|
|
31
|
+
* @param ceremony - Payload to retrieve when the registration response returns.
|
|
32
|
+
*/
|
|
33
|
+
saveRegistrationCeremony(challenge: string, ceremony: PasskeyRegistrationCeremony): void;
|
|
34
|
+
/**
|
|
35
|
+
* Records authentication ceremony state after pruning expired rows and evicting oldest if at cap.
|
|
36
|
+
*
|
|
37
|
+
* @param challenge - Same base64url challenge as in the request options `challenge` field.
|
|
38
|
+
* @param ceremony - Payload to retrieve when the assertion response returns.
|
|
39
|
+
*/
|
|
40
|
+
saveAuthenticationCeremony(challenge: string, ceremony: PasskeyAuthenticationCeremony): void;
|
|
41
|
+
/**
|
|
42
|
+
* Returns registration ceremony for a challenge, pruning expired entries on this map first.
|
|
43
|
+
*
|
|
44
|
+
* @param challenge - Base64url challenge from decoded `clientDataJSON` (matches stored key).
|
|
45
|
+
* @returns Stored ceremony, or `undefined` if none or expired.
|
|
46
|
+
*/
|
|
47
|
+
getRegistrationCeremony(challenge: string): PasskeyRegistrationCeremony | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Returns authentication ceremony for a challenge, pruning expired entries on this map first.
|
|
50
|
+
*
|
|
51
|
+
* @param challenge - Base64url challenge from decoded `clientDataJSON` (matches stored key).
|
|
52
|
+
* @returns Stored ceremony, or `undefined` if none or expired.
|
|
53
|
+
*/
|
|
54
|
+
getAuthenticationCeremony(challenge: string): PasskeyAuthenticationCeremony | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* Removes a registration ceremony by challenge.
|
|
57
|
+
*
|
|
58
|
+
* @param challenge - Map key for the ceremony to remove.
|
|
59
|
+
* @returns Whether an entry was deleted.
|
|
60
|
+
*/
|
|
61
|
+
deleteRegistrationCeremony(challenge: string): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Removes an authentication ceremony by challenge.
|
|
64
|
+
*
|
|
65
|
+
* @param challenge - Map key for the ceremony to remove.
|
|
66
|
+
* @returns Whether an entry was deleted.
|
|
67
|
+
*/
|
|
68
|
+
deleteAuthenticationCeremony(challenge: string): boolean;
|
|
69
|
+
/** Drops all in-flight registration and authentication ceremonies. */
|
|
70
|
+
clear(): void;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=ceremony-manager.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ceremony-manager.d.mts","sourceRoot":"","sources":["../src/ceremony-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,6BAA6B,EAC7B,2BAA2B,EAC5B,oBAAmB;AAEpB,qEAAqE;AACrE,eAAO,MAAM,mBAAmB,QAAS,CAAC;AAE1C;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,SAAU,CAAC;AAE7C;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,QAA8C,CAAC;AAE/E;;;GAGG;AACH,eAAO,MAAM,iCAAiC,KAAK,CAAC;AAIpD;;;GAGG;AACH,qBAAa,eAAe;;IAuD1B;;;;;OAKG;IACH,wBAAwB,CACtB,SAAS,EAAE,M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0CAAmB,CAAC;AAC9B,CAAC,yEAEa,YAA0B;IACtC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACvB,MAAM,GAAG,GAAG,uBAAA,IAAI,2DAAQ,MAAZ,IAAI,EAAS,YAAY,CAAC,CAAC;IACvC,KAAK,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC,IAAI,GAAG,EAAE,CAAC;QAClC,IAAI,GAAG,GAAG,QAAQ,CAAC,SAAS,GAAG,mBAAmB,EAAE,CAAC;YACnD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;AACH,CAAC,+EAOgB,YAA0B;IACzC,MAAM,GAAG,GAAG,uBAAA,IAAI,2DAAQ,MAAZ,IAAI,EAAS,YAAY,CAAC,CAAC;IACvC,OAAO,GAAG,CAAC,IAAI,IAAI,iCAAiC,EAAE,CAAC;QACrD,IAAI,SAA6B,CAAC;QAClC,IAAI,UAAU,GAAG,QAAQ,CAAC;QAC1B,KAAK,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,GAAG,EAAE,CAAC;YACrC,IAAI,QAAQ,CAAC,SAAS,GAAG,UAAU,EAAE,CAAC;gBACpC,UAAU,GAAG,QAAQ,CAAC,SAAS,CAAC;gBAChC,SAAS,GAAG,MAAM,CAAC;YACrB,CAAC;QACH,CAAC;QACD,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC5B,MAAM;QACR,CAAC;QACD,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACxB,CAAC;AACH,CAAC","sourcesContent":["import type {\n PasskeyAuthenticationCeremony,\n PasskeyRegistrationCeremony,\n} from './types.js';\n\n/** WebAuthn `timeout` for credential creation and assertion (ms). */\nexport const WEBAUTHN_TIMEOUT_MS = 60_000;\n\n/**\n * Extra allowance beyond {@link WEBAUTHN_TIMEOUT_MS} before in-memory\n * ceremony state is discarded (covers slow UX, multi-step enrollment, and\n * clock skew).\n */\nexport const CEREMONY_TTL_SLACK_MS = 120_000;\n\n/**\n * Maximum age for in-flight registration or authentication ceremony state\n * (between options and verified response). This bounds the lifetime of a\n * single WebAuthn ceremony only; it is not a user login session timeout.\n */\nexport const CEREMONY_MAX_AGE_MS = WEBAUTHN_TIMEOUT_MS + CEREMONY_TTL_SLACK_MS;\n\n/**\n * Upper bound on concurrent in-memory ceremonies per flow type (registration\n * vs authentication), for abuse / leak protection.\n */\nexport const MAX_CONCURRENT_PASSKEY_CEREMONIES = 16;\n\ntype CeremonyFlow = 'registration' | 'authentication';\n\n/**\n * In-memory store for in-flight WebAuthn ceremonies (registration vs authentication),\n * keyed by base64url challenge. Enforces TTL and a per-flow size cap; not user session state.\n */\nexport class CeremonyManager {\n readonly #registrationMap = new Map<string, PasskeyRegistrationCeremony>();\n\n readonly #authenticationMap = new Map<\n string,\n PasskeyAuthenticationCeremony\n >();\n\n /**\n * Challenge-keyed map for prune/capacity helpers.\n *\n * @param ceremonyType - Which in-flight ceremony map to use.\n * @returns The registration or authentication ceremony map for the given flow.\n */\n #getMap(\n ceremonyType: CeremonyFlow,\n ): Map<string, PasskeyRegistrationCeremony | PasskeyAuthenticationCeremony> {\n return ceremonyType === 'registration'\n ? this.#registrationMap\n : this.#authenticationMap;\n }\n\n #pruneExpired(ceremonyType: CeremonyFlow): void {\n const now = Date.now();\n const map = this.#getMap(ceremonyType);\n for (const [key, ceremony] of map) {\n if (now - ceremony.createdAt > CEREMONY_MAX_AGE_MS) {\n map.delete(key);\n }\n }\n }\n\n /**\n * Removes the oldest entry (by `createdAt`) until size is below the cap.\n *\n * @param ceremonyType - Which in-flight ceremony map to evict from.\n */\n #enforceCapacity(ceremonyType: CeremonyFlow): void {\n const map = this.#getMap(ceremonyType);\n while (map.size >= MAX_CONCURRENT_PASSKEY_CEREMONIES) {\n let oldestKey: string | undefined;\n let oldestTime = Infinity;\n for (const [mapKey, ceremony] of map) {\n if (ceremony.createdAt < oldestTime) {\n oldestTime = ceremony.createdAt;\n oldestKey = mapKey;\n }\n }\n if (oldestKey === undefined) {\n break;\n }\n map.delete(oldestKey);\n }\n }\n\n /**\n * Records registration ceremony state after pruning expired rows and evicting oldest if at cap.\n *\n * @param challenge - Same base64url challenge as in the creation options `challenge` field.\n * @param ceremony - Payload to retrieve when the registration response returns.\n */\n saveRegistrationCeremony(\n challenge: string,\n ceremony: PasskeyRegistrationCeremony,\n ): void {\n this.#pruneExpired('registration');\n this.#enforceCapacity('registration');\n this.#registrationMap.set(challenge, ceremony);\n }\n\n /**\n * Records authentication ceremony state after pruning expired rows and evicting oldest if at cap.\n *\n * @param challenge - Same base64url challenge as in the request options `challenge` field.\n * @param ceremony - Payload to retrieve when the assertion response returns.\n */\n saveAuthenticationCeremony(\n challenge: string,\n ceremony: PasskeyAuthenticationCeremony,\n ): void {\n this.#pruneExpired('authentication');\n this.#enforceCapacity('authentication');\n this.#authenticationMap.set(challenge, ceremony);\n }\n\n /**\n * Returns registration ceremony for a challenge, pruning expired entries on this map first.\n *\n * @param challenge - Base64url challenge from decoded `clientDataJSON` (matches stored key).\n * @returns Stored ceremony, or `undefined` if none or expired.\n */\n getRegistrationCeremony(\n challenge: string,\n ): PasskeyRegistrationCeremony | undefined {\n this.#pruneExpired('registration');\n return this.#registrationMap.get(challenge);\n }\n\n /**\n * Returns authentication ceremony for a challenge, pruning expired entries on this map first.\n *\n * @param challenge - Base64url challenge from decoded `clientDataJSON` (matches stored key).\n * @returns Stored ceremony, or `undefined` if none or expired.\n */\n getAuthenticationCeremony(\n challenge: string,\n ): PasskeyAuthenticationCeremony | undefined {\n this.#pruneExpired('authentication');\n return this.#authenticationMap.get(challenge);\n }\n\n /**\n * Removes a registration ceremony by challenge.\n *\n * @param challenge - Map key for the ceremony to remove.\n * @returns Whether an entry was deleted.\n */\n deleteRegistrationCeremony(challenge: string): boolean {\n return this.#registrationMap.delete(challenge);\n }\n\n /**\n * Removes an authentication ceremony by challenge.\n *\n * @param challenge - Map key for the ceremony to remove.\n * @returns Whether an entry was deleted.\n */\n deleteAuthenticationCeremony(challenge: string): boolean {\n return this.#authenticationMap.delete(challenge);\n }\n\n /** Drops all in-flight registration and authentication ceremonies. */\n clear(): void {\n this.#registrationMap.clear();\n this.#authenticationMap.clear();\n }\n}\n"]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PasskeyControllerErrorMessage = exports.PasskeyControllerErrorCode = exports.controllerName = void 0;
|
|
4
|
+
exports.controllerName = 'PasskeyController';
|
|
5
|
+
/**
|
|
6
|
+
* Stable programmatic codes for {@link PasskeyControllerError}.
|
|
7
|
+
* Use these instead of matching `message` strings.
|
|
8
|
+
*/
|
|
9
|
+
exports.PasskeyControllerErrorCode = {
|
|
10
|
+
NotEnrolled: 'not_enrolled',
|
|
11
|
+
AlreadyEnrolled: 'already_enrolled',
|
|
12
|
+
NoRegistrationCeremony: 'no_registration_ceremony',
|
|
13
|
+
RegistrationVerificationFailed: 'registration_verification_failed',
|
|
14
|
+
NoAuthenticationCeremony: 'no_authentication_ceremony',
|
|
15
|
+
AuthenticationVerificationFailed: 'authentication_verification_failed',
|
|
16
|
+
MissingKeyMaterial: 'missing_key_material',
|
|
17
|
+
VaultKeyDecryptionFailed: 'vault_key_decryption_failed',
|
|
18
|
+
VaultKeyMismatch: 'vault_key_mismatch',
|
|
19
|
+
VaultKeyRenewalFailed: 'vault_key_renewal_failed',
|
|
20
|
+
EnrollmentPasswordRequired: 'enrollment_password_required',
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Human-readable messages for {@link PasskeyControllerError}.
|
|
24
|
+
*/
|
|
25
|
+
var PasskeyControllerErrorMessage;
|
|
26
|
+
(function (PasskeyControllerErrorMessage) {
|
|
27
|
+
PasskeyControllerErrorMessage["NotEnrolled"] = "PasskeyController - Passkey is not enrolled";
|
|
28
|
+
PasskeyControllerErrorMessage["AlreadyEnrolled"] = "PasskeyController - Passkey is already enrolled";
|
|
29
|
+
PasskeyControllerErrorMessage["NoRegistrationCeremony"] = "PasskeyController - No active passkey registration ceremony";
|
|
30
|
+
PasskeyControllerErrorMessage["RegistrationVerificationFailed"] = "PasskeyController - Passkey registration verification failed";
|
|
31
|
+
PasskeyControllerErrorMessage["NoAuthenticationCeremony"] = "PasskeyController - No active passkey authentication ceremony";
|
|
32
|
+
PasskeyControllerErrorMessage["AuthenticationVerificationFailed"] = "PasskeyController - Passkey authentication verification failed";
|
|
33
|
+
PasskeyControllerErrorMessage["MissingKeyMaterial"] = "PasskeyController - Passkey assertion missing required key material";
|
|
34
|
+
PasskeyControllerErrorMessage["VaultKeyDecryptionFailed"] = "PasskeyController - Passkey vault key decryption failed";
|
|
35
|
+
PasskeyControllerErrorMessage["VaultKeyMismatch"] = "PasskeyController - Passkey authentication does not match the current vault key";
|
|
36
|
+
PasskeyControllerErrorMessage["EnrollmentPasswordRequired"] = "PasskeyController - Password required to register passkey";
|
|
37
|
+
PasskeyControllerErrorMessage["VaultKeyRenewalFailed"] = "PasskeyController - Passkey vault key renewal failed";
|
|
38
|
+
})(PasskeyControllerErrorMessage || (exports.PasskeyControllerErrorMessage = PasskeyControllerErrorMessage = {}));
|
|
39
|
+
//# sourceMappingURL=constants.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.cjs","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG,mBAAmB,CAAC;AAElD;;;GAGG;AACU,QAAA,0BAA0B,GAAG;IACxC,WAAW,EAAE,cAAc;IAC3B,eAAe,EAAE,kBAAkB;IACnC,sBAAsB,EAAE,0BAA0B;IAClD,8BAA8B,EAAE,kCAAkC;IAClE,wBAAwB,EAAE,4BAA4B;IACtD,gCAAgC,EAAE,oCAAoC;IACtE,kBAAkB,EAAE,sBAAsB;IAC1C,wBAAwB,EAAE,6BAA6B;IACvD,gBAAgB,EAAE,oBAAoB;IACtC,qBAAqB,EAAE,0BAA0B;IACjD,0BAA0B,EAAE,8BAA8B;CAClD,CAAC;AAKX;;GAEG;AACH,IAAY,6BAYX;AAZD,WAAY,6BAA6B;IACvC,4FAA2D,CAAA;IAC3D,oGAAmE,CAAA;IACnE,uHAAsF,CAAA;IACtF,gIAA+F,CAAA;IAC/F,2HAA0F,CAAA;IAC1F,oIAAmG,CAAA;IACnG,2HAA0F,CAAA;IAC1F,qHAAoF,CAAA;IACpF,qIAAoG,CAAA;IACpG,yHAAwF,CAAA;IACxF,+GAA8E,CAAA;AAChF,CAAC,EAZW,6BAA6B,6CAA7B,6BAA6B,QAYxC","sourcesContent":["export const controllerName = 'PasskeyController';\n\n/**\n * Stable programmatic codes for {@link PasskeyControllerError}.\n * Use these instead of matching `message` strings.\n */\nexport const PasskeyControllerErrorCode = {\n NotEnrolled: 'not_enrolled',\n AlreadyEnrolled: 'already_enrolled',\n NoRegistrationCeremony: 'no_registration_ceremony',\n RegistrationVerificationFailed: 'registration_verification_failed',\n NoAuthenticationCeremony: 'no_authentication_ceremony',\n AuthenticationVerificationFailed: 'authentication_verification_failed',\n MissingKeyMaterial: 'missing_key_material',\n VaultKeyDecryptionFailed: 'vault_key_decryption_failed',\n VaultKeyMismatch: 'vault_key_mismatch',\n VaultKeyRenewalFailed: 'vault_key_renewal_failed',\n EnrollmentPasswordRequired: 'enrollment_password_required',\n} as const;\n\nexport type PasskeyControllerErrorCode =\n (typeof PasskeyControllerErrorCode)[keyof typeof PasskeyControllerErrorCode];\n\n/**\n * Human-readable messages for {@link PasskeyControllerError}.\n */\nexport enum PasskeyControllerErrorMessage {\n NotEnrolled = `${controllerName} - Passkey is not enrolled`,\n AlreadyEnrolled = `${controllerName} - Passkey is already enrolled`,\n NoRegistrationCeremony = `${controllerName} - No active passkey registration ceremony`,\n RegistrationVerificationFailed = `${controllerName} - Passkey registration verification failed`,\n NoAuthenticationCeremony = `${controllerName} - No active passkey authentication ceremony`,\n AuthenticationVerificationFailed = `${controllerName} - Passkey authentication verification failed`,\n MissingKeyMaterial = `${controllerName} - Passkey assertion missing required key material`,\n VaultKeyDecryptionFailed = `${controllerName} - Passkey vault key decryption failed`,\n VaultKeyMismatch = `${controllerName} - Passkey authentication does not match the current vault key`,\n EnrollmentPasswordRequired = `${controllerName} - Password required to register passkey`,\n VaultKeyRenewalFailed = `${controllerName} - Passkey vault key renewal failed`,\n}\n"]}
|
|
@@ -4,17 +4,17 @@ export declare const controllerName = "PasskeyController";
|
|
|
4
4
|
* Use these instead of matching `message` strings.
|
|
5
5
|
*/
|
|
6
6
|
export declare const PasskeyControllerErrorCode: {
|
|
7
|
-
readonly NotEnrolled:
|
|
8
|
-
readonly AlreadyEnrolled:
|
|
9
|
-
readonly NoRegistrationCeremony:
|
|
10
|
-
readonly RegistrationVerificationFailed:
|
|
11
|
-
readonly NoAuthenticationCeremony:
|
|
12
|
-
readonly AuthenticationVerificationFailed:
|
|
13
|
-
readonly MissingKeyMaterial:
|
|
14
|
-
readonly VaultKeyDecryptionFailed:
|
|
15
|
-
readonly VaultKeyMismatch:
|
|
16
|
-
readonly VaultKeyRenewalFailed:
|
|
17
|
-
readonly EnrollmentPasswordRequired:
|
|
7
|
+
readonly NotEnrolled: "not_enrolled";
|
|
8
|
+
readonly AlreadyEnrolled: "already_enrolled";
|
|
9
|
+
readonly NoRegistrationCeremony: "no_registration_ceremony";
|
|
10
|
+
readonly RegistrationVerificationFailed: "registration_verification_failed";
|
|
11
|
+
readonly NoAuthenticationCeremony: "no_authentication_ceremony";
|
|
12
|
+
readonly AuthenticationVerificationFailed: "authentication_verification_failed";
|
|
13
|
+
readonly MissingKeyMaterial: "missing_key_material";
|
|
14
|
+
readonly VaultKeyDecryptionFailed: "vault_key_decryption_failed";
|
|
15
|
+
readonly VaultKeyMismatch: "vault_key_mismatch";
|
|
16
|
+
readonly VaultKeyRenewalFailed: "vault_key_renewal_failed";
|
|
17
|
+
readonly EnrollmentPasswordRequired: "enrollment_password_required";
|
|
18
18
|
};
|
|
19
19
|
export type PasskeyControllerErrorCode = (typeof PasskeyControllerErrorCode)[keyof typeof PasskeyControllerErrorCode];
|
|
20
20
|
/**
|
|
@@ -33,4 +33,4 @@ export declare enum PasskeyControllerErrorMessage {
|
|
|
33
33
|
EnrollmentPasswordRequired = "PasskeyController - Password required to register passkey",
|
|
34
34
|
VaultKeyRenewalFailed = "PasskeyController - Passkey vault key renewal failed"
|
|
35
35
|
}
|
|
36
|
-
//# sourceMappingURL=constants.d.
|
|
36
|
+
//# sourceMappingURL=constants.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.cts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,sBAAsB,CAAC;AAElD;;;GAGG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;CAY7B,CAAC;AAEX,MAAM,MAAM,0BAA0B,GACpC,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,OAAO,0BAA0B,CAAC,CAAC;AAE/E;;GAEG;AACH,oBAAY,6BAA6B;IACvC,WAAW,gDAAgD;IAC3D,eAAe,oDAAoD;IACnE,sBAAsB,gEAAgE;IACtF,8BAA8B,iEAAiE;IAC/F,wBAAwB,kEAAkE;IAC1F,gCAAgC,mEAAmE;IACnG,kBAAkB,wEAAwE;IAC1F,wBAAwB,4DAA4D;IACpF,gBAAgB,oFAAoF;IACpG,0BAA0B,8DAA8D;IACxF,qBAAqB,yDAAyD;CAC/E"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare const controllerName = "PasskeyController";
|
|
2
|
+
/**
|
|
3
|
+
* Stable programmatic codes for {@link PasskeyControllerError}.
|
|
4
|
+
* Use these instead of matching `message` strings.
|
|
5
|
+
*/
|
|
6
|
+
export declare const PasskeyControllerErrorCode: {
|
|
7
|
+
readonly NotEnrolled: "not_enrolled";
|
|
8
|
+
readonly AlreadyEnrolled: "already_enrolled";
|
|
9
|
+
readonly NoRegistrationCeremony: "no_registration_ceremony";
|
|
10
|
+
readonly RegistrationVerificationFailed: "registration_verification_failed";
|
|
11
|
+
readonly NoAuthenticationCeremony: "no_authentication_ceremony";
|
|
12
|
+
readonly AuthenticationVerificationFailed: "authentication_verification_failed";
|
|
13
|
+
readonly MissingKeyMaterial: "missing_key_material";
|
|
14
|
+
readonly VaultKeyDecryptionFailed: "vault_key_decryption_failed";
|
|
15
|
+
readonly VaultKeyMismatch: "vault_key_mismatch";
|
|
16
|
+
readonly VaultKeyRenewalFailed: "vault_key_renewal_failed";
|
|
17
|
+
readonly EnrollmentPasswordRequired: "enrollment_password_required";
|
|
18
|
+
};
|
|
19
|
+
export type PasskeyControllerErrorCode = (typeof PasskeyControllerErrorCode)[keyof typeof PasskeyControllerErrorCode];
|
|
20
|
+
/**
|
|
21
|
+
* Human-readable messages for {@link PasskeyControllerError}.
|
|
22
|
+
*/
|
|
23
|
+
export declare enum PasskeyControllerErrorMessage {
|
|
24
|
+
NotEnrolled = "PasskeyController - Passkey is not enrolled",
|
|
25
|
+
AlreadyEnrolled = "PasskeyController - Passkey is already enrolled",
|
|
26
|
+
NoRegistrationCeremony = "PasskeyController - No active passkey registration ceremony",
|
|
27
|
+
RegistrationVerificationFailed = "PasskeyController - Passkey registration verification failed",
|
|
28
|
+
NoAuthenticationCeremony = "PasskeyController - No active passkey authentication ceremony",
|
|
29
|
+
AuthenticationVerificationFailed = "PasskeyController - Passkey authentication verification failed",
|
|
30
|
+
MissingKeyMaterial = "PasskeyController - Passkey assertion missing required key material",
|
|
31
|
+
VaultKeyDecryptionFailed = "PasskeyController - Passkey vault key decryption failed",
|
|
32
|
+
VaultKeyMismatch = "PasskeyController - Passkey authentication does not match the current vault key",
|
|
33
|
+
EnrollmentPasswordRequired = "PasskeyController - Password required to register passkey",
|
|
34
|
+
VaultKeyRenewalFailed = "PasskeyController - Passkey vault key renewal failed"
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=constants.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.mts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,sBAAsB,CAAC;AAElD;;;GAGG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;CAY7B,CAAC;AAEX,MAAM,MAAM,0BAA0B,GACpC,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,OAAO,0BAA0B,CAAC,CAAC;AAE/E;;GAEG;AACH,oBAAY,6BAA6B;IACvC,WAAW,gDAAgD;IAC3D,eAAe,oDAAoD;IACnE,sBAAsB,gEAAgE;IACtF,8BAA8B,iEAAiE;IAC/F,wBAAwB,kEAAkE;IAC1F,gCAAgC,mEAAmE;IACnG,kBAAkB,wEAAwE;IAC1F,wBAAwB,4DAA4D;IACpF,gBAAgB,oFAAoF;IACpG,0BAA0B,8DAA8D;IACxF,qBAAqB,yDAAyD;CAC/E"}
|
|
@@ -33,4 +33,4 @@ export var PasskeyControllerErrorMessage;
|
|
|
33
33
|
PasskeyControllerErrorMessage["EnrollmentPasswordRequired"] = "PasskeyController - Password required to register passkey";
|
|
34
34
|
PasskeyControllerErrorMessage["VaultKeyRenewalFailed"] = "PasskeyController - Passkey vault key renewal failed";
|
|
35
35
|
})(PasskeyControllerErrorMessage || (PasskeyControllerErrorMessage = {}));
|
|
36
|
-
//# sourceMappingURL=constants.
|
|
36
|
+
//# sourceMappingURL=constants.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.mjs","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG,mBAAmB,CAAC;AAElD;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,WAAW,EAAE,cAAc;IAC3B,eAAe,EAAE,kBAAkB;IACnC,sBAAsB,EAAE,0BAA0B;IAClD,8BAA8B,EAAE,kCAAkC;IAClE,wBAAwB,EAAE,4BAA4B;IACtD,gCAAgC,EAAE,oCAAoC;IACtE,kBAAkB,EAAE,sBAAsB;IAC1C,wBAAwB,EAAE,6BAA6B;IACvD,gBAAgB,EAAE,oBAAoB;IACtC,qBAAqB,EAAE,0BAA0B;IACjD,0BAA0B,EAAE,8BAA8B;CAClD,CAAC;AAKX;;GAEG;AACH,MAAM,CAAN,IAAY,6BAYX;AAZD,WAAY,6BAA6B;IACvC,4FAA2D,CAAA;IAC3D,oGAAmE,CAAA;IACnE,uHAAsF,CAAA;IACtF,gIAA+F,CAAA;IAC/F,2HAA0F,CAAA;IAC1F,oIAAmG,CAAA;IACnG,2HAA0F,CAAA;IAC1F,qHAAoF,CAAA;IACpF,qIAAoG,CAAA;IACpG,yHAAwF,CAAA;IACxF,+GAA8E,CAAA;AAChF,CAAC,EAZW,6BAA6B,KAA7B,6BAA6B,QAYxC","sourcesContent":["export const controllerName = 'PasskeyController';\n\n/**\n * Stable programmatic codes for {@link PasskeyControllerError}.\n * Use these instead of matching `message` strings.\n */\nexport const PasskeyControllerErrorCode = {\n NotEnrolled: 'not_enrolled',\n AlreadyEnrolled: 'already_enrolled',\n NoRegistrationCeremony: 'no_registration_ceremony',\n RegistrationVerificationFailed: 'registration_verification_failed',\n NoAuthenticationCeremony: 'no_authentication_ceremony',\n AuthenticationVerificationFailed: 'authentication_verification_failed',\n MissingKeyMaterial: 'missing_key_material',\n VaultKeyDecryptionFailed: 'vault_key_decryption_failed',\n VaultKeyMismatch: 'vault_key_mismatch',\n VaultKeyRenewalFailed: 'vault_key_renewal_failed',\n EnrollmentPasswordRequired: 'enrollment_password_required',\n} as const;\n\nexport type PasskeyControllerErrorCode =\n (typeof PasskeyControllerErrorCode)[keyof typeof PasskeyControllerErrorCode];\n\n/**\n * Human-readable messages for {@link PasskeyControllerError}.\n */\nexport enum PasskeyControllerErrorMessage {\n NotEnrolled = `${controllerName} - Passkey is not enrolled`,\n AlreadyEnrolled = `${controllerName} - Passkey is already enrolled`,\n NoRegistrationCeremony = `${controllerName} - No active passkey registration ceremony`,\n RegistrationVerificationFailed = `${controllerName} - Passkey registration verification failed`,\n NoAuthenticationCeremony = `${controllerName} - No active passkey authentication ceremony`,\n AuthenticationVerificationFailed = `${controllerName} - Passkey authentication verification failed`,\n MissingKeyMaterial = `${controllerName} - Passkey assertion missing required key material`,\n VaultKeyDecryptionFailed = `${controllerName} - Passkey vault key decryption failed`,\n VaultKeyMismatch = `${controllerName} - Passkey authentication does not match the current vault key`,\n EnrollmentPasswordRequired = `${controllerName} - Password required to register passkey`,\n VaultKeyRenewalFailed = `${controllerName} - Passkey vault key renewal failed`,\n}\n"]}
|
package/dist/errors.cjs
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PasskeyControllerError = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Error class for PasskeyController-related errors.
|
|
6
|
+
*/
|
|
7
|
+
class PasskeyControllerError extends Error {
|
|
8
|
+
/**
|
|
9
|
+
* @param message - The error message.
|
|
10
|
+
* @param options - Error options or an `Error` instance used as `cause` (Keyring-style overload).
|
|
11
|
+
*/
|
|
12
|
+
constructor(message, options) {
|
|
13
|
+
super(message);
|
|
14
|
+
this.name = 'PasskeyControllerError';
|
|
15
|
+
const cause = options instanceof Error ? options : options?.cause;
|
|
16
|
+
const code = options instanceof Error ? undefined : options?.code;
|
|
17
|
+
const context = options instanceof Error ? undefined : options?.context;
|
|
18
|
+
if (cause) {
|
|
19
|
+
this.cause = cause;
|
|
20
|
+
}
|
|
21
|
+
if (code) {
|
|
22
|
+
this.code = code;
|
|
23
|
+
}
|
|
24
|
+
if (context) {
|
|
25
|
+
this.context = context;
|
|
26
|
+
}
|
|
27
|
+
Object.setPrototypeOf(this, PasskeyControllerError.prototype);
|
|
28
|
+
}
|
|
29
|
+
toJSON() {
|
|
30
|
+
return {
|
|
31
|
+
name: this.name,
|
|
32
|
+
message: this.message,
|
|
33
|
+
code: this.code,
|
|
34
|
+
context: this.context,
|
|
35
|
+
stack: this.stack,
|
|
36
|
+
cause: this.cause
|
|
37
|
+
? {
|
|
38
|
+
name: this.cause.name,
|
|
39
|
+
message: this.cause.message,
|
|
40
|
+
stack: this.cause.stack,
|
|
41
|
+
}
|
|
42
|
+
: undefined,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
toString() {
|
|
46
|
+
let result = `${this.name}: ${this.message}`;
|
|
47
|
+
if (this.code) {
|
|
48
|
+
result += ` [${this.code}]`;
|
|
49
|
+
}
|
|
50
|
+
if (this.cause) {
|
|
51
|
+
result += `\n Caused by: ${this.cause}`;
|
|
52
|
+
}
|
|
53
|
+
return result;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.PasskeyControllerError = PasskeyControllerError;
|
|
57
|
+
//# sourceMappingURL=errors.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.cjs","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";;;AAoBA;;GAEG;AACH,MAAa,sBAAuB,SAAQ,KAAK;IAO/C;;;OAGG;IACH,YACE,OAAe,EACf,OAA+C;QAE/C,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAC;QAErC,MAAM,KAAK,GAAG,OAAO,YAAY,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC;QAClE,MAAM,IAAI,GAAG,OAAO,YAAY,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC;QAClE,MAAM,OAAO,GAAG,OAAO,YAAY,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC;QAExE,IAAI,KAAK,EAAE,CAAC;YACV,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACrB,CAAC;QACD,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACnB,CAAC;QACD,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACzB,CAAC;QAED,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,sBAAsB,CAAC,SAAS,CAAC,CAAC;IAChE,CAAC;IAED,MAAM;QACJ,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;gBACf,CAAC,CAAC;oBACE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI;oBACrB,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO;oBAC3B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK;iBACxB;gBACH,CAAC,CAAC,SAAS;SACd,CAAC;IACJ,CAAC;IAEQ,QAAQ;QACf,IAAI,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,OAAO,EAAE,CAAC;QAC7C,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,IAAI,CAAC,IAAI,GAAG,CAAC;QAC9B,CAAC;QACD,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,kBAAkB,IAAI,CAAC,KAAK,EAAE,CAAC;QAC3C,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AA9DD,wDA8DC","sourcesContent":["import type { PasskeyControllerErrorCode as PasskeyControllerErrorCodeType } from './constants.js';\n\n/**\n * Options for creating a {@link PasskeyControllerError}.\n */\nexport type PasskeyControllerErrorOptions = {\n /**\n * The underlying error that caused this error (for error chaining).\n */\n cause?: Error;\n /**\n * Stable code for programmatic handling (see {@link PasskeyControllerErrorCode}).\n */\n code?: PasskeyControllerErrorCodeType;\n /**\n * Additional context for debugging or reporting.\n */\n context?: Record<string, unknown>;\n};\n\n/**\n * Error class for PasskeyController-related errors.\n */\nexport class PasskeyControllerError extends Error {\n code?: PasskeyControllerErrorCodeType;\n\n context?: Record<string, unknown>;\n\n cause?: Error;\n\n /**\n * @param message - The error message.\n * @param options - Error options or an `Error` instance used as `cause` (Keyring-style overload).\n */\n constructor(\n message: string,\n options?: PasskeyControllerErrorOptions | Error,\n ) {\n super(message);\n this.name = 'PasskeyControllerError';\n\n const cause = options instanceof Error ? options : options?.cause;\n const code = options instanceof Error ? undefined : options?.code;\n const context = options instanceof Error ? undefined : options?.context;\n\n if (cause) {\n this.cause = cause;\n }\n if (code) {\n this.code = code;\n }\n if (context) {\n this.context = context;\n }\n\n Object.setPrototypeOf(this, PasskeyControllerError.prototype);\n }\n\n toJSON(): Record<string, unknown> {\n return {\n name: this.name,\n message: this.message,\n code: this.code,\n context: this.context,\n stack: this.stack,\n cause: this.cause\n ? {\n name: this.cause.name,\n message: this.cause.message,\n stack: this.cause.stack,\n }\n : undefined,\n };\n }\n\n override toString(): string {\n let result = `${this.name}: ${this.message}`;\n if (this.code) {\n result += ` [${this.code}]`;\n }\n if (this.cause) {\n result += `\\n Caused by: ${this.cause}`;\n }\n return result;\n }\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PasskeyControllerErrorCode as PasskeyControllerErrorCodeType } from
|
|
1
|
+
import type { PasskeyControllerErrorCode as PasskeyControllerErrorCodeType } from "./constants.cjs";
|
|
2
2
|
/**
|
|
3
3
|
* Options for creating a {@link PasskeyControllerError}.
|
|
4
4
|
*/
|
|
@@ -31,4 +31,4 @@ export declare class PasskeyControllerError extends Error {
|
|
|
31
31
|
toJSON(): Record<string, unknown>;
|
|
32
32
|
toString(): string;
|
|
33
33
|
}
|
|
34
|
-
//# sourceMappingURL=errors.d.
|
|
34
|
+
//# sourceMappingURL=errors.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.cts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,IAAI,8BAA8B,EAAE,wBAAuB;AAEnG;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IACd;;OAEG;IACH,IAAI,CAAC,EAAE,8BAA8B,CAAC;IACtC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC,CAAC;AAEF;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,KAAK;IAC/C,IAAI,CAAC,EAAE,8BAA8B,CAAC;IAEtC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAElC,KAAK,CAAC,EAAE,KAAK,CAAC;IAEd;;;OAGG;gBAED,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,6BAA6B,GAAG,KAAK;IAsBjD,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAiBxB,QAAQ,IAAI,MAAM;CAU5B"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { PasskeyControllerErrorCode as PasskeyControllerErrorCodeType } from "./constants.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Options for creating a {@link PasskeyControllerError}.
|
|
4
|
+
*/
|
|
5
|
+
export type PasskeyControllerErrorOptions = {
|
|
6
|
+
/**
|
|
7
|
+
* The underlying error that caused this error (for error chaining).
|
|
8
|
+
*/
|
|
9
|
+
cause?: Error;
|
|
10
|
+
/**
|
|
11
|
+
* Stable code for programmatic handling (see {@link PasskeyControllerErrorCode}).
|
|
12
|
+
*/
|
|
13
|
+
code?: PasskeyControllerErrorCodeType;
|
|
14
|
+
/**
|
|
15
|
+
* Additional context for debugging or reporting.
|
|
16
|
+
*/
|
|
17
|
+
context?: Record<string, unknown>;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Error class for PasskeyController-related errors.
|
|
21
|
+
*/
|
|
22
|
+
export declare class PasskeyControllerError extends Error {
|
|
23
|
+
code?: PasskeyControllerErrorCodeType;
|
|
24
|
+
context?: Record<string, unknown>;
|
|
25
|
+
cause?: Error;
|
|
26
|
+
/**
|
|
27
|
+
* @param message - The error message.
|
|
28
|
+
* @param options - Error options or an `Error` instance used as `cause` (Keyring-style overload).
|
|
29
|
+
*/
|
|
30
|
+
constructor(message: string, options?: PasskeyControllerErrorOptions | Error);
|
|
31
|
+
toJSON(): Record<string, unknown>;
|
|
32
|
+
toString(): string;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=errors.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.mts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,IAAI,8BAA8B,EAAE,wBAAuB;AAEnG;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IACd;;OAEG;IACH,IAAI,CAAC,EAAE,8BAA8B,CAAC;IACtC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC,CAAC;AAEF;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,KAAK;IAC/C,IAAI,CAAC,EAAE,8BAA8B,CAAC;IAEtC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAElC,KAAK,CAAC,EAAE,KAAK,CAAC;IAEd;;;OAGG;gBAED,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,6BAA6B,GAAG,KAAK;IAsBjD,MAAM,IAAI,MAAM,CAA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gBACf,CAAC,CAAC;oBACE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI;oBACrB,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO;oBAC3B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK;iBACxB;gBACH,CAAC,CAAC,SAAS;SACd,CAAC;IACJ,CAAC;IAEQ,QAAQ;QACf,IAAI,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,OAAO,EAAE,CAAC;QAC7C,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,IAAI,CAAC,IAAI,GAAG,CAAC;QAC9B,CAAC;QACD,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,kBAAkB,IAAI,CAAC,KAAK,EAAE,CAAC;QAC3C,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF","sourcesContent":["import type { PasskeyControllerErrorCode as PasskeyControllerErrorCodeType } from './constants.js';\n\n/**\n * Options for creating a {@link PasskeyControllerError}.\n */\nexport type PasskeyControllerErrorOptions = {\n /**\n * The underlying error that caused this error (for error chaining).\n */\n cause?: Error;\n /**\n * Stable code for programmatic handling (see {@link PasskeyControllerErrorCode}).\n */\n code?: PasskeyControllerErrorCodeType;\n /**\n * Additional context for debugging or reporting.\n */\n context?: Record<string, unknown>;\n};\n\n/**\n * Error class for PasskeyController-related errors.\n */\nexport class PasskeyControllerError extends Error {\n code?: PasskeyControllerErrorCodeType;\n\n context?: Record<string, unknown>;\n\n cause?: Error;\n\n /**\n * @param message - The error message.\n * @param options - Error options or an `Error` instance used as `cause` (Keyring-style overload).\n */\n constructor(\n message: string,\n options?: PasskeyControllerErrorOptions | Error,\n ) {\n super(message);\n this.name = 'PasskeyControllerError';\n\n const cause = options instanceof Error ? options : options?.cause;\n const code = options instanceof Error ? undefined : options?.code;\n const context = options instanceof Error ? undefined : options?.context;\n\n if (cause) {\n this.cause = cause;\n }\n if (code) {\n this.code = code;\n }\n if (context) {\n this.context = context;\n }\n\n Object.setPrototypeOf(this, PasskeyControllerError.prototype);\n }\n\n toJSON(): Record<string, unknown> {\n return {\n name: this.name,\n message: this.message,\n code: this.code,\n context: this.context,\n stack: this.stack,\n cause: this.cause\n ? {\n name: this.cause.name,\n message: this.cause.message,\n stack: this.cause.stack,\n }\n : undefined,\n };\n }\n\n override toString(): string {\n let result = `${this.name}: ${this.message}`;\n if (this.code) {\n result += ` [${this.code}]`;\n }\n if (this.cause) {\n result += `\\n Caused by: ${this.cause}`;\n }\n return result;\n }\n}\n"]}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAAGUIDFromRegistrationResponse = exports.passkeyControllerSelectors = exports.getDefaultPasskeyControllerState = exports.PasskeyController = exports.PasskeyControllerError = exports.PasskeyControllerErrorMessage = exports.PasskeyControllerErrorCode = void 0;
|
|
4
|
+
var constants_js_1 = require("./constants.cjs");
|
|
5
|
+
Object.defineProperty(exports, "PasskeyControllerErrorCode", { enumerable: true, get: function () { return constants_js_1.PasskeyControllerErrorCode; } });
|
|
6
|
+
Object.defineProperty(exports, "PasskeyControllerErrorMessage", { enumerable: true, get: function () { return constants_js_1.PasskeyControllerErrorMessage; } });
|
|
7
|
+
var errors_js_1 = require("./errors.cjs");
|
|
8
|
+
Object.defineProperty(exports, "PasskeyControllerError", { enumerable: true, get: function () { return errors_js_1.PasskeyControllerError; } });
|
|
9
|
+
var PasskeyController_js_1 = require("./PasskeyController.cjs");
|
|
10
|
+
Object.defineProperty(exports, "PasskeyController", { enumerable: true, get: function () { return PasskeyController_js_1.PasskeyController; } });
|
|
11
|
+
Object.defineProperty(exports, "getDefaultPasskeyControllerState", { enumerable: true, get: function () { return PasskeyController_js_1.getDefaultPasskeyControllerState; } });
|
|
12
|
+
Object.defineProperty(exports, "passkeyControllerSelectors", { enumerable: true, get: function () { return PasskeyController_js_1.passkeyControllerSelectors; } });
|
|
13
|
+
var verify_registration_response_js_1 = require("./webauthn/verify-registration-response.cjs");
|
|
14
|
+
Object.defineProperty(exports, "getAAGUIDFromRegistrationResponse", { enumerable: true, get: function () { return verify_registration_response_js_1.getAAGUIDFromRegistrationResponse; } });
|
|
15
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,gDAGwB;AAFtB,0HAAA,0BAA0B,OAAA;AAC1B,6HAAA,6BAA6B,OAAA;AAE/B,0CAAqD;AAA5C,mHAAA,sBAAsB,OAAA;AAC/B,gEAIgC;AAH9B,yHAAA,iBAAiB,OAAA;AACjB,wIAAA,gCAAgC,OAAA;AAChC,kIAAA,0BAA0B,OAAA;AAuB5B,+FAA+F;AAAtF,oJAAA,iCAAiC,OAAA","sourcesContent":["export {\n PasskeyControllerErrorCode,\n PasskeyControllerErrorMessage,\n} from './constants.js';\nexport { PasskeyControllerError } from './errors.js';\nexport {\n PasskeyController,\n getDefaultPasskeyControllerState,\n passkeyControllerSelectors,\n} from './PasskeyController.js';\nexport type {\n PasskeyControllerState,\n PasskeyControllerMessenger,\n PasskeyControllerOptions,\n PasskeyControllerGetStateAction,\n PasskeyControllerActions,\n PasskeyControllerStateChangedEvent,\n PasskeyControllerEvents,\n PasskeyCredentialInfo,\n PasskeyDerivationMethod,\n PasskeyKeyDerivation,\n PasskeyRecord,\n PrfEvalExtension,\n PrfClientExtensionResults,\n} from './types.js';\nexport type {\n PasskeyRegistrationOptions,\n PasskeyRegistrationResponse,\n PasskeyAuthenticationOptions,\n PasskeyAuthenticationResponse,\n} from './webauthn/types.js';\nexport { getAAGUIDFromRegistrationResponse } from './webauthn/verify-registration-response.js';\nexport type {\n PasskeyControllerIsPasskeyEnrolledAction,\n PasskeyControllerGenerateRegistrationOptionsAction,\n PasskeyControllerGeneratePostRegistrationAuthenticationOptionsAction,\n PasskeyControllerGenerateAuthenticationOptionsAction,\n PasskeyControllerProtectVaultKeyWithPasskeyAction,\n PasskeyControllerRetrieveVaultKeyWithPasskeyAction,\n PasskeyControllerUnlockWithPasskeyAction,\n PasskeyControllerExportSeedPhraseWithPasskeyAction,\n PasskeyControllerExportAccountsWithPasskeyAction,\n PasskeyControllerVerifyPasskeyAuthenticationAction,\n PasskeyControllerRenewVaultKeyProtectionAction,\n PasskeyControllerChangePasswordWithPasskeyVerificationAction,\n PasskeyControllerRemovePasskeyWithPasskeyVerificationAction,\n PasskeyControllerRemovePasskeyWithPasswordVerificationAction,\n PasskeyControllerClearStateAction,\n PasskeyControllerDestroyAction,\n} from './PasskeyController-method-action-types.js';\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { PasskeyControllerErrorCode, PasskeyControllerErrorMessage, } from
|
|
2
|
-
export { PasskeyControllerError } from
|
|
3
|
-
export { PasskeyController, getDefaultPasskeyControllerState, passkeyControllerSelectors, } from
|
|
4
|
-
export type { PasskeyControllerState, PasskeyControllerMessenger, PasskeyControllerOptions, PasskeyControllerGetStateAction, PasskeyControllerActions, PasskeyControllerStateChangedEvent, PasskeyControllerEvents, PasskeyCredentialInfo, PasskeyDerivationMethod, PasskeyKeyDerivation, PasskeyRecord, PrfEvalExtension, PrfClientExtensionResults, } from
|
|
5
|
-
export type { PasskeyRegistrationOptions, PasskeyRegistrationResponse, PasskeyAuthenticationOptions, PasskeyAuthenticationResponse, } from
|
|
6
|
-
export { getAAGUIDFromRegistrationResponse } from
|
|
7
|
-
export type { PasskeyControllerIsPasskeyEnrolledAction, PasskeyControllerGenerateRegistrationOptionsAction, PasskeyControllerGeneratePostRegistrationAuthenticationOptionsAction, PasskeyControllerGenerateAuthenticationOptionsAction, PasskeyControllerProtectVaultKeyWithPasskeyAction, PasskeyControllerRetrieveVaultKeyWithPasskeyAction, PasskeyControllerUnlockWithPasskeyAction, PasskeyControllerExportSeedPhraseWithPasskeyAction, PasskeyControllerExportAccountsWithPasskeyAction, PasskeyControllerVerifyPasskeyAuthenticationAction, PasskeyControllerRenewVaultKeyProtectionAction, PasskeyControllerChangePasswordWithPasskeyVerificationAction, PasskeyControllerRemovePasskeyWithPasskeyVerificationAction, PasskeyControllerRemovePasskeyWithPasswordVerificationAction, PasskeyControllerClearStateAction, PasskeyControllerDestroyAction, } from
|
|
8
|
-
//# sourceMappingURL=index.d.
|
|
1
|
+
export { PasskeyControllerErrorCode, PasskeyControllerErrorMessage, } from "./constants.cjs";
|
|
2
|
+
export { PasskeyControllerError } from "./errors.cjs";
|
|
3
|
+
export { PasskeyController, getDefaultPasskeyControllerState, passkeyControllerSelectors, } from "./PasskeyController.cjs";
|
|
4
|
+
export type { PasskeyControllerState, PasskeyControllerMessenger, PasskeyControllerOptions, PasskeyControllerGetStateAction, PasskeyControllerActions, PasskeyControllerStateChangedEvent, PasskeyControllerEvents, PasskeyCredentialInfo, PasskeyDerivationMethod, PasskeyKeyDerivation, PasskeyRecord, PrfEvalExtension, PrfClientExtensionResults, } from "./types.cjs";
|
|
5
|
+
export type { PasskeyRegistrationOptions, PasskeyRegistrationResponse, PasskeyAuthenticationOptions, PasskeyAuthenticationResponse, } from "./webauthn/types.cjs";
|
|
6
|
+
export { getAAGUIDFromRegistrationResponse } from "./webauthn/verify-registration-response.cjs";
|
|
7
|
+
export type { PasskeyControllerIsPasskeyEnrolledAction, PasskeyControllerGenerateRegistrationOptionsAction, PasskeyControllerGeneratePostRegistrationAuthenticationOptionsAction, PasskeyControllerGenerateAuthenticationOptionsAction, PasskeyControllerProtectVaultKeyWithPasskeyAction, PasskeyControllerRetrieveVaultKeyWithPasskeyAction, PasskeyControllerUnlockWithPasskeyAction, PasskeyControllerExportSeedPhraseWithPasskeyAction, PasskeyControllerExportAccountsWithPasskeyAction, PasskeyControllerVerifyPasskeyAuthenticationAction, PasskeyControllerRenewVaultKeyProtectionAction, PasskeyControllerChangePasswordWithPasskeyVerificationAction, PasskeyControllerRemovePasskeyWithPasskeyVerificationAction, PasskeyControllerRemovePasskeyWithPasswordVerificationAction, PasskeyControllerClearStateAction, PasskeyControllerDestroyAction, } from "./PasskeyController-method-action-types.cjs";
|
|
8
|
+
//# sourceMappingURL=index.d.cts.map
|