@metamask-previews/kyc-controller 0.0.0-preview-a302de5c3 → 0.0.0-preview-b63fbdb38
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 -5
- package/dist/KycController.cjs +5 -6
- package/dist/KycController.cjs.map +1 -1
- package/dist/KycController.d.cts +3 -3
- package/dist/KycController.d.cts.map +1 -1
- package/dist/KycController.d.mts +3 -3
- package/dist/KycController.d.mts.map +1 -1
- package/dist/KycController.mjs +5 -6
- package/dist/KycController.mjs.map +1 -1
- package/dist/KycService-method-action-types.cjs.map +1 -1
- package/dist/KycService-method-action-types.d.cts +6 -23
- package/dist/KycService-method-action-types.d.cts.map +1 -1
- package/dist/KycService-method-action-types.d.mts +6 -23
- package/dist/KycService-method-action-types.d.mts.map +1 -1
- package/dist/KycService-method-action-types.mjs.map +1 -1
- package/dist/KycService.cjs +118 -91
- package/dist/KycService.cjs.map +1 -1
- package/dist/KycService.d.cts +12 -38
- package/dist/KycService.d.cts.map +1 -1
- package/dist/KycService.d.mts +12 -38
- package/dist/KycService.d.mts.map +1 -1
- package/dist/KycService.mjs +118 -91
- package/dist/KycService.mjs.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +6 -15
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +6 -15
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs.map +1 -1
- package/dist/ukyc/wrapEncryptionKey.cjs +9 -4
- package/dist/ukyc/wrapEncryptionKey.cjs.map +1 -1
- package/dist/ukyc/wrapEncryptionKey.d.cts +10 -8
- package/dist/ukyc/wrapEncryptionKey.d.cts.map +1 -1
- package/dist/ukyc/wrapEncryptionKey.d.mts +10 -8
- package/dist/ukyc/wrapEncryptionKey.d.mts.map +1 -1
- package/dist/ukyc/wrapEncryptionKey.mjs +9 -4
- package/dist/ukyc/wrapEncryptionKey.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/logger.cjs +0 -9
- package/dist/logger.cjs.map +0 -1
- package/dist/logger.d.cts +0 -6
- package/dist/logger.d.cts.map +0 -1
- package/dist/logger.d.mts +0 -6
- package/dist/logger.d.mts.map +0 -1
- package/dist/logger.mjs +0 -6
- package/dist/logger.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -30,8 +30,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
30
30
|
|
|
31
31
|
### Changed
|
|
32
32
|
|
|
33
|
-
- Add `KycService.fetchDisclaimersCatalog` / `KycService:fetchDisclaimersCatalog` (`GET /disclaimers?country=`, ISO 3166-1 alpha-3) for the pre-session idOS + KYC-provider catalog, plus the `KycDisclaimersCatalog` type (no `credentialReusabilityConsentGiven`). `fetchSessionDisclaimers` remains session-scoped (`GET /sessions/{sessionId}/disclaimers` → `KycSessionDisclaimers`). ([#10011](https://github.com/MetaMask/core/pull/10011))
|
|
34
|
-
- **BREAKING:** Rename `KycService.fetchDisclaimers` / `KycService:fetchDisclaimers` / `KycServiceFetchDisclaimersAction` to `fetchVendorDisclaimers` / `KycService:fetchVendorDisclaimers` / `KycServiceFetchVendorDisclaimersAction`. ([#10011](https://github.com/MetaMask/core/pull/10011))
|
|
35
33
|
- **BREAKING:** Rename `fractalEncryptionBaseUrl` to `idosEnclaveBaseUrl`, `KycService.fetchJwks` / `KycService:fetchJwks` / `KycServiceFetchJwksAction` to `fetchIdosEnclaveJwks` / `KycService:fetchIdosEnclaveJwks` / `KycServiceFetchIdosEnclaveJwksAction`, and related Fractal encryption naming to idOS enclave. ([#10008](https://github.com/MetaMask/core/pull/10008))
|
|
36
34
|
- **BREAKING:** Verify `encryptionDataKey` against idOS enclave JWKS (`KycService:fetchIdosEnclaveJwks` / `idosEnclaveBaseUrl`) and `ukycCapabilityToken` against idOS relay JWKS (`KycService:fetchIdosRelayJwks` / `idosRelayBaseUrl`) when wrapping UKYC authorizations, instead of validating both schemas against Fractal. Hosts must supply `idosRelayBaseUrl` on `KycService` construction (same class of requirement as `idosEnclaveBaseUrl`). ([#10008](https://github.com/MetaMask/core/pull/10008))
|
|
37
35
|
- **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))
|
|
@@ -42,12 +40,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
42
40
|
- **BREAKING:** Require `sumsubTncSigned` and `idosTncSigned` on `acceptTermsAndStartSession` for every vendor, so callers explicitly declare T&C2 acceptance. Zero-argument calls and omitted flags fail instead of defaulting to `true`. ([#9908](https://github.com/MetaMask/core/pull/9908))
|
|
43
41
|
- Rename `CreateUkycSessionParams.vendorId` to `vendor` for consistency with other service methods. ([#9908](https://github.com/MetaMask/core/pull/9908))
|
|
44
42
|
- Bump `@metamask/base-data-service` from `^0.1.3` to `^1.0.0` ([#9972](https://github.com/MetaMask/core/pull/9972))
|
|
45
|
-
- Replace `KycController` `console.error` tracing with the `@metamask/utils` debug logger (`createProjectLogger` / `createModuleLogger`), so flow diagnostics are opt-in via `DEBUG=kyc-controller*` instead of always printing to the console. ([#10054](https://github.com/MetaMask/core/pull/10054))
|
|
46
43
|
|
|
47
44
|
### Fixed
|
|
48
45
|
|
|
49
|
-
- Stop routing `KycService` write endpoints through the query cache. Every `POST` (`createSession`, `checkKycRequired`, `createVendorCustomer`, `submitVendorDisclaimers`, `submitSessionDisclaimers`, `createUkycSession`, `setAuthorizations`, `createJourney`) now issues its request directly instead of via `fetchQuery`. Previously these were modelled as queries, so two overlapping calls sharing a `queryKey` were deduplicated into a single request — a second `createVendorCustomer` while the first was in flight never reached the API — and their responses were retained in the cache and published on the messenger as `cacheUpdated` payloads, which for these endpoints include session tokens and applicant access tokens. Writes are also no longer retried by the service policy, so a failed non-idempotent request cannot create duplicate records server-side. ([#10007](https://github.com/MetaMask/core/pull/10007))
|
|
50
|
-
- Stop incorrectly prefixing the session client public key onto wrapped `encryptionDataKey` and `ukycCapabilityToken` values from `wrapEncryptionKey`. `data` is now ciphertext+tag only; the server already has the client public key from session creation. ([#10036](https://github.com/MetaMask/core/pull/10036))
|
|
51
46
|
- Clear leftover MoonPay `sessionToken`, `accessToken`, and Check/Auth frame credentials when `initialize` or `createVendorCustomer` switches to another vendor, so `buildCheckFrameUrl` cannot return a MoonPay URL for a consents-path session. ([#9908](https://github.com/MetaMask/core/pull/9908))
|
|
52
47
|
- Rewind the consents path when SumSub fails before completion (thrown step or SDK close without `Completed`), instead of refreshing user status and forcing `phase` to `done`. A terminal UKYC rejection after the SDK completed still finishes as `done` so the decision can be reflected in user status. ([#9908](https://github.com/MetaMask/core/pull/9908))
|
|
53
48
|
- Make `createVendorCustomer` a no-op during in-progress phases (matching `initialize`), so a vendor switch cannot leave Check/Auth frames attached to the wrong vendor. ([#9908](https://github.com/MetaMask/core/pull/9908))
|
package/dist/KycController.cjs
CHANGED
|
@@ -18,7 +18,6 @@ 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
20
|
const encoding_js_1 = require("./encoding.cjs");
|
|
21
|
-
const logger_js_1 = require("./logger.cjs");
|
|
22
21
|
const deriveClientMaterial_js_1 = require("./ukyc/deriveClientMaterial.cjs");
|
|
23
22
|
const jwtChain_js_1 = require("./ukyc/jwtChain.cjs");
|
|
24
23
|
const localUserSecret_js_1 = require("./ukyc/localUserSecret.cjs");
|
|
@@ -644,7 +643,7 @@ class KycController extends base_controller_1.BaseController {
|
|
|
644
643
|
state.geoCountry = country;
|
|
645
644
|
});
|
|
646
645
|
}
|
|
647
|
-
const disclaimers = await this.messenger.call('KycService:
|
|
646
|
+
const disclaimers = await this.messenger.call('KycService:fetchDisclaimers', {
|
|
648
647
|
vendor: this.state.activeVendor,
|
|
649
648
|
country,
|
|
650
649
|
});
|
|
@@ -1243,7 +1242,7 @@ async function _KycController_startConsentsSession(consents) {
|
|
|
1243
1242
|
await this.refreshKycStatus();
|
|
1244
1243
|
}
|
|
1245
1244
|
catch (statusError) {
|
|
1246
|
-
|
|
1245
|
+
console.error('KYC status refresh failed:', statusError);
|
|
1247
1246
|
}
|
|
1248
1247
|
__classPrivateFieldGet(this, _KycController_instances, "m", _KycController_updateIfCurrent).call(this, generation, (state) => {
|
|
1249
1248
|
state.phase = 'done';
|
|
@@ -1279,7 +1278,7 @@ async function _KycController_startConsentsSession(consents) {
|
|
|
1279
1278
|
await this.refreshKycStatus();
|
|
1280
1279
|
}
|
|
1281
1280
|
catch (statusError) {
|
|
1282
|
-
|
|
1281
|
+
console.error('KYC status refresh failed:', statusError);
|
|
1283
1282
|
}
|
|
1284
1283
|
__classPrivateFieldGet(this, _KycController_instances, "m", _KycController_updateIfCurrent).call(this, generation, (state) => {
|
|
1285
1284
|
if (state.phase !== 'error' && state.phase !== 'done') {
|
|
@@ -1307,7 +1306,7 @@ async function _KycController_startConsentsSession(consents) {
|
|
|
1307
1306
|
});
|
|
1308
1307
|
return;
|
|
1309
1308
|
}
|
|
1310
|
-
|
|
1309
|
+
console.error('Consents session failed:', error);
|
|
1311
1310
|
if (__classPrivateFieldGet(this, _KycController_generation, "f") !== generation) {
|
|
1312
1311
|
return;
|
|
1313
1312
|
}
|
|
@@ -1438,7 +1437,7 @@ async function _KycController_createSession() {
|
|
|
1438
1437
|
});
|
|
1439
1438
|
}
|
|
1440
1439
|
catch (error) {
|
|
1441
|
-
|
|
1440
|
+
console.error('Session creation failed:', error);
|
|
1442
1441
|
// A reset() superseded this flow while the request was in flight; leave
|
|
1443
1442
|
// the idle controller alone rather than forcing it back to `terms`.
|
|
1444
1443
|
if (__classPrivateFieldGet(this, _KycController_generation, "f") !== generation) {
|