@sphereon/ssi-sdk.oid4vci-holder 0.34.1-feature.SSISDK.13.39 → 0.34.1-feature.SSISDK.13.50
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 +27 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +27 -6
- package/dist/index.js.map +1 -1
- package/package.json +24 -24
- package/src/agent/OID4VCIHolder.ts +16 -2
- package/src/services/OID4VCIHolderService.ts +25 -4
- package/src/types/IOID4VCIHolder.ts +3 -1
package/dist/index.cjs
CHANGED
|
@@ -228,6 +228,7 @@ var OID4VCIMachineGuards = /* @__PURE__ */ function(OID4VCIMachineGuards2) {
|
|
|
228
228
|
OID4VCIMachineGuards2["requirePinGuard"] = "oid4vciRequirePinGuard";
|
|
229
229
|
OID4VCIMachineGuards2["requireAuthorizationGuard"] = "oid4vciRequireAuthorizationGuard";
|
|
230
230
|
OID4VCIMachineGuards2["noAuthorizationGuard"] = "oid4vciNoAuthorizationGuard";
|
|
231
|
+
OID4VCIMachineGuards2["hasNonceEndpointGuard"] = "oid4vciHasNonceEndpointGuard ";
|
|
231
232
|
OID4VCIMachineGuards2["hasAuthorizationResponse"] = "oid4vciHasAuthorizationResponse";
|
|
232
233
|
OID4VCIMachineGuards2["hasNoContactIdentityGuard"] = "oid4vciHasNoContactIdentityGuard";
|
|
233
234
|
OID4VCIMachineGuards2["verificationCodeGuard"] = "oid4vciVerificationCodeGuard";
|
|
@@ -1617,7 +1618,7 @@ var getCredentialBranding = /* @__PURE__ */ __name(async (args) => {
|
|
|
1617
1618
|
const credentialBranding = {};
|
|
1618
1619
|
await Promise.all(Object.entries(credentialsSupported).map(async ([configId, credentialsConfigSupported]) => {
|
|
1619
1620
|
let sdJwtTypeMetadata;
|
|
1620
|
-
if (credentialsConfigSupported.format === "
|
|
1621
|
+
if (credentialsConfigSupported.format === "dc+sd-jwt") {
|
|
1621
1622
|
const vct = credentialsConfigSupported.vct;
|
|
1622
1623
|
if (vct.startsWith("http")) {
|
|
1623
1624
|
try {
|
|
@@ -1683,7 +1684,13 @@ var selectCredentialLocaleBranding = /* @__PURE__ */ __name(async (args) => {
|
|
|
1683
1684
|
}, "selectCredentialLocaleBranding");
|
|
1684
1685
|
var verifyCredentialToAccept = /* @__PURE__ */ __name(async (args) => {
|
|
1685
1686
|
const { mappedCredential, hasher, onVerifyEBSICredentialIssuer, schemaValidation, context } = args;
|
|
1686
|
-
const
|
|
1687
|
+
const credentialResponse = mappedCredential.credentialToAccept.credentialResponse;
|
|
1688
|
+
let credential;
|
|
1689
|
+
if ("credential" in credentialResponse) {
|
|
1690
|
+
credential = credentialResponse.credential;
|
|
1691
|
+
} else if ("credentials" in credentialResponse && credentialResponse.credentials && Array.isArray(credentialResponse.credentials) && credentialResponse.credentials.length > 0) {
|
|
1692
|
+
credential = credentialResponse.credentials[0].credential;
|
|
1693
|
+
}
|
|
1687
1694
|
if (!credential) {
|
|
1688
1695
|
return Promise.reject(Error("No credential found in credential response"));
|
|
1689
1696
|
}
|
|
@@ -1739,7 +1746,12 @@ var verifyCredentialToAccept = /* @__PURE__ */ __name(async (args) => {
|
|
|
1739
1746
|
var mapCredentialToAccept = /* @__PURE__ */ __name(async (args) => {
|
|
1740
1747
|
const { credentialToAccept, hasher } = args;
|
|
1741
1748
|
const credentialResponse = credentialToAccept.credentialResponse;
|
|
1742
|
-
|
|
1749
|
+
let verifiableCredential;
|
|
1750
|
+
if ("credential" in credentialResponse) {
|
|
1751
|
+
verifiableCredential = credentialResponse.credential;
|
|
1752
|
+
} else if ("credentials" in credentialResponse && credentialResponse.credentials && Array.isArray(credentialResponse.credentials) && credentialResponse.credentials.length > 0) {
|
|
1753
|
+
verifiableCredential = credentialResponse.credentials[0].credential;
|
|
1754
|
+
}
|
|
1743
1755
|
if (!verifiableCredential) {
|
|
1744
1756
|
return Promise.reject(Error("No credential found in credential response"));
|
|
1745
1757
|
}
|
|
@@ -2073,7 +2085,7 @@ var getIssuanceCryptoSuite = /* @__PURE__ */ __name(async (opts) => {
|
|
|
2073
2085
|
case "jwt":
|
|
2074
2086
|
case "jwt_vc_json":
|
|
2075
2087
|
case "jwt_vc":
|
|
2076
|
-
case "
|
|
2088
|
+
case "dc+sd-jwt":
|
|
2077
2089
|
case "mso_mdoc": {
|
|
2078
2090
|
const supportedPreferences = jwtCryptographicSuitePreferences.filter((suite) => signing_algs_supported.includes(suite));
|
|
2079
2091
|
if (supportedPreferences.length > 0) {
|
|
@@ -2211,7 +2223,7 @@ var OID4VCIHolder = class _OID4VCIHolder {
|
|
|
2211
2223
|
oid4vciHolderStoreIssuerBranding: this.oid4vciHolderStoreIssuerBranding.bind(this)
|
|
2212
2224
|
};
|
|
2213
2225
|
vcFormatPreferences = [
|
|
2214
|
-
"
|
|
2226
|
+
"dc+sd-jwt",
|
|
2215
2227
|
"mso_mdoc",
|
|
2216
2228
|
"jwt_vc_json",
|
|
2217
2229
|
"jwt_vc",
|
|
@@ -2797,7 +2809,16 @@ var OID4VCIHolder = class _OID4VCIHolder {
|
|
|
2797
2809
|
if (Array.isArray(subjectIssuance?.notification_events_supported)) {
|
|
2798
2810
|
event = subjectIssuance.notification_events_supported.includes("credential_accepted_holder_signed") ? "credential_accepted_holder_signed" : "credential_deleted_holder_signed";
|
|
2799
2811
|
logger.log(`Subject issuance/signing will be used, with event`, event);
|
|
2800
|
-
const
|
|
2812
|
+
const credentialResponse = mappedCredentialToAccept.credentialToAccept.credentialResponse;
|
|
2813
|
+
let issuerVC;
|
|
2814
|
+
if ("credential" in credentialResponse) {
|
|
2815
|
+
issuerVC = credentialResponse.credential;
|
|
2816
|
+
} else if ("credentials" in credentialResponse && credentialResponse.credentials && Array.isArray(credentialResponse.credentials) && credentialResponse.credentials.length > 0) {
|
|
2817
|
+
issuerVC = credentialResponse.credentials[0].credential;
|
|
2818
|
+
}
|
|
2819
|
+
if (!issuerVC) {
|
|
2820
|
+
return Promise.reject(Error("No credential found in credential response"));
|
|
2821
|
+
}
|
|
2801
2822
|
const wrappedIssuerVC = import_ssi_types2.CredentialMapper.toWrappedVerifiableCredential(issuerVC, {
|
|
2802
2823
|
hasher: this.hasher ?? import_ssi_sdk3.defaultHasher
|
|
2803
2824
|
});
|