@metamask-previews/kyc-controller 0.0.0-preview-965e373 → 0.0.0-preview-8c2a2eeb2

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.
Files changed (38) hide show
  1. package/CHANGELOG.md +0 -1
  2. package/dist/KycController.cjs +2 -20
  3. package/dist/KycController.cjs.map +1 -1
  4. package/dist/KycController.d.cts.map +1 -1
  5. package/dist/KycController.d.mts.map +1 -1
  6. package/dist/KycController.mjs +2 -20
  7. package/dist/KycController.mjs.map +1 -1
  8. package/dist/KycService-method-action-types.cjs.map +1 -1
  9. package/dist/KycService-method-action-types.d.cts +1 -4
  10. package/dist/KycService-method-action-types.d.cts.map +1 -1
  11. package/dist/KycService-method-action-types.d.mts +1 -4
  12. package/dist/KycService-method-action-types.d.mts.map +1 -1
  13. package/dist/KycService-method-action-types.mjs.map +1 -1
  14. package/dist/KycService.cjs +1 -6
  15. package/dist/KycService.cjs.map +1 -1
  16. package/dist/KycService.d.cts +1 -14
  17. package/dist/KycService.d.cts.map +1 -1
  18. package/dist/KycService.d.mts +1 -14
  19. package/dist/KycService.d.mts.map +1 -1
  20. package/dist/KycService.mjs +1 -6
  21. package/dist/KycService.mjs.map +1 -1
  22. package/dist/ukyc/wrapEncryptionKey.cjs +3 -2
  23. package/dist/ukyc/wrapEncryptionKey.cjs.map +1 -1
  24. package/dist/ukyc/wrapEncryptionKey.d.cts +9 -6
  25. package/dist/ukyc/wrapEncryptionKey.d.cts.map +1 -1
  26. package/dist/ukyc/wrapEncryptionKey.d.mts +9 -6
  27. package/dist/ukyc/wrapEncryptionKey.d.mts.map +1 -1
  28. package/dist/ukyc/wrapEncryptionKey.mjs +3 -2
  29. package/dist/ukyc/wrapEncryptionKey.mjs.map +1 -1
  30. package/dist/ukyc/wrapUserKey.cjs +80 -0
  31. package/dist/ukyc/wrapUserKey.cjs.map +1 -0
  32. package/dist/ukyc/wrapUserKey.d.cts +26 -0
  33. package/dist/ukyc/wrapUserKey.d.cts.map +1 -0
  34. package/dist/ukyc/wrapUserKey.d.mts +26 -0
  35. package/dist/ukyc/wrapUserKey.d.mts.map +1 -0
  36. package/dist/ukyc/wrapUserKey.mjs +76 -0
  37. package/dist/ukyc/wrapUserKey.mjs.map +1 -0
  38. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -29,7 +29,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
29
29
 
30
30
  ### Changed
31
31
 
32
- - **BREAKING:** Require `sessionClientPublicKey` (unpadded base64url X25519 public key) and `residenceCountry` (ISO 3166-1 alpha-3) on `KycService.createUkycSession` (`POST /sessions`). The controller generates the per-session keypair before creating the session and uses the private half to wrap authorizations; residence country is taken from the resolved geo country. ([#9993](https://github.com/MetaMask/core/pull/9993))
33
32
  - **BREAKING:** Replace wrapping-key exchange (`KycService.getWrappingKey`) and sending wrapped keys at session creation with encryption schemas from `createUkycSession` plus `setAuthorizations` (`POST /sessions/{id}/authorizations`). `createUkycSession` no longer accepts `wrappedEncryptionKey` or `ukycCapabilityToken`; both secrets are wrapped on the client against per-secret schemas and posted separately. ([#9944](https://github.com/MetaMask/core/pull/9944))
34
33
  - **BREAKING:** Replace `KycService.submitConsents` (`POST /consents`) with session-scoped `fetchSessionDisclaimers` / `submitSessionDisclaimers` plus vendor T&C recording via `submitVendorDisclaimers`. Consents now use `{ key, version }` document records plus `credentialReusabilityConsentGiven` instead of Iron disclaimer ids and boolean T&C flags, and they require a UKYC session id. Iron content ids are posted separately to `POST /vendors/{vendor}/disclaimers`. The consents path records vendor T&Cs, then creates the UKYC session, then records session disclaimers. A 409 conflict is re-checked with a GET and only treated as success when every accepted document is consented. ([#9979](https://github.com/MetaMask/core/pull/9979))
35
34
  - Make the `fetch` option on the `KycService` constructor optional; it now defaults to the runtime's native `fetch` (browser, React Native, Node 18+), so consumers no longer need to inject one. ([#9908](https://github.com/MetaMask/core/pull/9908))
@@ -17,7 +17,6 @@ const base_controller_1 = require("@metamask/base-controller");
17
17
  const utils_1 = require("@metamask/utils");
18
18
  const ed25519_1 = require("@noble/curves/ed25519");
19
19
  const crypto_js_1 = require("./crypto.cjs");
20
- const encoding_js_1 = require("./encoding.cjs");
21
20
  const deriveClientMaterial_js_1 = require("./ukyc/deriveClientMaterial.cjs");
22
21
  const jwtChain_js_1 = require("./ukyc/jwtChain.cjs");
23
22
  const localUserSecret_js_1 = require("./ukyc/localUserSecret.cjs");
@@ -1601,28 +1600,11 @@ async function _KycController_continueAfterAuthentication() {
1601
1600
  async function _KycController_createUkycSession(generation) {
1602
1601
  const jwtToken = MOCK_JWT_TOKEN;
1603
1602
  // Establish a per-session X25519 keypair used to seal both secrets. The
1604
- // private half stays on the device; the public half is registered on the
1605
- // session so the server can open later authorizations. Each encryption
1606
- // schema from session creation supplies the matching server public key.
1603
+ // private half stays on the device; each encryption schema from session
1604
+ // creation supplies the matching server public key.
1607
1605
  const sessionClientPrivateKey = ed25519_1.x25519.utils.randomSecretKey();
1608
- const sessionClientPublicKey = (0, encoding_js_1.toBase64Url)(ed25519_1.x25519.getPublicKey(sessionClientPrivateKey));
1609
- // Residence is the ISO 3166-1 alpha-3 country already resolved for
1610
- // disclaimers / KYC-required; fetch it if this sub-flow started without
1611
- // that earlier step.
1612
- const residenceCountry = this.state.geoCountry ??
1613
- (await this.messenger.call('KycService:getGeoCountry'));
1614
- if (__classPrivateFieldGet(this, _KycController_generation, "f") !== generation) {
1615
- return null;
1616
- }
1617
- if (residenceCountry !== this.state.geoCountry) {
1618
- __classPrivateFieldGet(this, _KycController_instances, "m", _KycController_updateIfCurrent).call(this, generation, (state) => {
1619
- state.geoCountry = residenceCountry;
1620
- });
1621
- }
1622
1606
  const { sessionId, encryptionDataKey, ukycCapabilityToken: capabilityTokenSchema, } = await this.messenger.call('KycService:createUkycSession', {
1623
1607
  jwtToken,
1624
- sessionClientPublicKey,
1625
- residenceCountry,
1626
1608
  ...__classPrivateFieldGet(this, _KycController_instances, "m", _KycController_buildUkycSessionVendorFields).call(this),
1627
1609
  });
1628
1610
  if (__classPrivateFieldGet(this, _KycController_generation, "f") !== generation) {