@metamask-previews/passkey-controller 3.1.0-preview-3e34650c2 → 3.1.0-preview-4f4c98e
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 +1 -0
- package/dist/{PasskeyController-method-action-types.d.mts → PasskeyController-method-action-types.d.ts} +2 -2
- package/dist/PasskeyController-method-action-types.d.ts.map +1 -0
- package/dist/{PasskeyController-method-action-types.mjs → PasskeyController-method-action-types.js} +1 -1
- package/dist/PasskeyController-method-action-types.js.map +1 -0
- package/dist/{PasskeyController.d.cts → PasskeyController.d.ts} +6 -6
- package/dist/PasskeyController.d.ts.map +1 -0
- package/dist/{PasskeyController.mjs → PasskeyController.js} +15 -15
- package/dist/PasskeyController.js.map +1 -0
- package/dist/{ceremony-manager.d.cts → ceremony-manager.d.ts} +2 -2
- package/dist/ceremony-manager.d.ts.map +1 -0
- package/dist/{ceremony-manager.mjs → ceremony-manager.js} +1 -1
- package/dist/ceremony-manager.js.map +1 -0
- package/dist/{constants.d.mts → constants.d.ts} +12 -12
- package/dist/constants.d.ts.map +1 -0
- package/dist/{constants.mjs → constants.js} +1 -1
- package/dist/constants.js.map +1 -0
- package/dist/{errors.d.mts → errors.d.ts} +2 -2
- package/dist/errors.d.ts.map +1 -0
- package/dist/{errors.mjs → errors.js} +1 -1
- package/dist/errors.js.map +1 -0
- package/dist/{index.d.cts → index.d.ts} +8 -8
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/{key-derivation.d.cts → key-derivation.d.ts} +3 -3
- package/dist/key-derivation.d.ts.map +1 -0
- package/dist/{key-derivation.mjs → key-derivation.js} +5 -5
- package/dist/key-derivation.js.map +1 -0
- package/dist/logger.d.ts +4 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +6 -0
- package/dist/logger.js.map +1 -0
- package/dist/{types.d.mts → types.d.ts} +6 -6
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/{crypto.d.mts → crypto.d.ts} +1 -1
- package/dist/utils/crypto.d.ts.map +1 -0
- package/dist/utils/{crypto.mjs → crypto.js} +7 -7
- package/dist/utils/crypto.js.map +1 -0
- package/dist/utils/{encoding.d.cts → encoding.d.ts} +1 -1
- package/dist/utils/encoding.d.ts.map +1 -0
- package/dist/utils/{encoding.mjs → encoding.js} +2 -2
- package/dist/utils/encoding.js.map +1 -0
- package/dist/webauthn/{constants.d.mts → constants.d.ts} +1 -1
- package/dist/webauthn/constants.d.ts.map +1 -0
- package/dist/webauthn/{constants.mjs → constants.js} +1 -1
- package/dist/webauthn/constants.js.map +1 -0
- package/dist/webauthn/{decode-attestation-object.d.mts → decode-attestation-object.d.ts} +2 -2
- package/dist/webauthn/decode-attestation-object.d.ts.map +1 -0
- package/dist/webauthn/{decode-attestation-object.mjs → decode-attestation-object.js} +2 -2
- package/dist/webauthn/decode-attestation-object.js.map +1 -0
- package/dist/webauthn/{decode-client-data-json.d.cts → decode-client-data-json.d.ts} +2 -2
- package/dist/webauthn/decode-client-data-json.d.ts.map +1 -0
- package/dist/webauthn/{decode-client-data-json.mjs → decode-client-data-json.js} +2 -2
- package/dist/webauthn/decode-client-data-json.js.map +1 -0
- package/dist/webauthn/{match-expected-rp-id.d.cts → match-expected-rp-id.d.ts} +1 -1
- package/dist/webauthn/match-expected-rp-id.d.ts.map +1 -0
- package/dist/webauthn/{match-expected-rp-id.mjs → match-expected-rp-id.js} +4 -4
- package/dist/webauthn/match-expected-rp-id.js.map +1 -0
- package/dist/webauthn/{parse-authenticator-data.d.cts → parse-authenticator-data.d.ts} +2 -2
- package/dist/webauthn/parse-authenticator-data.d.ts.map +1 -0
- package/dist/webauthn/{parse-authenticator-data.mjs → parse-authenticator-data.js} +2 -2
- package/dist/webauthn/parse-authenticator-data.js.map +1 -0
- package/dist/webauthn/{types.d.mts → types.d.ts} +2 -2
- package/dist/webauthn/types.d.ts.map +1 -0
- package/dist/webauthn/types.js +2 -0
- package/dist/webauthn/types.js.map +1 -0
- package/dist/webauthn/{verify-authentication-response.d.cts → verify-authentication-response.d.ts} +3 -3
- package/dist/webauthn/verify-authentication-response.d.ts.map +1 -0
- package/dist/webauthn/{verify-authentication-response.mjs → verify-authentication-response.js} +9 -9
- package/dist/webauthn/verify-authentication-response.js.map +1 -0
- package/dist/webauthn/{verify-registration-response.d.mts → verify-registration-response.d.ts} +3 -3
- package/dist/webauthn/verify-registration-response.d.ts.map +1 -0
- package/dist/webauthn/{verify-registration-response.mjs → verify-registration-response.js} +11 -11
- package/dist/webauthn/verify-registration-response.js.map +1 -0
- package/dist/webauthn/{verify-signature.d.cts → verify-signature.d.ts} +1 -1
- package/dist/webauthn/verify-signature.d.ts.map +1 -0
- package/dist/webauthn/{verify-signature.mjs → verify-signature.js} +7 -7
- package/dist/webauthn/verify-signature.js.map +1 -0
- package/package.json +12 -17
- package/dist/PasskeyController-method-action-types.cjs +0 -7
- package/dist/PasskeyController-method-action-types.cjs.map +0 -1
- package/dist/PasskeyController-method-action-types.d.cts +0 -204
- package/dist/PasskeyController-method-action-types.d.cts.map +0 -1
- package/dist/PasskeyController-method-action-types.d.mts.map +0 -1
- package/dist/PasskeyController-method-action-types.mjs.map +0 -1
- package/dist/PasskeyController.cjs +0 -685
- package/dist/PasskeyController.cjs.map +0 -1
- package/dist/PasskeyController.d.cts.map +0 -1
- package/dist/PasskeyController.d.mts +0 -208
- package/dist/PasskeyController.d.mts.map +0 -1
- package/dist/PasskeyController.mjs.map +0 -1
- package/dist/ceremony-manager.cjs +0 -135
- package/dist/ceremony-manager.cjs.map +0 -1
- package/dist/ceremony-manager.d.cts.map +0 -1
- package/dist/ceremony-manager.d.mts +0 -72
- package/dist/ceremony-manager.d.mts.map +0 -1
- package/dist/ceremony-manager.mjs.map +0 -1
- package/dist/constants.cjs +0 -39
- package/dist/constants.cjs.map +0 -1
- package/dist/constants.d.cts +0 -36
- package/dist/constants.d.cts.map +0 -1
- package/dist/constants.d.mts.map +0 -1
- package/dist/constants.mjs.map +0 -1
- package/dist/errors.cjs +0 -57
- package/dist/errors.cjs.map +0 -1
- package/dist/errors.d.cts +0 -34
- package/dist/errors.d.cts.map +0 -1
- package/dist/errors.d.mts.map +0 -1
- package/dist/errors.mjs.map +0 -1
- package/dist/index.cjs +0 -15
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts.map +0 -1
- package/dist/index.d.mts +0 -8
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs +0 -5
- package/dist/index.mjs.map +0 -1
- package/dist/key-derivation.cjs +0 -44
- package/dist/key-derivation.cjs.map +0 -1
- package/dist/key-derivation.d.cts.map +0 -1
- package/dist/key-derivation.d.mts +0 -20
- package/dist/key-derivation.d.mts.map +0 -1
- package/dist/key-derivation.mjs.map +0 -1
- package/dist/logger.cjs +0 -9
- package/dist/logger.cjs.map +0 -1
- package/dist/logger.d.cts +0 -5
- package/dist/logger.d.cts.map +0 -1
- package/dist/logger.d.mts +0 -5
- package/dist/logger.d.mts.map +0 -1
- package/dist/logger.mjs +0 -6
- package/dist/logger.mjs.map +0 -1
- package/dist/types.cjs +0 -4
- package/dist/types.cjs.map +0 -1
- package/dist/types.d.cts +0 -132
- package/dist/types.d.cts.map +0 -1
- package/dist/types.d.mts.map +0 -1
- package/dist/types.mjs +0 -2
- package/dist/types.mjs.map +0 -1
- package/dist/utils/crypto.cjs +0 -66
- package/dist/utils/crypto.cjs.map +0 -1
- package/dist/utils/crypto.d.cts +0 -37
- package/dist/utils/crypto.d.cts.map +0 -1
- package/dist/utils/crypto.d.mts.map +0 -1
- package/dist/utils/crypto.mjs.map +0 -1
- package/dist/utils/encoding.cjs +0 -42
- package/dist/utils/encoding.cjs.map +0 -1
- package/dist/utils/encoding.d.cts.map +0 -1
- package/dist/utils/encoding.d.mts +0 -22
- package/dist/utils/encoding.d.mts.map +0 -1
- package/dist/utils/encoding.mjs.map +0 -1
- package/dist/webauthn/constants.cjs +0 -74
- package/dist/webauthn/constants.cjs.map +0 -1
- package/dist/webauthn/constants.d.cts +0 -68
- package/dist/webauthn/constants.d.cts.map +0 -1
- package/dist/webauthn/constants.d.mts.map +0 -1
- package/dist/webauthn/constants.mjs.map +0 -1
- package/dist/webauthn/decode-attestation-object.cjs +0 -18
- package/dist/webauthn/decode-attestation-object.cjs.map +0 -1
- package/dist/webauthn/decode-attestation-object.d.cts +0 -10
- package/dist/webauthn/decode-attestation-object.d.cts.map +0 -1
- package/dist/webauthn/decode-attestation-object.d.mts.map +0 -1
- package/dist/webauthn/decode-attestation-object.mjs.map +0 -1
- package/dist/webauthn/decode-client-data-json.cjs +0 -17
- package/dist/webauthn/decode-client-data-json.cjs.map +0 -1
- package/dist/webauthn/decode-client-data-json.d.cts.map +0 -1
- package/dist/webauthn/decode-client-data-json.d.mts +0 -9
- package/dist/webauthn/decode-client-data-json.d.mts.map +0 -1
- package/dist/webauthn/decode-client-data-json.mjs.map +0 -1
- package/dist/webauthn/match-expected-rp-id.cjs +0 -26
- package/dist/webauthn/match-expected-rp-id.cjs.map +0 -1
- package/dist/webauthn/match-expected-rp-id.d.cts.map +0 -1
- package/dist/webauthn/match-expected-rp-id.d.mts +0 -11
- package/dist/webauthn/match-expected-rp-id.d.mts.map +0 -1
- package/dist/webauthn/match-expected-rp-id.mjs.map +0 -1
- package/dist/webauthn/parse-authenticator-data.cjs +0 -69
- package/dist/webauthn/parse-authenticator-data.cjs.map +0 -1
- package/dist/webauthn/parse-authenticator-data.d.cts.map +0 -1
- package/dist/webauthn/parse-authenticator-data.d.mts +0 -10
- package/dist/webauthn/parse-authenticator-data.d.mts.map +0 -1
- package/dist/webauthn/parse-authenticator-data.mjs.map +0 -1
- package/dist/webauthn/types.cjs +0 -3
- package/dist/webauthn/types.cjs.map +0 -1
- package/dist/webauthn/types.d.cts +0 -113
- package/dist/webauthn/types.d.cts.map +0 -1
- package/dist/webauthn/types.d.mts.map +0 -1
- package/dist/webauthn/types.mjs +0 -2
- package/dist/webauthn/types.mjs.map +0 -1
- package/dist/webauthn/verify-authentication-response.cjs +0 -133
- package/dist/webauthn/verify-authentication-response.cjs.map +0 -1
- package/dist/webauthn/verify-authentication-response.d.cts.map +0 -1
- package/dist/webauthn/verify-authentication-response.d.mts +0 -64
- package/dist/webauthn/verify-authentication-response.d.mts.map +0 -1
- package/dist/webauthn/verify-authentication-response.mjs.map +0 -1
- package/dist/webauthn/verify-registration-response.cjs +0 -242
- package/dist/webauthn/verify-registration-response.cjs.map +0 -1
- package/dist/webauthn/verify-registration-response.d.cts +0 -81
- package/dist/webauthn/verify-registration-response.d.cts.map +0 -1
- package/dist/webauthn/verify-registration-response.d.mts.map +0 -1
- package/dist/webauthn/verify-registration-response.mjs.map +0 -1
- package/dist/webauthn/verify-signature.cjs +0 -176
- package/dist/webauthn/verify-signature.cjs.map +0 -1
- package/dist/webauthn/verify-signature.d.cts.map +0 -1
- package/dist/webauthn/verify-signature.d.mts +0 -21
- package/dist/webauthn/verify-signature.d.mts.map +0 -1
- package/dist/webauthn/verify-signature.mjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
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,mBAAmB,GAAG,2BAAmB,GAAG,6BAAqB,CAAC;AAE/E;;;GAGG;AACU,QAAA,iCAAiC,GAAG,EAAE,CAAC;AAIpD;;;GAGG;AACH,MAAa,eAAe;IAA5B;;QACW,2CAAmB,IAAI,GAAG,EAAuC,EAAC;QAElE,6CAAqB,IAAI,GAAG,EAGlC,EAAC;IAkIN,CAAC;IAjFC;;;;;OAKG;IACH,wBAAwB,CACtB,SAAiB,EACjB,QAAqC;QAErC,uBAAA,IAAI,i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AAC;IAClC,CAAC;CACF;AAxID,0CAwIC;6MAzHG,YAA0B;IAE1B,OAAO,YAAY,KAAK,cAAc;QACpC,CAAC,CAAC,uBAAA,IAAI,wCAAiB;QACvB,CAAC,CAAC,uBAAA,IAAI,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,2BAAmB,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,yCAAiC,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"]}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,72 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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,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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ceremony-manager.mjs","sourceRoot":"","sources":["../src/ceremony-manager.ts"],"names":[],"mappings":";;;;;;AAKA,qEAAqE;AACrE,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAM,CAAC;AAE1C;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAO,CAAC;AAE7C;;;;GAIG;AACH,MAAM,CAAC,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AU,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"]}
|
package/dist/constants.cjs
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
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
|
package/dist/constants.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"]}
|
package/dist/constants.d.cts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
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.cts.map
|
package/dist/constants.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/dist/constants.d.mts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/dist/constants.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
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
|
package/dist/errors.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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,CAA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,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"]}
|
package/dist/errors.d.cts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { PasskeyControllerErrorCode as PasskeyControllerErrorCodeType } from "./constants.cjs";
|
|
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.cts.map
|
package/dist/errors.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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,MAA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,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
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
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
|
package/dist/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"]}
|
package/dist/index.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,6BAA6B,GAC9B,wBAAuB;AACxB,OAAO,EAAE,sBAAsB,EAAE,qBAAoB;AACrD,OAAO,EACL,iBAAiB,EACjB,gCAAgC,EAChC,0BAA0B,GAC3B,gCAA+B;AAChC,YAAY,EACV,sBAAsB,EACtB,0BAA0B,EAC1B,wBAAwB,EACxB,+BAA+B,EAC/B,wBAAwB,EACxB,kCAAkC,EAClC,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,yBAAyB,GAC1B,oBAAmB;AACpB,YAAY,EACV,0BAA0B,EAC1B,2BAA2B,EAC3B,4BAA4B,EAC5B,6BAA6B,GAC9B,6BAA4B;AAC7B,OAAO,EAAE,iCAAiC,EAAE,oDAAmD;AAC/F,YAAY,EACV,wCAAwC,EACxC,kDAAkD,EAClD,oEAAoE,EACpE,oDAAoD,EACpD,iDAAiD,EACjD,kDAAkD,EAClD,wCAAwC,EACxC,kDAAkD,EAClD,gDAAgD,EAChD,kDAAkD,EAClD,8CAA8C,EAC9C,4DAA4D,EAC5D,2DAA2D,EAC3D,4DAA4D,EAC5D,iCAAiC,EACjC,8BAA8B,GAC/B,oDAAmD"}
|
package/dist/index.d.mts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { PasskeyControllerErrorCode, PasskeyControllerErrorMessage, } from "./constants.mjs";
|
|
2
|
-
export { PasskeyControllerError } from "./errors.mjs";
|
|
3
|
-
export { PasskeyController, getDefaultPasskeyControllerState, passkeyControllerSelectors, } from "./PasskeyController.mjs";
|
|
4
|
-
export type { PasskeyControllerState, PasskeyControllerMessenger, PasskeyControllerOptions, PasskeyControllerGetStateAction, PasskeyControllerActions, PasskeyControllerStateChangedEvent, PasskeyControllerEvents, PasskeyCredentialInfo, PasskeyDerivationMethod, PasskeyKeyDerivation, PasskeyRecord, PrfEvalExtension, PrfClientExtensionResults, } from "./types.mjs";
|
|
5
|
-
export type { PasskeyRegistrationOptions, PasskeyRegistrationResponse, PasskeyAuthenticationOptions, PasskeyAuthenticationResponse, } from "./webauthn/types.mjs";
|
|
6
|
-
export { getAAGUIDFromRegistrationResponse } from "./webauthn/verify-registration-response.mjs";
|
|
7
|
-
export type { PasskeyControllerIsPasskeyEnrolledAction, PasskeyControllerGenerateRegistrationOptionsAction, PasskeyControllerGeneratePostRegistrationAuthenticationOptionsAction, PasskeyControllerGenerateAuthenticationOptionsAction, PasskeyControllerProtectVaultKeyWithPasskeyAction, PasskeyControllerRetrieveVaultKeyWithPasskeyAction, PasskeyControllerUnlockWithPasskeyAction, PasskeyControllerExportSeedPhraseWithPasskeyAction, PasskeyControllerExportAccountsWithPasskeyAction, PasskeyControllerVerifyPasskeyAuthenticationAction, PasskeyControllerRenewVaultKeyProtectionAction, PasskeyControllerChangePasswordWithPasskeyVerificationAction, PasskeyControllerRemovePasskeyWithPasskeyVerificationAction, PasskeyControllerRemovePasskeyWithPasswordVerificationAction, PasskeyControllerClearStateAction, PasskeyControllerDestroyAction, } from "./PasskeyController-method-action-types.mjs";
|
|
8
|
-
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,6BAA6B,GAC9B,wBAAuB;AACxB,OAAO,EAAE,sBAAsB,EAAE,qBAAoB;AACrD,OAAO,EACL,iBAAiB,EACjB,gCAAgC,EAChC,0BAA0B,GAC3B,gCAA+B;AAChC,YAAY,EACV,sBAAsB,EACtB,0BAA0B,EAC1B,wBAAwB,EACxB,+BAA+B,EAC/B,wBAAwB,EACxB,kCAAkC,EAClC,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,yBAAyB,GAC1B,oBAAmB;AACpB,YAAY,EACV,0BAA0B,EAC1B,2BAA2B,EAC3B,4BAA4B,EAC5B,6BAA6B,GAC9B,6BAA4B;AAC7B,OAAO,EAAE,iCAAiC,EAAE,oDAAmD;AAC/F,YAAY,EACV,wCAAwC,EACxC,kDAAkD,EAClD,oEAAoE,EACpE,oDAAoD,EACpD,iDAAiD,EACjD,kDAAkD,EAClD,wCAAwC,EACxC,kDAAkD,EAClD,gDAAgD,EAChD,kDAAkD,EAClD,8CAA8C,EAC9C,4DAA4D,EAC5D,2DAA2D,EAC3D,4DAA4D,EAC5D,iCAAiC,EACjC,8BAA8B,GAC/B,oDAAmD"}
|
package/dist/index.mjs
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { PasskeyControllerErrorCode, PasskeyControllerErrorMessage } from "./constants.mjs";
|
|
2
|
-
export { PasskeyControllerError } from "./errors.mjs";
|
|
3
|
-
export { PasskeyController, getDefaultPasskeyControllerState, passkeyControllerSelectors } from "./PasskeyController.mjs";
|
|
4
|
-
export { getAAGUIDFromRegistrationResponse } from "./webauthn/verify-registration-response.mjs";
|
|
5
|
-
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,6BAA6B,EAC9B,wBAAuB;AACxB,OAAO,EAAE,sBAAsB,EAAE,qBAAoB;AACrD,OAAO,EACL,iBAAiB,EACjB,gCAAgC,EAChC,0BAA0B,EAC3B,gCAA+B;AAsBhC,OAAO,EAAE,iCAAiC,EAAE,oDAAmD","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"]}
|
package/dist/key-derivation.cjs
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deriveKeyFromAuthenticationResponse = void 0;
|
|
4
|
-
const constants_js_1 = require("./constants.cjs");
|
|
5
|
-
const errors_js_1 = require("./errors.cjs");
|
|
6
|
-
const crypto_js_1 = require("./utils/crypto.cjs");
|
|
7
|
-
const encoding_js_1 = require("./utils/encoding.cjs");
|
|
8
|
-
/**
|
|
9
|
-
* Derives an AES-256 wrapping key from a WebAuthn authentication ceremony
|
|
10
|
-
* response.
|
|
11
|
-
*
|
|
12
|
-
* The derivation method is determined by `record.keyDerivation`:
|
|
13
|
-
* - `prf` -- uses the PRF evaluation result from `clientExtensionResults`.
|
|
14
|
-
* - `userHandle` -- uses the `userHandle` returned in the assertion.
|
|
15
|
-
*
|
|
16
|
-
* @param authenticationResponse - The authentication credential result
|
|
17
|
-
* from `navigator.credentials.get()`.
|
|
18
|
-
* @param record - Credential id and key derivation parameters (ciphertext is
|
|
19
|
-
* not read).
|
|
20
|
-
* @returns The derived 32-byte AES wrapping key.
|
|
21
|
-
* @throws {@link PasskeyControllerError} with code `missing_key_material` if the
|
|
22
|
-
* required key material (PRF result or userHandle) is missing from the response.
|
|
23
|
-
*/
|
|
24
|
-
function deriveKeyFromAuthenticationResponse(authenticationResponse, record) {
|
|
25
|
-
const { userHandle } = authenticationResponse.response;
|
|
26
|
-
const prfFirst = authenticationResponse.clientExtensionResults?.prf?.results?.first;
|
|
27
|
-
const hasPrfOutput = typeof prfFirst === 'string' && prfFirst.length > 0;
|
|
28
|
-
let ikm;
|
|
29
|
-
if (record.keyDerivation.method === 'prf') {
|
|
30
|
-
if (!hasPrfOutput) {
|
|
31
|
-
throw new errors_js_1.PasskeyControllerError(constants_js_1.PasskeyControllerErrorMessage.MissingKeyMaterial, { code: constants_js_1.PasskeyControllerErrorCode.MissingKeyMaterial });
|
|
32
|
-
}
|
|
33
|
-
ikm = (0, encoding_js_1.base64URLToBytes)(prfFirst);
|
|
34
|
-
}
|
|
35
|
-
else if (userHandle) {
|
|
36
|
-
ikm = (0, encoding_js_1.base64URLToBytes)(userHandle);
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
throw new errors_js_1.PasskeyControllerError(constants_js_1.PasskeyControllerErrorMessage.MissingKeyMaterial, { code: constants_js_1.PasskeyControllerErrorCode.MissingKeyMaterial });
|
|
40
|
-
}
|
|
41
|
-
return (0, crypto_js_1.deriveEncryptionKey)(ikm, (0, encoding_js_1.base64URLToBytes)(record.credential.id));
|
|
42
|
-
}
|
|
43
|
-
exports.deriveKeyFromAuthenticationResponse = deriveKeyFromAuthenticationResponse;
|
|
44
|
-
//# sourceMappingURL=key-derivation.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"key-derivation.cjs","sourceRoot":"","sources":["../src/key-derivation.ts"],"names":[],"mappings":";;;AAAA,kDAGwB;AACxB,4CAAqD;AAErD,kDAAwD;AACxD,sDAAuD;AAGvD;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,mCAAmC,CACjD,sBAAqD,EACrD,MAA2D;IAE3D,MAAM,EAAE,UAAU,EAAE,GAAG,sBAAsB,CAAC,QAAQ,CAAC;IACvD,MAAM,QAAQ,GACZ,sBAAsB,CAAC,sBACxB,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,CAAC;IACvB,MAAM,YAAY,GAAG,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;IAEzE,IAAI,GAAe,CAAC;IACpB,IAAI,MAAM,CAAC,aAAa,CAAC,MAAM,KAAK,KAAK,EAAE,CAAC;QAC1C,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,MAAM,IAAI,kCAAsB,CAC9B,4CAA6B,CAAC,kBAAkB,EAChD,EAAE,IAAI,EAAE,yCAA0B,CAAC,kBAAkB,EAAE,CACxD,CAAC;QACJ,CAAC;QACD,GAAG,GAAG,IAAA,8BAAgB,EAAC,QAAQ,CAAC,CAAC;IACnC,CAAC;SAAM,IAAI,UAAU,EAAE,CAAC;QACtB,GAAG,GAAG,IAAA,8BAAgB,EAAC,UAAU,CAAC,CAAC;IACrC,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,kCAAsB,CAC9B,4CAA6B,CAAC,kBAAkB,EAChD,EAAE,IAAI,EAAE,yCAA0B,CAAC,kBAAkB,EAAE,CACxD,CAAC;IACJ,CAAC;IAED,OAAO,IAAA,+BAAmB,EAAC,GAAG,EAAE,IAAA,8BAAgB,EAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC;AAC1E,CAAC;AA7BD,kFA6BC","sourcesContent":["import {\n PasskeyControllerErrorCode,\n PasskeyControllerErrorMessage,\n} from './constants.js';\nimport { PasskeyControllerError } from './errors.js';\nimport type { PasskeyRecord, PrfClientExtensionResults } from './types.js';\nimport { deriveEncryptionKey } from './utils/crypto.js';\nimport { base64URLToBytes } from './utils/encoding.js';\nimport type { PasskeyAuthenticationResponse } from './webauthn/types.js';\n\n/**\n * Derives an AES-256 wrapping key from a WebAuthn authentication ceremony\n * response.\n *\n * The derivation method is determined by `record.keyDerivation`:\n * - `prf` -- uses the PRF evaluation result from `clientExtensionResults`.\n * - `userHandle` -- uses the `userHandle` returned in the assertion.\n *\n * @param authenticationResponse - The authentication credential result\n * from `navigator.credentials.get()`.\n * @param record - Credential id and key derivation parameters (ciphertext is\n * not read).\n * @returns The derived 32-byte AES wrapping key.\n * @throws {@link PasskeyControllerError} with code `missing_key_material` if the\n * required key material (PRF result or userHandle) is missing from the response.\n */\nexport function deriveKeyFromAuthenticationResponse(\n authenticationResponse: PasskeyAuthenticationResponse,\n record: Pick<PasskeyRecord, 'credential' | 'keyDerivation'>,\n): Uint8Array {\n const { userHandle } = authenticationResponse.response;\n const prfFirst = (\n authenticationResponse.clientExtensionResults as PrfClientExtensionResults\n )?.prf?.results?.first;\n const hasPrfOutput = typeof prfFirst === 'string' && prfFirst.length > 0;\n\n let ikm: Uint8Array;\n if (record.keyDerivation.method === 'prf') {\n if (!hasPrfOutput) {\n throw new PasskeyControllerError(\n PasskeyControllerErrorMessage.MissingKeyMaterial,\n { code: PasskeyControllerErrorCode.MissingKeyMaterial },\n );\n }\n ikm = base64URLToBytes(prfFirst);\n } else if (userHandle) {\n ikm = base64URLToBytes(userHandle);\n } else {\n throw new PasskeyControllerError(\n PasskeyControllerErrorMessage.MissingKeyMaterial,\n { code: PasskeyControllerErrorCode.MissingKeyMaterial },\n );\n }\n\n return deriveEncryptionKey(ikm, base64URLToBytes(record.credential.id));\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"key-derivation.d.cts","sourceRoot":"","sources":["../src/key-derivation.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAA6B,oBAAmB;AAG3E,OAAO,KAAK,EAAE,6BAA6B,EAAE,6BAA4B;AAEzE;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mCAAmC,CACjD,sBAAsB,EAAE,6BAA6B,EACrD,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,YAAY,GAAG,eAAe,CAAC,GAC1D,UAAU,CA0BZ"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { PasskeyRecord } from "./types.mjs";
|
|
2
|
-
import type { PasskeyAuthenticationResponse } from "./webauthn/types.mjs";
|
|
3
|
-
/**
|
|
4
|
-
* Derives an AES-256 wrapping key from a WebAuthn authentication ceremony
|
|
5
|
-
* response.
|
|
6
|
-
*
|
|
7
|
-
* The derivation method is determined by `record.keyDerivation`:
|
|
8
|
-
* - `prf` -- uses the PRF evaluation result from `clientExtensionResults`.
|
|
9
|
-
* - `userHandle` -- uses the `userHandle` returned in the assertion.
|
|
10
|
-
*
|
|
11
|
-
* @param authenticationResponse - The authentication credential result
|
|
12
|
-
* from `navigator.credentials.get()`.
|
|
13
|
-
* @param record - Credential id and key derivation parameters (ciphertext is
|
|
14
|
-
* not read).
|
|
15
|
-
* @returns The derived 32-byte AES wrapping key.
|
|
16
|
-
* @throws {@link PasskeyControllerError} with code `missing_key_material` if the
|
|
17
|
-
* required key material (PRF result or userHandle) is missing from the response.
|
|
18
|
-
*/
|
|
19
|
-
export declare function deriveKeyFromAuthenticationResponse(authenticationResponse: PasskeyAuthenticationResponse, record: Pick<PasskeyRecord, 'credential' | 'keyDerivation'>): Uint8Array;
|
|
20
|
-
//# sourceMappingURL=key-derivation.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"key-derivation.d.mts","sourceRoot":"","sources":["../src/key-derivation.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAA6B,oBAAmB;AAG3E,OAAO,KAAK,EAAE,6BAA6B,EAAE,6BAA4B;AAEzE;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mCAAmC,CACjD,sBAAsB,EAAE,6BAA6B,EACrD,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,YAAY,GAAG,eAAe,CAAC,GAC1D,UAAU,CA0BZ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"key-derivation.mjs","sourceRoot":"","sources":["../src/key-derivation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,6BAA6B,EAC9B,wBAAuB;AACxB,OAAO,EAAE,sBAAsB,EAAE,qBAAoB;AAErD,OAAO,EAAE,mBAAmB,EAAE,2BAA0B;AACxD,OAAO,EAAE,gBAAgB,EAAE,6BAA4B;AAGvD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,mCAAmC,CACjD,sBAAqD,EACrD,MAA2D;IAE3D,MAAM,EAAE,UAAU,EAAE,GAAG,sBAAsB,CAAC,QAAQ,CAAC;IACvD,MAAM,QAAQ,GACZ,sBAAsB,CAAC,sBACxB,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,CAAC;IACvB,MAAM,YAAY,GAAG,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;IAEzE,IAAI,GAAe,CAAC;IACpB,IAAI,MAAM,CAAC,aAAa,CAAC,MAAM,KAAK,KAAK,EAAE,CAAC;QAC1C,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,MAAM,IAAI,sBAAsB,CAC9B,6BAA6B,CAAC,kBAAkB,EAChD,EAAE,IAAI,EAAE,0BAA0B,CAAC,kBAAkB,EAAE,CACxD,CAAC;QACJ,CAAC;QACD,GAAG,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACnC,CAAC;SAAM,IAAI,UAAU,EAAE,CAAC;QACtB,GAAG,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACrC,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,sBAAsB,CAC9B,6BAA6B,CAAC,kBAAkB,EAChD,EAAE,IAAI,EAAE,0BAA0B,CAAC,kBAAkB,EAAE,CACxD,CAAC;IACJ,CAAC;IAED,OAAO,mBAAmB,CAAC,GAAG,EAAE,gBAAgB,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC;AAC1E,CAAC","sourcesContent":["import {\n PasskeyControllerErrorCode,\n PasskeyControllerErrorMessage,\n} from './constants.js';\nimport { PasskeyControllerError } from './errors.js';\nimport type { PasskeyRecord, PrfClientExtensionResults } from './types.js';\nimport { deriveEncryptionKey } from './utils/crypto.js';\nimport { base64URLToBytes } from './utils/encoding.js';\nimport type { PasskeyAuthenticationResponse } from './webauthn/types.js';\n\n/**\n * Derives an AES-256 wrapping key from a WebAuthn authentication ceremony\n * response.\n *\n * The derivation method is determined by `record.keyDerivation`:\n * - `prf` -- uses the PRF evaluation result from `clientExtensionResults`.\n * - `userHandle` -- uses the `userHandle` returned in the assertion.\n *\n * @param authenticationResponse - The authentication credential result\n * from `navigator.credentials.get()`.\n * @param record - Credential id and key derivation parameters (ciphertext is\n * not read).\n * @returns The derived 32-byte AES wrapping key.\n * @throws {@link PasskeyControllerError} with code `missing_key_material` if the\n * required key material (PRF result or userHandle) is missing from the response.\n */\nexport function deriveKeyFromAuthenticationResponse(\n authenticationResponse: PasskeyAuthenticationResponse,\n record: Pick<PasskeyRecord, 'credential' | 'keyDerivation'>,\n): Uint8Array {\n const { userHandle } = authenticationResponse.response;\n const prfFirst = (\n authenticationResponse.clientExtensionResults as PrfClientExtensionResults\n )?.prf?.results?.first;\n const hasPrfOutput = typeof prfFirst === 'string' && prfFirst.length > 0;\n\n let ikm: Uint8Array;\n if (record.keyDerivation.method === 'prf') {\n if (!hasPrfOutput) {\n throw new PasskeyControllerError(\n PasskeyControllerErrorMessage.MissingKeyMaterial,\n { code: PasskeyControllerErrorCode.MissingKeyMaterial },\n );\n }\n ikm = base64URLToBytes(prfFirst);\n } else if (userHandle) {\n ikm = base64URLToBytes(userHandle);\n } else {\n throw new PasskeyControllerError(\n PasskeyControllerErrorMessage.MissingKeyMaterial,\n { code: PasskeyControllerErrorCode.MissingKeyMaterial },\n );\n }\n\n return deriveEncryptionKey(ikm, base64URLToBytes(record.credential.id));\n}\n"]}
|
package/dist/logger.cjs
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* istanbul ignore file */
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.createModuleLogger = exports.projectLogger = void 0;
|
|
5
|
-
const utils_1 = require("@metamask/utils");
|
|
6
|
-
Object.defineProperty(exports, "createModuleLogger", { enumerable: true, get: function () { return utils_1.createModuleLogger; } });
|
|
7
|
-
const constants_js_1 = require("./constants.cjs");
|
|
8
|
-
exports.projectLogger = (0, utils_1.createProjectLogger)(constants_js_1.controllerName);
|
|
9
|
-
//# sourceMappingURL=logger.cjs.map
|
package/dist/logger.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logger.cjs","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";AAAA,0BAA0B;;;AAE1B,2CAA0E;AAMjE,mGANqB,0BAAkB,OAMrB;AAJ3B,kDAAgD;AAEnC,QAAA,aAAa,GAAG,IAAA,2BAAmB,EAAC,6BAAc,CAAC,CAAC","sourcesContent":["/* istanbul ignore file */\n\nimport { createProjectLogger, createModuleLogger } from '@metamask/utils';\n\nimport { controllerName } from './constants.js';\n\nexport const projectLogger = createProjectLogger(controllerName);\n\nexport { createModuleLogger };\n"]}
|
package/dist/logger.d.cts
DELETED
package/dist/logger.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.cts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";AAEA,OAAO,EAAuB,kBAAkB,EAAE,wBAAwB;AAI1E,eAAO,MAAM,aAAa,0BAAsC,CAAC;AAEjE,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
package/dist/logger.d.mts
DELETED
package/dist/logger.d.mts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.mts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";AAEA,OAAO,EAAuB,kBAAkB,EAAE,wBAAwB;AAI1E,eAAO,MAAM,aAAa,0BAAsC,CAAC;AAEjE,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
package/dist/logger.mjs
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/* istanbul ignore file */
|
|
2
|
-
import { createProjectLogger, createModuleLogger } from "@metamask/utils";
|
|
3
|
-
import { controllerName } from "./constants.mjs";
|
|
4
|
-
export const projectLogger = createProjectLogger(controllerName);
|
|
5
|
-
export { createModuleLogger };
|
|
6
|
-
//# sourceMappingURL=logger.mjs.map
|
package/dist/logger.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logger.mjs","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAE1B,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,wBAAwB;AAE1E,OAAO,EAAE,cAAc,EAAE,wBAAuB;AAEhD,MAAM,CAAC,MAAM,aAAa,GAAG,mBAAmB,CAAC,cAAc,CAAC,CAAC;AAEjE,OAAO,EAAE,kBAAkB,EAAE,CAAC","sourcesContent":["/* istanbul ignore file */\n\nimport { createProjectLogger, createModuleLogger } from '@metamask/utils';\n\nimport { controllerName } from './constants.js';\n\nexport const projectLogger = createProjectLogger(controllerName);\n\nexport { createModuleLogger };\n"]}
|
package/dist/types.cjs
DELETED
package/dist/types.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;AAcA,kDAAgD","sourcesContent":["import type {\n ControllerGetStateAction,\n ControllerStateChangedEvent,\n} from '@metamask/base-controller';\nimport type {\n KeyringControllerChangePasswordAction,\n KeyringControllerExportAccountAction,\n KeyringControllerExportEncryptionKeyAction,\n KeyringControllerExportSeedPhraseAction,\n KeyringControllerSubmitEncryptionKeyAction,\n KeyringControllerVerifyPasswordAction,\n} from '@metamask/keyring-controller';\nimport type { Messenger } from '@metamask/messenger';\n\nimport { controllerName } from './constants.js';\nimport type { PasskeyControllerMethodActions } from './PasskeyController-method-action-types.js';\n\nexport type Base64String = string;\n\nexport type Base64URLString = string;\n\nexport type AuthenticatorTransportFuture =\n | 'ble'\n | 'cable'\n | 'hybrid'\n | 'internal'\n | 'nfc'\n | 'smart-card'\n | 'usb';\n\n/**\n * WebAuthn credential metadata used to identify the passkey and verify\n * subsequent assertions.\n */\nexport type PasskeyCredentialInfo = {\n /** WebAuthn credential ID (base64url). */\n id: Base64URLString;\n /** COSE-encoded credential public key (base64url) used to verify assertions. */\n publicKey: Base64URLString;\n /** Authenticator signature counter for replay/clone detection. */\n counter: number;\n /** Authenticator transports hint for `allowCredentials`. */\n transports?: AuthenticatorTransportFuture[];\n /** Authenticator AAGUID captured from attested credential data at registration. */\n aaguid: string;\n};\n\n/**\n * Vault key wrapped under the passkey-derived AES-256-GCM key.\n */\nexport type EncryptedVaultKey = {\n /** Base64-encoded AES-256-GCM ciphertext of the vault key. */\n ciphertext: Base64String;\n /** Base64-encoded AES-GCM IV used during encryption. */\n iv: Base64String;\n};\n\n/**\n * Parameters needed to reproduce the AES-256 wrapping key at unlock time.\n *\n * Encoded as a discriminated union so PRF-only fields (e.g. `prfSalt`) can\n * only exist on the PRF branch, removing the \"optional but actually\n * required\" footgun.\n */\nexport type PasskeyKeyDerivation =\n | {\n method: 'prf';\n /**\n * PRF salt sent in `get()` extension options to reproduce the same PRF\n * output that was generated at registration.\n */\n prfSalt: Base64URLString;\n }\n | { method: 'userHandle' };\n\n/** Discriminator value for {@link PasskeyKeyDerivation}. */\nexport type PasskeyDerivationMethod = PasskeyKeyDerivation['method'];\n\nexport type PasskeyRecord = {\n /** WebAuthn credential metadata used for assertion verification & re-discovery. */\n credential: PasskeyCredentialInfo;\n /** Vault key wrapped under the passkey-derived key. */\n encryptedVaultKey: EncryptedVaultKey;\n /** How the wrapping key is reconstructed at unlock time. */\n keyDerivation: PasskeyKeyDerivation;\n};\n\n/**\n * In-memory state for one **in-flight** WebAuthn **registration** ceremony\n * (from `create()` options until `protectVaultKeyWithPasskey` completes). This is\n * not a user login session; it is keyed by challenge and distinct from the full\n * spec ceremony (which includes the authenticator round-trip).\n */\nexport type PasskeyRegistrationCeremony = {\n userHandle: Base64URLString;\n prfSalt?: Base64URLString;\n challenge: Base64URLString;\n /** When this ceremony was started (ms since epoch); used for TTL pruning. */\n createdAt: number;\n};\n\n/**\n * In-memory state for one **in-flight** WebAuthn **authentication** ceremony\n * (`get()` options until the assertion is verified). Not a user login session.\n */\nexport type PasskeyAuthenticationCeremony = {\n challenge: Base64URLString;\n /** When this ceremony was started (ms since epoch); used for TTL pruning. */\n createdAt: number;\n};\n\n/**\n * PRF extension types not covered by DOM typings.\n */\nexport type PrfEvalExtension = {\n eval: {\n first: Base64URLString;\n };\n};\n\nexport type PrfClientExtensionResults = {\n prf?: {\n enabled?: boolean;\n results?: { first?: Base64URLString };\n };\n};\n\nexport type PasskeyControllerState = {\n passkeyRecord: PasskeyRecord | null;\n};\n\nexport type PasskeyControllerGetStateAction = ControllerGetStateAction<\n typeof controllerName,\n PasskeyControllerState\n>;\n\n/**\n * KeyringController actions that {@link PasskeyController} may call during\n * orchestrated passkey flows. The restricted messenger must allow these at init.\n */\nexport type PasskeyControllerAllowedActions =\n | KeyringControllerVerifyPasswordAction\n | KeyringControllerExportEncryptionKeyAction\n | KeyringControllerSubmitEncryptionKeyAction\n | KeyringControllerChangePasswordAction\n | KeyringControllerExportSeedPhraseAction\n | KeyringControllerExportAccountAction;\n\n/**\n * Actions exposed by {@link PasskeyController} on its messenger, including\n * `:getState`, enrollment/unlock ceremony methods, and lifecycle helpers.\n */\nexport type PasskeyControllerActions =\n | PasskeyControllerGetStateAction\n | PasskeyControllerMethodActions;\n\nexport type PasskeyControllerStateChangedEvent = ControllerStateChangedEvent<\n typeof controllerName,\n PasskeyControllerState\n>;\n\nexport type PasskeyControllerEvents = PasskeyControllerStateChangedEvent;\n\nexport type PasskeyControllerMessenger = Messenger<\n typeof controllerName,\n PasskeyControllerActions | PasskeyControllerAllowedActions,\n PasskeyControllerEvents\n>;\n\nexport type PasskeyControllerOptions = {\n messenger: PasskeyControllerMessenger;\n state?: Partial<PasskeyControllerState>;\n rpId?: string;\n expectedRPID: string | string[];\n rpName: string;\n expectedOrigin: string | string[];\n userName?: string;\n userDisplayName?: string;\n /**\n * Returns whether wallet onboarding is complete. When `true`, enrollment\n * requires password step-up. The integrator typically supplies\n * `() => onboardingController.state.completedOnboarding`.\n */\n getIsOnboardingCompleted: () => boolean;\n};\n"]}
|