@sphereon/ssi-sdk.oid4vci-holder 0.34.1-feature.SSISDK.78.280 → 0.34.1-feature.SSISDK.82.linkedVP.325
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 +15 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -9
- package/dist/index.d.ts +9 -9
- package/dist/index.js +16 -8
- package/dist/index.js.map +1 -1
- package/package.json +24 -24
- package/src/agent/OID4VCIHolder.ts +6 -6
- package/src/machines/oid4vciMachine.ts +9 -1
- package/src/services/OID4VCIHolderService.ts +2 -4
- package/src/types/IOID4VCIHolder.ts +10 -10
package/dist/index.cjs
CHANGED
|
@@ -391,7 +391,7 @@ var oid4vciRequireAuthorizationGuard = /* @__PURE__ */ __name((ctx, _event) => {
|
|
|
391
391
|
if (!openID4VCIClientState) {
|
|
392
392
|
throw Error("Missing openID4VCI client state in context");
|
|
393
393
|
}
|
|
394
|
-
if (openID4VCIClientState.authorizationRequestOpts) {
|
|
394
|
+
if (openID4VCIClientState.authorizationURL && openID4VCIClientState.authorizationRequestOpts) {
|
|
395
395
|
return !ctx.openID4VCIClientState?.authorizationCodeResponse;
|
|
396
396
|
} else if (openID4VCIClientState.credentialOffer?.supportedFlows?.includes(import_oid4vci_common.AuthzFlowType.AUTHORIZATION_CODE_FLOW)) {
|
|
397
397
|
return !ctx.openID4VCIClientState?.authorizationCodeResponse;
|
|
@@ -678,6 +678,10 @@ var createOID4VCIMachine = /* @__PURE__ */ __name((opts) => {
|
|
|
678
678
|
target: OID4VCIMachineStates.startFirstPartApplicationFlow,
|
|
679
679
|
cond: OID4VCIMachineGuards.isFirstPartyApplication
|
|
680
680
|
},
|
|
681
|
+
{
|
|
682
|
+
target: OID4VCIMachineStates.prepareAuthorizationRequest,
|
|
683
|
+
cond: OID4VCIMachineGuards.requireAuthorizationGuard
|
|
684
|
+
},
|
|
681
685
|
{
|
|
682
686
|
target: OID4VCIMachineStates.initiateAuthorizationRequest,
|
|
683
687
|
cond: OID4VCIMachineGuards.requireAuthorizationGuard
|
|
@@ -753,6 +757,10 @@ var createOID4VCIMachine = /* @__PURE__ */ __name((opts) => {
|
|
|
753
757
|
target: OID4VCIMachineStates.startFirstPartApplicationFlow,
|
|
754
758
|
cond: OID4VCIMachineGuards.isFirstPartyApplication
|
|
755
759
|
},
|
|
760
|
+
{
|
|
761
|
+
target: OID4VCIMachineStates.prepareAuthorizationRequest,
|
|
762
|
+
cond: OID4VCIMachineGuards.requireAuthorizationGuard
|
|
763
|
+
},
|
|
756
764
|
{
|
|
757
765
|
target: OID4VCIMachineStates.verifyPin,
|
|
758
766
|
cond: OID4VCIMachineGuards.requirePinGuard
|
|
@@ -1766,7 +1774,7 @@ var mapCredentialToAccept = /* @__PURE__ */ __name(async (args) => {
|
|
|
1766
1774
|
});
|
|
1767
1775
|
let uniformVerifiableCredential;
|
|
1768
1776
|
if (import_ssi_types.CredentialMapper.isSdJwtDecodedCredential(wrappedVerifiableCredential.credential)) {
|
|
1769
|
-
uniformVerifiableCredential =
|
|
1777
|
+
uniformVerifiableCredential = (0, import_ssi_types.sdJwtDecodedCredentialToUniformCredential)(wrappedVerifiableCredential.credential);
|
|
1770
1778
|
} else if (import_ssi_types.CredentialMapper.isSdJwtEncoded(wrappedVerifiableCredential.credential)) {
|
|
1771
1779
|
if (!hasher) {
|
|
1772
1780
|
return Promise.reject("a hasher is required for encoded SD-JWT credentials");
|
|
@@ -1912,7 +1920,7 @@ var getCredentialConfigsSupportedBySingleTypeOrId = /* @__PURE__ */ __name(async
|
|
|
1912
1920
|
}
|
|
1913
1921
|
__name(createIdFromTypes, "createIdFromTypes");
|
|
1914
1922
|
if (configurationId) {
|
|
1915
|
-
const allSupported2 = client.getCredentialsSupported(format);
|
|
1923
|
+
const allSupported2 = client.getCredentialsSupported(void 0, format);
|
|
1916
1924
|
return Object.fromEntries(Object.entries(allSupported2).filter(([id, supported]) => id === configurationId || supported.id === configurationId || createIdFromTypes(supported) === configurationId));
|
|
1917
1925
|
}
|
|
1918
1926
|
if (!client.credentialOffer) {
|
|
@@ -2392,7 +2400,7 @@ var OID4VCIHolder = class _OID4VCIHolder {
|
|
|
2392
2400
|
let oid4vciClient;
|
|
2393
2401
|
let offer;
|
|
2394
2402
|
if (requestData.existingClientState) {
|
|
2395
|
-
oid4vciClient = await import_oid4vci_client3.
|
|
2403
|
+
oid4vciClient = await import_oid4vci_client3.OpenID4VCIClientV1_0_15.fromState({
|
|
2396
2404
|
state: requestData.existingClientState
|
|
2397
2405
|
});
|
|
2398
2406
|
offer = oid4vciClient.credentialOffer;
|
|
@@ -2409,7 +2417,7 @@ var OID4VCIHolder = class _OID4VCIHolder {
|
|
|
2409
2417
|
}
|
|
2410
2418
|
if (!offer) {
|
|
2411
2419
|
logger.log(`Issuer url received (no credential offer): ${uri}`);
|
|
2412
|
-
oid4vciClient = await import_oid4vci_client3.
|
|
2420
|
+
oid4vciClient = await import_oid4vci_client3.OpenID4VCIClientV1_0_15.fromCredentialIssuer({
|
|
2413
2421
|
credentialIssuer: uri,
|
|
2414
2422
|
authorizationRequest: authorizationRequestOpts,
|
|
2415
2423
|
clientId: authorizationRequestOpts.clientId,
|
|
@@ -2417,7 +2425,7 @@ var OID4VCIHolder = class _OID4VCIHolder {
|
|
|
2417
2425
|
});
|
|
2418
2426
|
} else {
|
|
2419
2427
|
logger.log(`Credential offer received: ${uri}`);
|
|
2420
|
-
oid4vciClient = await import_oid4vci_client3.
|
|
2428
|
+
oid4vciClient = await import_oid4vci_client3.OpenID4VCIClientV1_0_15.fromURI({
|
|
2421
2429
|
uri,
|
|
2422
2430
|
authorizationRequest: authorizationRequestOpts,
|
|
2423
2431
|
clientId: authorizationRequestOpts.clientId,
|
|
@@ -2550,7 +2558,7 @@ var OID4VCIHolder = class _OID4VCIHolder {
|
|
|
2550
2558
|
if (!openID4VCIClientState) {
|
|
2551
2559
|
return Promise.reject(Error("Missing openID4VCI client state in context"));
|
|
2552
2560
|
}
|
|
2553
|
-
const client = await import_oid4vci_client3.
|
|
2561
|
+
const client = await import_oid4vci_client3.OpenID4VCIClientV1_0_15.fromState({
|
|
2554
2562
|
state: openID4VCIClientState
|
|
2555
2563
|
});
|
|
2556
2564
|
const credentialsSupported = await getCredentialConfigsSupportedMerged({
|