@sphereon/ssi-sdk.oid4vci-holder 0.34.1-next.299 → 0.34.1-next.322
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/dist/index.cjs +93 -38
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -11
- package/dist/index.d.ts +18 -11
- package/dist/index.js +78 -23
- package/dist/index.js.map +1 -1
- package/package.json +24 -24
- package/src/agent/OID4VCIHolder.ts +56 -21
- package/src/machines/oid4vciMachine.ts +37 -5
- package/src/services/OID4VCIHolderService.ts +2 -4
- package/src/types/IOID4VCIHolder.ts +18 -11
package/dist/index.cjs
CHANGED
|
@@ -142,7 +142,6 @@ var import_ssi_sdk_ext6 = require("@sphereon/ssi-sdk-ext.identifier-resolution")
|
|
|
142
142
|
var import_ssi_sdk_ext7 = require("@sphereon/ssi-sdk-ext.key-utils");
|
|
143
143
|
var import_ssi_sdk2 = require("@sphereon/ssi-sdk.core");
|
|
144
144
|
var import_ssi_sdk3 = require("@sphereon/ssi-sdk.data-store-types");
|
|
145
|
-
var import_ssi_sdk4 = require("@sphereon/ssi-sdk.data-store-types");
|
|
146
145
|
var import_ssi_types2 = require("@sphereon/ssi-types");
|
|
147
146
|
var import_utils2 = require("@veramo/utils");
|
|
148
147
|
var import_cross_fetch = __toESM(require("cross-fetch"), 1);
|
|
@@ -185,6 +184,7 @@ var OID4VCIMachineStates = /* @__PURE__ */ (function(OID4VCIMachineStates2) {
|
|
|
185
184
|
OID4VCIMachineStates2["selectCredentials"] = "selectCredentials";
|
|
186
185
|
OID4VCIMachineStates2["transitionFromSelectingCredentials"] = "transitionFromSelectingCredentials";
|
|
187
186
|
OID4VCIMachineStates2["verifyPin"] = "verifyPin";
|
|
187
|
+
OID4VCIMachineStates2["prepareAuthorizationRequest"] = "prepareAuthorizationRequest";
|
|
188
188
|
OID4VCIMachineStates2["initiateAuthorizationRequest"] = "initiateAuthorizationRequest";
|
|
189
189
|
OID4VCIMachineStates2["waitForAuthorizationResponse"] = "waitForAuthorizationResponse";
|
|
190
190
|
OID4VCIMachineStates2["getCredentials"] = "getCredentials";
|
|
@@ -249,6 +249,7 @@ var OID4VCIMachineServices = /* @__PURE__ */ (function(OID4VCIMachineServices2)
|
|
|
249
249
|
OID4VCIMachineServices2["getFederationTrust"] = "getFederationTrust";
|
|
250
250
|
OID4VCIMachineServices2["addContactIdentity"] = "addContactIdentity";
|
|
251
251
|
OID4VCIMachineServices2["createCredentialsToSelectFrom"] = "createCredentialsToSelectFrom";
|
|
252
|
+
OID4VCIMachineServices2["prepareAuthorizationRequest"] = "prepareAuthorizationRequest";
|
|
252
253
|
OID4VCIMachineServices2["getIssuerBranding"] = "getIssuerBranding";
|
|
253
254
|
OID4VCIMachineServices2["storeIssuerBranding"] = "storeIssuerBranding";
|
|
254
255
|
OID4VCIMachineServices2["getCredentials"] = "getCredentials";
|
|
@@ -390,9 +391,7 @@ var oid4vciRequireAuthorizationGuard = /* @__PURE__ */ __name((ctx, _event) => {
|
|
|
390
391
|
if (!openID4VCIClientState) {
|
|
391
392
|
throw Error("Missing openID4VCI client state in context");
|
|
392
393
|
}
|
|
393
|
-
if (
|
|
394
|
-
return false;
|
|
395
|
-
} else if (openID4VCIClientState.authorizationRequestOpts) {
|
|
394
|
+
if (openID4VCIClientState.authorizationURL && openID4VCIClientState.authorizationRequestOpts) {
|
|
396
395
|
return !ctx.openID4VCIClientState?.authorizationCodeResponse;
|
|
397
396
|
} else if (openID4VCIClientState.credentialOffer?.supportedFlows?.includes(import_oid4vci_common.AuthzFlowType.AUTHORIZATION_CODE_FLOW)) {
|
|
398
397
|
return !ctx.openID4VCIClientState?.authorizationCodeResponse;
|
|
@@ -443,7 +442,6 @@ var createOID4VCIMachine = /* @__PURE__ */ __name((opts) => {
|
|
|
443
442
|
onDone: {
|
|
444
443
|
target: OID4VCIMachineStates.createCredentialsToSelectFrom,
|
|
445
444
|
actions: (0, import_xstate.assign)({
|
|
446
|
-
authorizationCodeURL: /* @__PURE__ */ __name((_ctx, _event) => _event.data.authorizationCodeURL, "authorizationCodeURL"),
|
|
447
445
|
credentialBranding: /* @__PURE__ */ __name((_ctx, _event) => _event.data.credentialBranding ?? {}, "credentialBranding"),
|
|
448
446
|
credentialsSupported: /* @__PURE__ */ __name((_ctx, _event) => _event.data.credentialsSupported, "credentialsSupported"),
|
|
449
447
|
serverMetadata: /* @__PURE__ */ __name((_ctx, _event) => _event.data.serverMetadata, "serverMetadata"),
|
|
@@ -680,6 +678,10 @@ var createOID4VCIMachine = /* @__PURE__ */ __name((opts) => {
|
|
|
680
678
|
target: OID4VCIMachineStates.startFirstPartApplicationFlow,
|
|
681
679
|
cond: OID4VCIMachineGuards.isFirstPartyApplication
|
|
682
680
|
},
|
|
681
|
+
{
|
|
682
|
+
target: OID4VCIMachineStates.prepareAuthorizationRequest,
|
|
683
|
+
cond: OID4VCIMachineGuards.requireAuthorizationGuard
|
|
684
|
+
},
|
|
683
685
|
{
|
|
684
686
|
target: OID4VCIMachineStates.initiateAuthorizationRequest,
|
|
685
687
|
cond: OID4VCIMachineGuards.requireAuthorizationGuard
|
|
@@ -755,12 +757,16 @@ var createOID4VCIMachine = /* @__PURE__ */ __name((opts) => {
|
|
|
755
757
|
target: OID4VCIMachineStates.startFirstPartApplicationFlow,
|
|
756
758
|
cond: OID4VCIMachineGuards.isFirstPartyApplication
|
|
757
759
|
},
|
|
760
|
+
{
|
|
761
|
+
target: OID4VCIMachineStates.prepareAuthorizationRequest,
|
|
762
|
+
cond: OID4VCIMachineGuards.requireAuthorizationGuard
|
|
763
|
+
},
|
|
758
764
|
{
|
|
759
765
|
target: OID4VCIMachineStates.verifyPin,
|
|
760
766
|
cond: OID4VCIMachineGuards.requirePinGuard
|
|
761
767
|
},
|
|
762
768
|
{
|
|
763
|
-
target: OID4VCIMachineStates.
|
|
769
|
+
target: OID4VCIMachineStates.prepareAuthorizationRequest,
|
|
764
770
|
cond: OID4VCIMachineGuards.requireAuthorizationGuard
|
|
765
771
|
},
|
|
766
772
|
{
|
|
@@ -768,6 +774,28 @@ var createOID4VCIMachine = /* @__PURE__ */ __name((opts) => {
|
|
|
768
774
|
}
|
|
769
775
|
]
|
|
770
776
|
},
|
|
777
|
+
[OID4VCIMachineStates.prepareAuthorizationRequest]: {
|
|
778
|
+
id: OID4VCIMachineStates.prepareAuthorizationRequest,
|
|
779
|
+
invoke: {
|
|
780
|
+
src: OID4VCIMachineServices.prepareAuthorizationRequest,
|
|
781
|
+
onDone: {
|
|
782
|
+
target: OID4VCIMachineStates.initiateAuthorizationRequest,
|
|
783
|
+
actions: (0, import_xstate.assign)({
|
|
784
|
+
authorizationCodeURL: /* @__PURE__ */ __name((_ctx, _event) => _event.data.authorizationCodeURL, "authorizationCodeURL")
|
|
785
|
+
})
|
|
786
|
+
},
|
|
787
|
+
onError: {
|
|
788
|
+
target: OID4VCIMachineStates.handleError,
|
|
789
|
+
actions: (0, import_xstate.assign)({
|
|
790
|
+
error: /* @__PURE__ */ __name((_ctx, _event) => ({
|
|
791
|
+
title: translate("oid4vci_machine_prepare_authorization_error_title"),
|
|
792
|
+
message: _event.data.message,
|
|
793
|
+
stack: _event.data.stack
|
|
794
|
+
}), "error")
|
|
795
|
+
})
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
},
|
|
771
799
|
[OID4VCIMachineStates.initiateAuthorizationRequest]: {
|
|
772
800
|
id: OID4VCIMachineStates.initiateAuthorizationRequest,
|
|
773
801
|
on: {
|
|
@@ -1746,7 +1774,7 @@ var mapCredentialToAccept = /* @__PURE__ */ __name(async (args) => {
|
|
|
1746
1774
|
});
|
|
1747
1775
|
let uniformVerifiableCredential;
|
|
1748
1776
|
if (import_ssi_types.CredentialMapper.isSdJwtDecodedCredential(wrappedVerifiableCredential.credential)) {
|
|
1749
|
-
uniformVerifiableCredential =
|
|
1777
|
+
uniformVerifiableCredential = (0, import_ssi_types.sdJwtDecodedCredentialToUniformCredential)(wrappedVerifiableCredential.credential);
|
|
1750
1778
|
} else if (import_ssi_types.CredentialMapper.isSdJwtEncoded(wrappedVerifiableCredential.credential)) {
|
|
1751
1779
|
if (!hasher) {
|
|
1752
1780
|
return Promise.reject("a hasher is required for encoded SD-JWT credentials");
|
|
@@ -1892,7 +1920,7 @@ var getCredentialConfigsSupportedBySingleTypeOrId = /* @__PURE__ */ __name(async
|
|
|
1892
1920
|
}
|
|
1893
1921
|
__name(createIdFromTypes, "createIdFromTypes");
|
|
1894
1922
|
if (configurationId) {
|
|
1895
|
-
const allSupported2 = client.getCredentialsSupported(format);
|
|
1923
|
+
const allSupported2 = client.getCredentialsSupported(void 0, format);
|
|
1896
1924
|
return Object.fromEntries(Object.entries(allSupported2).filter(([id, supported]) => id === configurationId || supported.id === configurationId || createIdFromTypes(supported) === configurationId));
|
|
1897
1925
|
}
|
|
1898
1926
|
if (!client.credentialOffer) {
|
|
@@ -2203,6 +2231,7 @@ var OID4VCIHolder = class _OID4VCIHolder {
|
|
|
2203
2231
|
oid4vciHolderStart: this.oid4vciHolderStart.bind(this),
|
|
2204
2232
|
oid4vciHolderGetIssuerMetadata: this.oid4vciHolderGetIssuerMetadata.bind(this),
|
|
2205
2233
|
oid4vciHolderGetMachineInterpreter: this.oid4vciHolderGetMachineInterpreter.bind(this),
|
|
2234
|
+
oid4vciHolderPrepareAuthorizationRequest: this.oid4vciHolderPrepareAuthorizationRequest.bind(this),
|
|
2206
2235
|
oid4vciHolderCreateCredentialsToSelectFrom: this.oid4vciHolderCreateCredentialsToSelectFrom.bind(this),
|
|
2207
2236
|
oid4vciHolderGetContact: this.oid4vciHolderGetContact.bind(this),
|
|
2208
2237
|
oid4vciHolderGetCredentials: this.oid4vciHolderGetCredentials.bind(this),
|
|
@@ -2307,6 +2336,7 @@ var OID4VCIHolder = class _OID4VCIHolder {
|
|
|
2307
2336
|
stateNavigationListener: opts.firstPartyStateNavigationListener
|
|
2308
2337
|
}, context),
|
|
2309
2338
|
[OID4VCIMachineServices.createCredentialsToSelectFrom]: (args) => this.oid4vciHolderCreateCredentialsToSelectFrom(args, context),
|
|
2339
|
+
[OID4VCIMachineServices.prepareAuthorizationRequest]: (args) => this.oid4vciHolderPrepareAuthorizationRequest(args, context),
|
|
2310
2340
|
[OID4VCIMachineServices.getContact]: (args) => this.oid4vciHolderGetContact(args, context),
|
|
2311
2341
|
[OID4VCIMachineServices.getCredentials]: (args) => this.oid4vciHolderGetCredentials({
|
|
2312
2342
|
accessTokenOpts: args.accessTokenOpts ?? opts.accessTokenOpts,
|
|
@@ -2355,7 +2385,7 @@ var OID4VCIHolder = class _OID4VCIHolder {
|
|
|
2355
2385
|
...this.defaultAuthorizationRequestOpts,
|
|
2356
2386
|
...args.authorizationRequestOpts
|
|
2357
2387
|
};
|
|
2358
|
-
authorizationRequestOpts.authorizationDetails = authorizationRequestOpts?.authorizationDetails ? (0, import_utils2.asArray)(authorizationRequestOpts.authorizationDetails)
|
|
2388
|
+
authorizationRequestOpts.authorizationDetails = authorizationRequestOpts?.authorizationDetails ? (0, import_utils2.asArray)(authorizationRequestOpts.authorizationDetails) : void 0;
|
|
2359
2389
|
if (!authorizationRequestOpts.redirectUri) {
|
|
2360
2390
|
authorizationRequestOpts.redirectUri = _OID4VCIHolder.DEFAULT_MOBILE_REDIRECT_URI;
|
|
2361
2391
|
}
|
|
@@ -2370,7 +2400,7 @@ var OID4VCIHolder = class _OID4VCIHolder {
|
|
|
2370
2400
|
let oid4vciClient;
|
|
2371
2401
|
let offer;
|
|
2372
2402
|
if (requestData.existingClientState) {
|
|
2373
|
-
oid4vciClient = await import_oid4vci_client3.
|
|
2403
|
+
oid4vciClient = await import_oid4vci_client3.OpenID4VCIClientV1_0_15.fromState({
|
|
2374
2404
|
state: requestData.existingClientState
|
|
2375
2405
|
});
|
|
2376
2406
|
offer = oid4vciClient.credentialOffer;
|
|
@@ -2387,19 +2417,19 @@ var OID4VCIHolder = class _OID4VCIHolder {
|
|
|
2387
2417
|
}
|
|
2388
2418
|
if (!offer) {
|
|
2389
2419
|
logger.log(`Issuer url received (no credential offer): ${uri}`);
|
|
2390
|
-
oid4vciClient = await import_oid4vci_client3.
|
|
2420
|
+
oid4vciClient = await import_oid4vci_client3.OpenID4VCIClientV1_0_15.fromCredentialIssuer({
|
|
2391
2421
|
credentialIssuer: uri,
|
|
2392
2422
|
authorizationRequest: authorizationRequestOpts,
|
|
2393
2423
|
clientId: authorizationRequestOpts.clientId,
|
|
2394
|
-
createAuthorizationRequestURL:
|
|
2424
|
+
createAuthorizationRequestURL: false
|
|
2395
2425
|
});
|
|
2396
2426
|
} else {
|
|
2397
2427
|
logger.log(`Credential offer received: ${uri}`);
|
|
2398
|
-
oid4vciClient = await import_oid4vci_client3.
|
|
2428
|
+
oid4vciClient = await import_oid4vci_client3.OpenID4VCIClientV1_0_15.fromURI({
|
|
2399
2429
|
uri,
|
|
2400
2430
|
authorizationRequest: authorizationRequestOpts,
|
|
2401
2431
|
clientId: authorizationRequestOpts.clientId,
|
|
2402
|
-
createAuthorizationRequestURL:
|
|
2432
|
+
createAuthorizationRequestURL: false
|
|
2403
2433
|
});
|
|
2404
2434
|
}
|
|
2405
2435
|
}
|
|
@@ -2407,7 +2437,7 @@ var OID4VCIHolder = class _OID4VCIHolder {
|
|
|
2407
2437
|
if (offer) {
|
|
2408
2438
|
configurationIds = offer.original_credential_offer.credential_configuration_ids;
|
|
2409
2439
|
} else {
|
|
2410
|
-
configurationIds = (0, import_utils2.asArray)(authorizationRequestOpts.authorizationDetails).
|
|
2440
|
+
configurationIds = (0, import_utils2.asArray)(authorizationRequestOpts.authorizationDetails).map((authReqOpts) => authReqOpts.credential_configuration_id).filter((id) => !!id);
|
|
2411
2441
|
}
|
|
2412
2442
|
const credentialsSupported = await getCredentialConfigsSupportedMerged({
|
|
2413
2443
|
client: oid4vciClient,
|
|
@@ -2419,19 +2449,44 @@ var OID4VCIHolder = class _OID4VCIHolder {
|
|
|
2419
2449
|
credentialsSupported,
|
|
2420
2450
|
context
|
|
2421
2451
|
});
|
|
2422
|
-
const authorizationCodeURL = oid4vciClient.authorizationURL;
|
|
2423
|
-
if (authorizationCodeURL) {
|
|
2424
|
-
logger.log(`authorization code URL ${authorizationCodeURL}`);
|
|
2425
|
-
}
|
|
2426
2452
|
const oid4vciClientState = JSON.parse(await oid4vciClient.exportState());
|
|
2427
2453
|
return {
|
|
2428
|
-
authorizationCodeURL,
|
|
2429
2454
|
credentialBranding,
|
|
2430
2455
|
credentialsSupported,
|
|
2431
2456
|
serverMetadata,
|
|
2432
2457
|
oid4vciClientState
|
|
2433
2458
|
};
|
|
2434
2459
|
}
|
|
2460
|
+
async oid4vciHolderPrepareAuthorizationRequest(args, context) {
|
|
2461
|
+
const { openID4VCIClientState, contact } = args;
|
|
2462
|
+
if (!openID4VCIClientState) {
|
|
2463
|
+
return Promise.reject(Error("Missing openID4VCI client state in context"));
|
|
2464
|
+
}
|
|
2465
|
+
const clientId = contact?.identities.map((identity) => {
|
|
2466
|
+
const connectionConfig = identity.connection?.config;
|
|
2467
|
+
if (connectionConfig && "clientId" in connectionConfig) {
|
|
2468
|
+
return connectionConfig.clientId;
|
|
2469
|
+
}
|
|
2470
|
+
return void 0;
|
|
2471
|
+
}).find((clientId2) => clientId2);
|
|
2472
|
+
if (!clientId) {
|
|
2473
|
+
return Promise.reject(Error(`Missing client id in contact's connectionConfig`));
|
|
2474
|
+
}
|
|
2475
|
+
const client = await import_oid4vci_client3.OpenID4VCIClient.fromState({
|
|
2476
|
+
state: openID4VCIClientState
|
|
2477
|
+
});
|
|
2478
|
+
const authorizationCodeURL = await client.createAuthorizationRequestUrl({
|
|
2479
|
+
authorizationRequest: {
|
|
2480
|
+
clientId
|
|
2481
|
+
}
|
|
2482
|
+
});
|
|
2483
|
+
if (authorizationCodeURL) {
|
|
2484
|
+
logger.log(`authorization code URL ${authorizationCodeURL}`);
|
|
2485
|
+
}
|
|
2486
|
+
return {
|
|
2487
|
+
authorizationCodeURL
|
|
2488
|
+
};
|
|
2489
|
+
}
|
|
2435
2490
|
async oid4vciHolderCreateCredentialsToSelectFrom(args, context) {
|
|
2436
2491
|
const { credentialBranding, locale, selectedCredentials, credentialsSupported } = args;
|
|
2437
2492
|
logger.info(`Credentials supported ${Object.keys(credentialsSupported).join(", ")}`);
|
|
@@ -2503,7 +2558,7 @@ var OID4VCIHolder = class _OID4VCIHolder {
|
|
|
2503
2558
|
if (!openID4VCIClientState) {
|
|
2504
2559
|
return Promise.reject(Error("Missing openID4VCI client state in context"));
|
|
2505
2560
|
}
|
|
2506
|
-
const client = await import_oid4vci_client3.
|
|
2561
|
+
const client = await import_oid4vci_client3.OpenID4VCIClientV1_0_15.fromState({
|
|
2507
2562
|
state: openID4VCIClientState
|
|
2508
2563
|
});
|
|
2509
2564
|
const credentialsSupported = await getCredentialConfigsSupportedMerged({
|
|
@@ -2631,16 +2686,16 @@ var OID4VCIHolder = class _OID4VCIHolder {
|
|
|
2631
2686
|
return Promise.reject(Error("Missing credential offers in context"));
|
|
2632
2687
|
}
|
|
2633
2688
|
let correlationId = credentialsToAccept[0].correlationId;
|
|
2634
|
-
let identifierType =
|
|
2689
|
+
let identifierType = import_ssi_sdk3.CorrelationIdentifierType.DID;
|
|
2635
2690
|
if (!correlationId.toLowerCase().startsWith("did:")) {
|
|
2636
|
-
identifierType =
|
|
2691
|
+
identifierType = import_ssi_sdk3.CorrelationIdentifierType.URL;
|
|
2637
2692
|
if (correlationId.startsWith("http")) {
|
|
2638
2693
|
correlationId = new URL(correlationId).hostname;
|
|
2639
2694
|
}
|
|
2640
2695
|
}
|
|
2641
2696
|
const identity = {
|
|
2642
2697
|
alias: credentialsToAccept[0].correlationId,
|
|
2643
|
-
origin:
|
|
2698
|
+
origin: import_ssi_sdk3.IdentityOrigin.EXTERNAL,
|
|
2644
2699
|
roles: [
|
|
2645
2700
|
import_ssi_types2.CredentialRole.ISSUER
|
|
2646
2701
|
],
|
|
@@ -2648,9 +2703,9 @@ var OID4VCIHolder = class _OID4VCIHolder {
|
|
|
2648
2703
|
type: identifierType,
|
|
2649
2704
|
correlationId
|
|
2650
2705
|
},
|
|
2651
|
-
...identifierType ===
|
|
2706
|
+
...identifierType === import_ssi_sdk3.CorrelationIdentifierType.URL && {
|
|
2652
2707
|
connection: {
|
|
2653
|
-
type:
|
|
2708
|
+
type: import_ssi_sdk3.ConnectionType.OPENID_CONNECT,
|
|
2654
2709
|
config: {
|
|
2655
2710
|
clientId: "138d7bf8-c930-4c6e-b928-97d3a4928b01",
|
|
2656
2711
|
clientSecret: "03b3955f-d020-4f2a-8a27-4e452d4e27a0",
|
|
@@ -2910,7 +2965,7 @@ var OID4VCIHolder = class _OID4VCIHolder {
|
|
|
2910
2965
|
kmsKeyRef,
|
|
2911
2966
|
identifierMethod: method,
|
|
2912
2967
|
credentialRole: import_ssi_types2.CredentialRole.HOLDER,
|
|
2913
|
-
issuerCorrelationType: issuer?.startsWith("did:") ?
|
|
2968
|
+
issuerCorrelationType: issuer?.startsWith("did:") ? import_ssi_sdk3.CredentialCorrelationType.DID : import_ssi_sdk3.CredentialCorrelationType.URL,
|
|
2914
2969
|
issuerCorrelationId: issuer,
|
|
2915
2970
|
subjectCorrelationType,
|
|
2916
2971
|
subjectCorrelationId
|
|
@@ -2978,12 +3033,12 @@ var OID4VCIHolder = class _OID4VCIHolder {
|
|
|
2978
3033
|
case "did":
|
|
2979
3034
|
if ((0, import_ssi_sdk_ext6.isManagedIdentifierResult)(identifier) && (0, import_ssi_sdk_ext6.isManagedIdentifierDidResult)(identifier)) {
|
|
2980
3035
|
return [
|
|
2981
|
-
|
|
3036
|
+
import_ssi_sdk3.CredentialCorrelationType.DID,
|
|
2982
3037
|
identifier.did
|
|
2983
3038
|
];
|
|
2984
3039
|
} else if ((0, import_ssi_sdk_ext6.isManagedIdentifierDidOpts)(identifier)) {
|
|
2985
3040
|
return [
|
|
2986
|
-
|
|
3041
|
+
import_ssi_sdk3.CredentialCorrelationType.DID,
|
|
2987
3042
|
typeof identifier.identifier === "string" ? identifier.identifier : identifier.identifier.did
|
|
2988
3043
|
];
|
|
2989
3044
|
}
|
|
@@ -2991,12 +3046,12 @@ var OID4VCIHolder = class _OID4VCIHolder {
|
|
|
2991
3046
|
case "kid":
|
|
2992
3047
|
if ((0, import_ssi_sdk_ext6.isManagedIdentifierResult)(identifier) && (0, import_ssi_sdk_ext6.isManagedIdentifierKidResult)(identifier)) {
|
|
2993
3048
|
return [
|
|
2994
|
-
|
|
3049
|
+
import_ssi_sdk3.CredentialCorrelationType.KID,
|
|
2995
3050
|
identifier.kid
|
|
2996
3051
|
];
|
|
2997
3052
|
} else if ((0, import_ssi_sdk_ext6.isManagedIdentifierDidOpts)(identifier)) {
|
|
2998
3053
|
return [
|
|
2999
|
-
|
|
3054
|
+
import_ssi_sdk3.CredentialCorrelationType.KID,
|
|
3000
3055
|
identifier.identifier
|
|
3001
3056
|
];
|
|
3002
3057
|
}
|
|
@@ -3004,19 +3059,19 @@ var OID4VCIHolder = class _OID4VCIHolder {
|
|
|
3004
3059
|
case "x5c":
|
|
3005
3060
|
if ((0, import_ssi_sdk_ext6.isManagedIdentifierResult)(identifier) && (0, import_ssi_sdk_ext6.isManagedIdentifierX5cResult)(identifier)) {
|
|
3006
3061
|
return [
|
|
3007
|
-
|
|
3062
|
+
import_ssi_sdk3.CredentialCorrelationType.X509_SAN,
|
|
3008
3063
|
identifier.x5c.join("\r\n")
|
|
3009
3064
|
];
|
|
3010
3065
|
} else if ((0, import_ssi_sdk_ext6.isManagedIdentifierX5cOpts)(identifier)) {
|
|
3011
3066
|
return [
|
|
3012
|
-
|
|
3067
|
+
import_ssi_sdk3.CredentialCorrelationType.X509_SAN,
|
|
3013
3068
|
identifier.identifier.join("\r\n")
|
|
3014
3069
|
];
|
|
3015
3070
|
}
|
|
3016
3071
|
break;
|
|
3017
3072
|
}
|
|
3018
3073
|
return [
|
|
3019
|
-
|
|
3074
|
+
import_ssi_sdk3.CredentialCorrelationType.URL,
|
|
3020
3075
|
issuer
|
|
3021
3076
|
];
|
|
3022
3077
|
}
|
|
@@ -3075,9 +3130,9 @@ var OID4VCICallbackStateListener = /* @__PURE__ */ __name((callbacks) => {
|
|
|
3075
3130
|
// src/link-handler/index.ts
|
|
3076
3131
|
var import_oid4vci_client4 = require("@sphereon/oid4vci-client");
|
|
3077
3132
|
var import_oid4vci_common5 = require("@sphereon/oid4vci-common");
|
|
3078
|
-
var
|
|
3079
|
-
var
|
|
3080
|
-
var OID4VCIHolderLinkHandler = class extends
|
|
3133
|
+
var import_ssi_sdk4 = require("@sphereon/ssi-sdk.core");
|
|
3134
|
+
var import_ssi_sdk5 = require("@sphereon/ssi-sdk.xstate-machine-persistence");
|
|
3135
|
+
var OID4VCIHolderLinkHandler = class extends import_ssi_sdk4.LinkHandlerAdapter {
|
|
3081
3136
|
static {
|
|
3082
3137
|
__name(this, "OID4VCIHolderLinkHandler");
|
|
3083
3138
|
}
|
|
@@ -3137,7 +3192,7 @@ var OID4VCIHolderLinkHandler = class extends import_ssi_sdk5.LinkHandlerAdapter
|
|
|
3137
3192
|
const interpreter = oid4vciMachine.interpreter;
|
|
3138
3193
|
if (!opts?.machineState && this.context.agent.availableMethods().includes("machineStatesFindActive")) {
|
|
3139
3194
|
const stateType = hasCode ? "existing" : "new";
|
|
3140
|
-
await (0,
|
|
3195
|
+
await (0, import_ssi_sdk5.interpreterStartOrResume)({
|
|
3141
3196
|
stateType,
|
|
3142
3197
|
interpreter,
|
|
3143
3198
|
context: this.context,
|