@sphereon/ssi-sdk.oid4vci-holder 0.34.1-fix.79 → 0.34.1-next.278
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 +56 -55
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +37 -36
- package/dist/index.js.map +1 -1
- package/package.json +24 -24
- package/src/agent/OID4VCIHolder.ts +14 -14
- package/src/machines/firstPartyMachine.ts +1 -1
- package/src/machines/oid4vciMachine.ts +1 -1
- package/src/mappers/OIDC4VCIBrandingMapper.ts +1 -1
- package/src/services/OID4VCIHolderService.ts +2 -2
- package/src/types/FirstPartyMachine.ts +1 -1
- package/src/types/IOID4VCIHolder.ts +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -7,7 +7,7 @@ import { DynamicRegistrationClientMetadata } from '@sphereon/oid4vc-common';
|
|
|
7
7
|
import { SupportedDidMethodEnum, CreateOrGetIdentifierOpts, IdentifierProviderOpts } from '@sphereon/ssi-sdk-ext.did-utils';
|
|
8
8
|
import { IContactManager } from '@sphereon/ssi-sdk.contact-manager';
|
|
9
9
|
import { UniqueDigitalCredential, ICredentialStore } from '@sphereon/ssi-sdk.credential-store';
|
|
10
|
-
import { Party, DidAuthConfig, IIssuerLocaleBranding, IBasicIssuerLocaleBranding, IBasicCredentialLocaleBranding, Identity, DigitalCredential, IBasicCredentialClaim } from '@sphereon/ssi-sdk.data-store';
|
|
10
|
+
import { Party, DidAuthConfig, IIssuerLocaleBranding, IBasicIssuerLocaleBranding, IBasicCredentialLocaleBranding, Identity, DigitalCredential, IBasicCredentialClaim } from '@sphereon/ssi-sdk.data-store-types';
|
|
11
11
|
import { IIssuanceBranding } from '@sphereon/ssi-sdk.issuance-branding';
|
|
12
12
|
import { ImDLMdoc } from '@sphereon/ssi-sdk.mdl-mdoc';
|
|
13
13
|
import { ISDJwtPlugin } from '@sphereon/ssi-sdk.sd-jwt';
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { DynamicRegistrationClientMetadata } from '@sphereon/oid4vc-common';
|
|
|
7
7
|
import { SupportedDidMethodEnum, CreateOrGetIdentifierOpts, IdentifierProviderOpts } from '@sphereon/ssi-sdk-ext.did-utils';
|
|
8
8
|
import { IContactManager } from '@sphereon/ssi-sdk.contact-manager';
|
|
9
9
|
import { UniqueDigitalCredential, ICredentialStore } from '@sphereon/ssi-sdk.credential-store';
|
|
10
|
-
import { Party, DidAuthConfig, IIssuerLocaleBranding, IBasicIssuerLocaleBranding, IBasicCredentialLocaleBranding, Identity, DigitalCredential, IBasicCredentialClaim } from '@sphereon/ssi-sdk.data-store';
|
|
10
|
+
import { Party, DidAuthConfig, IIssuerLocaleBranding, IBasicIssuerLocaleBranding, IBasicCredentialLocaleBranding, Identity, DigitalCredential, IBasicCredentialClaim } from '@sphereon/ssi-sdk.data-store-types';
|
|
11
11
|
import { IIssuanceBranding } from '@sphereon/ssi-sdk.issuance-branding';
|
|
12
12
|
import { ImDLMdoc } from '@sphereon/ssi-sdk.mdl-mdoc';
|
|
13
13
|
import { ISDJwtPlugin } from '@sphereon/ssi-sdk.sd-jwt';
|
package/dist/index.js
CHANGED
|
@@ -56,14 +56,16 @@ var require_nl = __commonJS({
|
|
|
56
56
|
|
|
57
57
|
// src/agent/OID4VCIHolder.ts
|
|
58
58
|
import { CredentialOfferClient, MetadataClient, OpenID4VCIClient as OpenID4VCIClient2 } from "@sphereon/oid4vci-client";
|
|
59
|
-
import { DefaultURISchemes,
|
|
59
|
+
import { DefaultURISchemes, getTypesFromObject as getTypesFromObject2 } from "@sphereon/oid4vci-common";
|
|
60
60
|
import { SupportedDidMethodEnum as SupportedDidMethodEnum2 } from "@sphereon/ssi-sdk-ext.did-utils";
|
|
61
61
|
import { isManagedIdentifierDidOpts, isManagedIdentifierDidResult as isManagedIdentifierDidResult2, isManagedIdentifierJwkResult, isManagedIdentifierKidResult, isManagedIdentifierResult as isManagedIdentifierResult2, isManagedIdentifierX5cOpts, isManagedIdentifierX5cResult } from "@sphereon/ssi-sdk-ext.identifier-resolution";
|
|
62
62
|
import { signatureAlgorithmFromKey } from "@sphereon/ssi-sdk-ext.key-utils";
|
|
63
63
|
import { defaultHasher as defaultHasher2 } from "@sphereon/ssi-sdk.core";
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
64
|
+
import { ensureRawDocument } from "@sphereon/ssi-sdk.data-store-types";
|
|
65
|
+
import { ConnectionType, CorrelationIdentifierType, CredentialCorrelationType, IdentityOrigin } from "@sphereon/ssi-sdk.data-store-types";
|
|
66
|
+
import { CredentialMapper as CredentialMapper2, CredentialRole, JoseSignatureAlgorithm as JoseSignatureAlgorithm2, Loggers, parseDid } from "@sphereon/ssi-types";
|
|
66
67
|
import { asArray as asArray2, computeEntryHash } from "@veramo/utils";
|
|
68
|
+
import fetch from "cross-fetch";
|
|
67
69
|
import { decodeJWT } from "did-jwt";
|
|
68
70
|
import { v4 as uuidv42 } from "uuid";
|
|
69
71
|
|
|
@@ -76,18 +78,18 @@ import i18n from "i18n-js";
|
|
|
76
78
|
import memoize from "lodash.memoize";
|
|
77
79
|
|
|
78
80
|
// src/types/IOID4VCIHolder.ts
|
|
79
|
-
var OID4VCIHolderEvent = /* @__PURE__ */ function(OID4VCIHolderEvent2) {
|
|
81
|
+
var OID4VCIHolderEvent = /* @__PURE__ */ (function(OID4VCIHolderEvent2) {
|
|
80
82
|
OID4VCIHolderEvent2["CONTACT_IDENTITY_CREATED"] = "contact_identity_created";
|
|
81
83
|
OID4VCIHolderEvent2["CREDENTIAL_STORED"] = "credential_stored";
|
|
82
84
|
OID4VCIHolderEvent2["IDENTIFIER_CREATED"] = "identifier_created";
|
|
83
85
|
return OID4VCIHolderEvent2;
|
|
84
|
-
}({});
|
|
85
|
-
var SupportedLanguage = /* @__PURE__ */ function(SupportedLanguage2) {
|
|
86
|
+
})({});
|
|
87
|
+
var SupportedLanguage = /* @__PURE__ */ (function(SupportedLanguage2) {
|
|
86
88
|
SupportedLanguage2["ENGLISH"] = "en";
|
|
87
89
|
SupportedLanguage2["DUTCH"] = "nl";
|
|
88
90
|
return SupportedLanguage2;
|
|
89
|
-
}({});
|
|
90
|
-
var OID4VCIMachineStates = /* @__PURE__ */ function(OID4VCIMachineStates2) {
|
|
91
|
+
})({});
|
|
92
|
+
var OID4VCIMachineStates = /* @__PURE__ */ (function(OID4VCIMachineStates2) {
|
|
91
93
|
OID4VCIMachineStates2["start"] = "start";
|
|
92
94
|
OID4VCIMachineStates2["createCredentialsToSelectFrom"] = "createCredentialsToSelectFrom";
|
|
93
95
|
OID4VCIMachineStates2["getContact"] = "getContact";
|
|
@@ -118,18 +120,18 @@ var OID4VCIMachineStates = /* @__PURE__ */ function(OID4VCIMachineStates2) {
|
|
|
118
120
|
OID4VCIMachineStates2["error"] = "error";
|
|
119
121
|
OID4VCIMachineStates2["done"] = "done";
|
|
120
122
|
return OID4VCIMachineStates2;
|
|
121
|
-
}({});
|
|
122
|
-
var OID4VCIMachineAddContactStates = /* @__PURE__ */ function(OID4VCIMachineAddContactStates2) {
|
|
123
|
+
})({});
|
|
124
|
+
var OID4VCIMachineAddContactStates = /* @__PURE__ */ (function(OID4VCIMachineAddContactStates2) {
|
|
123
125
|
OID4VCIMachineAddContactStates2["idle"] = "idle";
|
|
124
126
|
OID4VCIMachineAddContactStates2["next"] = "next";
|
|
125
127
|
return OID4VCIMachineAddContactStates2;
|
|
126
|
-
}({});
|
|
127
|
-
var OID4VCIMachineVerifyPinStates = /* @__PURE__ */ function(OID4VCIMachineVerifyPinStates2) {
|
|
128
|
+
})({});
|
|
129
|
+
var OID4VCIMachineVerifyPinStates = /* @__PURE__ */ (function(OID4VCIMachineVerifyPinStates2) {
|
|
128
130
|
OID4VCIMachineVerifyPinStates2["idle"] = "idle";
|
|
129
131
|
OID4VCIMachineVerifyPinStates2["next"] = "next";
|
|
130
132
|
return OID4VCIMachineVerifyPinStates2;
|
|
131
|
-
}({});
|
|
132
|
-
var OID4VCIMachineEvents = /* @__PURE__ */ function(OID4VCIMachineEvents2) {
|
|
133
|
+
})({});
|
|
134
|
+
var OID4VCIMachineEvents = /* @__PURE__ */ (function(OID4VCIMachineEvents2) {
|
|
133
135
|
OID4VCIMachineEvents2["NEXT"] = "NEXT";
|
|
134
136
|
OID4VCIMachineEvents2["PREVIOUS"] = "PREVIOUS";
|
|
135
137
|
OID4VCIMachineEvents2["DECLINE"] = "DECLINE";
|
|
@@ -142,8 +144,8 @@ var OID4VCIMachineEvents = /* @__PURE__ */ function(OID4VCIMachineEvents2) {
|
|
|
142
144
|
OID4VCIMachineEvents2["INVOKED_AUTHORIZATION_CODE_REQUEST"] = "INVOKED_AUTHORIZATION_CODE_REQUEST";
|
|
143
145
|
OID4VCIMachineEvents2["PROVIDE_AUTHORIZATION_CODE_RESPONSE"] = "PROVIDE_AUTHORIZATION_CODE_RESPONSE";
|
|
144
146
|
return OID4VCIMachineEvents2;
|
|
145
|
-
}({});
|
|
146
|
-
var OID4VCIMachineGuards = /* @__PURE__ */ function(OID4VCIMachineGuards2) {
|
|
147
|
+
})({});
|
|
148
|
+
var OID4VCIMachineGuards = /* @__PURE__ */ (function(OID4VCIMachineGuards2) {
|
|
147
149
|
OID4VCIMachineGuards2["hasContactGuard"] = "oid4vciHasContactGuard";
|
|
148
150
|
OID4VCIMachineGuards2["hasNoContactGuard"] = "oid4vciHasNoContactGuard";
|
|
149
151
|
OID4VCIMachineGuards2["credentialsToSelectRequiredGuard"] = "oid4vciCredentialsToSelectRequiredGuard";
|
|
@@ -160,8 +162,8 @@ var OID4VCIMachineGuards = /* @__PURE__ */ function(OID4VCIMachineGuards2) {
|
|
|
160
162
|
OID4VCIMachineGuards2["contactHasLowTrustGuard"] = "oid4vciContactHasLowTrustGuard";
|
|
161
163
|
OID4VCIMachineGuards2["isFirstPartyApplication"] = "oid4vciIsFirstPartyApplication";
|
|
162
164
|
return OID4VCIMachineGuards2;
|
|
163
|
-
}({});
|
|
164
|
-
var OID4VCIMachineServices = /* @__PURE__ */ function(OID4VCIMachineServices2) {
|
|
165
|
+
})({});
|
|
166
|
+
var OID4VCIMachineServices = /* @__PURE__ */ (function(OID4VCIMachineServices2) {
|
|
165
167
|
OID4VCIMachineServices2["start"] = "start";
|
|
166
168
|
OID4VCIMachineServices2["getContact"] = "getContact";
|
|
167
169
|
OID4VCIMachineServices2["getFederationTrust"] = "getFederationTrust";
|
|
@@ -176,17 +178,17 @@ var OID4VCIMachineServices = /* @__PURE__ */ function(OID4VCIMachineServices2) {
|
|
|
176
178
|
OID4VCIMachineServices2["storeCredentials"] = "storeCredentials";
|
|
177
179
|
OID4VCIMachineServices2["startFirstPartApplicationFlow"] = "startFirstPartApplicationFlow";
|
|
178
180
|
return OID4VCIMachineServices2;
|
|
179
|
-
}({});
|
|
180
|
-
var RequestType = /* @__PURE__ */ function(RequestType2) {
|
|
181
|
+
})({});
|
|
182
|
+
var RequestType = /* @__PURE__ */ (function(RequestType2) {
|
|
181
183
|
RequestType2["OPENID_INITIATE_ISSUANCE"] = "openid-initiate-issuance";
|
|
182
184
|
RequestType2["OPENID_CREDENTIAL_OFFER"] = "openid-credential-offer";
|
|
183
185
|
RequestType2["URL"] = "URL";
|
|
184
186
|
return RequestType2;
|
|
185
|
-
}({});
|
|
186
|
-
var IdentifierAliasEnum = /* @__PURE__ */ function(IdentifierAliasEnum2) {
|
|
187
|
+
})({});
|
|
188
|
+
var IdentifierAliasEnum = /* @__PURE__ */ (function(IdentifierAliasEnum2) {
|
|
187
189
|
IdentifierAliasEnum2["PRIMARY"] = "primary";
|
|
188
190
|
return IdentifierAliasEnum2;
|
|
189
|
-
}({});
|
|
191
|
+
})({});
|
|
190
192
|
|
|
191
193
|
// src/localization/Localization.ts
|
|
192
194
|
var Localization = class Localization2 {
|
|
@@ -228,7 +230,7 @@ var Localization = class Localization2 {
|
|
|
228
230
|
var translate = Localization.translate;
|
|
229
231
|
|
|
230
232
|
// src/types/FirstPartyMachine.ts
|
|
231
|
-
var FirstPartyMachineStateTypes = /* @__PURE__ */ function(FirstPartyMachineStateTypes2) {
|
|
233
|
+
var FirstPartyMachineStateTypes = /* @__PURE__ */ (function(FirstPartyMachineStateTypes2) {
|
|
232
234
|
FirstPartyMachineStateTypes2["sendAuthorizationChallengeRequest"] = "sendAuthorizationChallengeRequest";
|
|
233
235
|
FirstPartyMachineStateTypes2["sendAuthorizationResponse"] = "sendAuthorizationResponse";
|
|
234
236
|
FirstPartyMachineStateTypes2["selectCredentials"] = "selectCredentials";
|
|
@@ -239,21 +241,21 @@ var FirstPartyMachineStateTypes = /* @__PURE__ */ function(FirstPartyMachineStat
|
|
|
239
241
|
FirstPartyMachineStateTypes2["aborted"] = "aborted";
|
|
240
242
|
FirstPartyMachineStateTypes2["declined"] = "declined";
|
|
241
243
|
return FirstPartyMachineStateTypes2;
|
|
242
|
-
}({});
|
|
243
|
-
var FirstPartyMachineServices = /* @__PURE__ */ function(FirstPartyMachineServices2) {
|
|
244
|
+
})({});
|
|
245
|
+
var FirstPartyMachineServices = /* @__PURE__ */ (function(FirstPartyMachineServices2) {
|
|
244
246
|
FirstPartyMachineServices2["sendAuthorizationChallengeRequest"] = "sendAuthorizationChallengeRequest";
|
|
245
247
|
FirstPartyMachineServices2["sendAuthorizationResponse"] = "sendAuthorizationResponse";
|
|
246
248
|
FirstPartyMachineServices2["createConfig"] = "createConfig";
|
|
247
249
|
FirstPartyMachineServices2["getSiopRequest"] = "getSiopRequest";
|
|
248
250
|
return FirstPartyMachineServices2;
|
|
249
|
-
}({});
|
|
250
|
-
var FirstPartyMachineEvents = /* @__PURE__ */ function(FirstPartyMachineEvents2) {
|
|
251
|
+
})({});
|
|
252
|
+
var FirstPartyMachineEvents = /* @__PURE__ */ (function(FirstPartyMachineEvents2) {
|
|
251
253
|
FirstPartyMachineEvents2["NEXT"] = "NEXT";
|
|
252
254
|
FirstPartyMachineEvents2["PREVIOUS"] = "PREVIOUS";
|
|
253
255
|
FirstPartyMachineEvents2["DECLINE"] = "DECLINE";
|
|
254
256
|
FirstPartyMachineEvents2["SET_SELECTED_CREDENTIALS"] = "SET_SELECTED_CREDENTIALS";
|
|
255
257
|
return FirstPartyMachineEvents2;
|
|
256
|
-
}({});
|
|
258
|
+
})({});
|
|
257
259
|
|
|
258
260
|
// src/machines/oid4vciMachine.ts
|
|
259
261
|
var oid4vciHasNoContactGuard = /* @__PURE__ */ __name((_ctx, _event) => {
|
|
@@ -1997,7 +1999,7 @@ var getIssuanceCryptoSuite = /* @__PURE__ */ __name(async (opts) => {
|
|
|
1997
1999
|
case "jwt":
|
|
1998
2000
|
case "jwt_vc_json":
|
|
1999
2001
|
case "jwt_vc":
|
|
2000
|
-
//case 'vc+sd-jwt':
|
|
2002
|
+
//case 'vc+sd-jwt': // TODO see SSISDK-52 concerning vc+sd-jwt
|
|
2001
2003
|
case "dc+sd-jwt":
|
|
2002
2004
|
case "mso_mdoc": {
|
|
2003
2005
|
const supportedPreferences = jwtCryptographicSuitePreferences.filter((suite) => signing_algs_supported.includes(suite));
|
|
@@ -2066,7 +2068,6 @@ var startFirstPartApplicationMachine = /* @__PURE__ */ __name(async (args, conte
|
|
|
2066
2068
|
}, "startFirstPartApplicationMachine");
|
|
2067
2069
|
|
|
2068
2070
|
// src/agent/OID4VCIHolder.ts
|
|
2069
|
-
import "cross-fetch/polyfill";
|
|
2070
2071
|
var oid4vciHolderContextMethods = [
|
|
2071
2072
|
"cmGetContacts",
|
|
2072
2073
|
"cmGetContact",
|
|
@@ -2287,7 +2288,6 @@ var OID4VCIHolder = class _OID4VCIHolder {
|
|
|
2287
2288
|
formats = Array.from(new Set(authFormats));
|
|
2288
2289
|
}
|
|
2289
2290
|
let oid4vciClient;
|
|
2290
|
-
let types = void 0;
|
|
2291
2291
|
let offer;
|
|
2292
2292
|
if (requestData.existingClientState) {
|
|
2293
2293
|
oid4vciClient = await OpenID4VCIClient2.fromState({
|
|
@@ -2323,17 +2323,18 @@ var OID4VCIHolder = class _OID4VCIHolder {
|
|
|
2323
2323
|
});
|
|
2324
2324
|
}
|
|
2325
2325
|
}
|
|
2326
|
+
let configurationIds = [];
|
|
2326
2327
|
if (offer) {
|
|
2327
|
-
|
|
2328
|
+
configurationIds = offer.original_credential_offer.credential_configuration_ids;
|
|
2328
2329
|
} else {
|
|
2329
|
-
|
|
2330
|
+
configurationIds = asArray2(authorizationRequestOpts.authorizationDetails).filter((authDetails) => typeof authDetails !== "string").map((authReqOpts) => authReqOpts.credential_configuration_id).filter((id) => !!id);
|
|
2330
2331
|
}
|
|
2331
|
-
const serverMetadata = await oid4vciClient.retrieveServerMetadata();
|
|
2332
2332
|
const credentialsSupported = await getCredentialConfigsSupportedMerged({
|
|
2333
2333
|
client: oid4vciClient,
|
|
2334
2334
|
vcFormatPreferences: formats,
|
|
2335
|
-
|
|
2335
|
+
configurationIds
|
|
2336
2336
|
});
|
|
2337
|
+
const serverMetadata = await oid4vciClient.retrieveServerMetadata();
|
|
2337
2338
|
const credentialBranding = await getCredentialBranding({
|
|
2338
2339
|
credentialsSupported,
|
|
2339
2340
|
context
|