@sphereon/ssi-sdk.oid4vci-holder 0.34.1-feat.SSISDK.35.63 → 0.34.1-feature.DIIPv4.29
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 +54 -77
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -6
- package/dist/index.d.ts +3 -6
- package/dist/index.js +33 -56
- package/dist/index.js.map +1 -1
- package/package.json +24 -25
- package/src/agent/OID4VCIHolder.ts +21 -35
- package/src/services/OID4VCIHolderService.ts +5 -27
- package/src/types/FirstPartyMachine.ts +0 -2
- package/src/types/IOID4VCIHolder.ts +1 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuthorizationChallengeCodeResponse, EndpointMetadataResult, CredentialOfferRequestWithBaseUrl, AuthzFlowType, AuthorizationRequestOpts, AuthorizationServerClientOpts, CredentialConfigurationSupported, ExperimentalSubjectIssuance,
|
|
1
|
+
import { AuthorizationChallengeCodeResponse, EndpointMetadataResult, CredentialOfferRequestWithBaseUrl, AuthzFlowType, AuthorizationRequestOpts, AuthorizationServerClientOpts, CredentialConfigurationSupported, ExperimentalSubjectIssuance, CredentialResponse, AuthorizationResponse, CredentialsSupportedDisplay, IssuerCredentialSubject, MetadataDisplay, NotificationRequest, Jwt } from '@sphereon/oid4vci-common';
|
|
2
2
|
import { IIdentifierResolution, ManagedIdentifierMethod, ManagedIdentifierOptsOrResult, ManagedIdentifierResult } from '@sphereon/ssi-sdk-ext.identifier-resolution';
|
|
3
3
|
import { IJwtService } from '@sphereon/ssi-sdk-ext.jwt-service';
|
|
4
4
|
import { IIdentifier, IPluginMethodMap, IAgentContext, ICredentialVerifier, ICredentialIssuer, IDIDManager, IResolver, IKeyManager, TKeyType, VerificationPolicies, TAgent, IAgentPlugin } from '@veramo/core';
|
|
@@ -16,7 +16,6 @@ import { IDidAuthSiopOpAuthenticator, CreateConfigResult } from '@sphereon/ssi-s
|
|
|
16
16
|
import { IVerifiableCredential, W3CVerifiableCredential, WrappedVerifiableCredential, WrappedVerifiablePresentation, JoseSignatureAlgorithm, JoseSignatureAlgorithmString, HasherSync, SdJwtTypeDisplayMetadata, SdJwtClaimMetadata, OriginalVerifiableCredential } from '@sphereon/ssi-types';
|
|
17
17
|
import { Interpreter, State, StatesConfig, StateMachine, BaseActionObject, ServiceMap, ResolveTypegenMeta, TypegenDisabled } from 'xstate';
|
|
18
18
|
import { RPRegistrationMetadataPayload, PresentationDefinitionWithLocation } from '@sphereon/did-auth-siop';
|
|
19
|
-
import { DcqlQuery } from 'dcql';
|
|
20
19
|
import { LinkHandlerAdapter, DefaultLinkPriorities } from '@sphereon/ssi-sdk.core';
|
|
21
20
|
import { IMachineStatePersistence, SerializableState } from '@sphereon/ssi-sdk.xstate-machine-persistence';
|
|
22
21
|
|
|
@@ -115,7 +114,6 @@ type SiopV2AuthorizationRequestData = {
|
|
|
115
114
|
clientId?: string;
|
|
116
115
|
entityId?: string;
|
|
117
116
|
presentationDefinitions?: PresentationDefinitionWithLocation[];
|
|
118
|
-
dcqlQuery: DcqlQuery;
|
|
119
117
|
};
|
|
120
118
|
type FirstPartyMachineNavigationArgs = {
|
|
121
119
|
firstPartyMachine: FirstPartyMachineInterpreter;
|
|
@@ -358,7 +356,6 @@ declare enum OID4VCIMachineGuards {
|
|
|
358
356
|
requirePinGuard = "oid4vciRequirePinGuard",
|
|
359
357
|
requireAuthorizationGuard = "oid4vciRequireAuthorizationGuard",
|
|
360
358
|
noAuthorizationGuard = "oid4vciNoAuthorizationGuard",
|
|
361
|
-
hasNonceEndpointGuard = "oid4vciHasNonceEndpointGuard ",
|
|
362
359
|
hasAuthorizationResponse = "oid4vciHasAuthorizationResponse",
|
|
363
360
|
hasNoContactIdentityGuard = "oid4vciHasNoContactIdentityGuard",
|
|
364
361
|
verificationCodeGuard = "oid4vciVerificationCodeGuard",
|
|
@@ -485,7 +482,7 @@ type CredentialToAccept = {
|
|
|
485
482
|
id?: string;
|
|
486
483
|
types: string[];
|
|
487
484
|
issuanceOpt: IssuanceOpts;
|
|
488
|
-
credentialResponse:
|
|
485
|
+
credentialResponse: CredentialResponse;
|
|
489
486
|
};
|
|
490
487
|
type GetCredentialConfigsSupportedArgs = {
|
|
491
488
|
client: OpenID4VCIClient;
|
|
@@ -670,7 +667,7 @@ type RequiredContext = IAgentContext<IIssuanceBranding & IContactManager & ICred
|
|
|
670
667
|
* {@inheritDoc IOID4VCIHolder}
|
|
671
668
|
*/
|
|
672
669
|
declare const oid4vciHolderContextMethods: Array<string>;
|
|
673
|
-
declare function signCallback(identifier: ManagedIdentifierOptsOrResult, context: IAgentContext<IKeyManager & IDIDManager & IResolver & IIdentifierResolution & IJwtService>, nonce?: string): (jwt: Jwt, kid?: string
|
|
670
|
+
declare function signCallback(identifier: ManagedIdentifierOptsOrResult, context: IAgentContext<IKeyManager & IDIDManager & IResolver & IIdentifierResolution & IJwtService>, nonce?: string): (jwt: Jwt, kid?: string) => Promise<string>;
|
|
674
671
|
declare class OID4VCIHolder implements IAgentPlugin {
|
|
675
672
|
private readonly hasher?;
|
|
676
673
|
readonly eventTypes: Array<OID4VCIHolderEvent>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuthorizationChallengeCodeResponse, EndpointMetadataResult, CredentialOfferRequestWithBaseUrl, AuthzFlowType, AuthorizationRequestOpts, AuthorizationServerClientOpts, CredentialConfigurationSupported, ExperimentalSubjectIssuance,
|
|
1
|
+
import { AuthorizationChallengeCodeResponse, EndpointMetadataResult, CredentialOfferRequestWithBaseUrl, AuthzFlowType, AuthorizationRequestOpts, AuthorizationServerClientOpts, CredentialConfigurationSupported, ExperimentalSubjectIssuance, CredentialResponse, AuthorizationResponse, CredentialsSupportedDisplay, IssuerCredentialSubject, MetadataDisplay, NotificationRequest, Jwt } from '@sphereon/oid4vci-common';
|
|
2
2
|
import { IIdentifierResolution, ManagedIdentifierMethod, ManagedIdentifierOptsOrResult, ManagedIdentifierResult } from '@sphereon/ssi-sdk-ext.identifier-resolution';
|
|
3
3
|
import { IJwtService } from '@sphereon/ssi-sdk-ext.jwt-service';
|
|
4
4
|
import { IIdentifier, IPluginMethodMap, IAgentContext, ICredentialVerifier, ICredentialIssuer, IDIDManager, IResolver, IKeyManager, TKeyType, VerificationPolicies, TAgent, IAgentPlugin } from '@veramo/core';
|
|
@@ -16,7 +16,6 @@ import { IDidAuthSiopOpAuthenticator, CreateConfigResult } from '@sphereon/ssi-s
|
|
|
16
16
|
import { IVerifiableCredential, W3CVerifiableCredential, WrappedVerifiableCredential, WrappedVerifiablePresentation, JoseSignatureAlgorithm, JoseSignatureAlgorithmString, HasherSync, SdJwtTypeDisplayMetadata, SdJwtClaimMetadata, OriginalVerifiableCredential } from '@sphereon/ssi-types';
|
|
17
17
|
import { Interpreter, State, StatesConfig, StateMachine, BaseActionObject, ServiceMap, ResolveTypegenMeta, TypegenDisabled } from 'xstate';
|
|
18
18
|
import { RPRegistrationMetadataPayload, PresentationDefinitionWithLocation } from '@sphereon/did-auth-siop';
|
|
19
|
-
import { DcqlQuery } from 'dcql';
|
|
20
19
|
import { LinkHandlerAdapter, DefaultLinkPriorities } from '@sphereon/ssi-sdk.core';
|
|
21
20
|
import { IMachineStatePersistence, SerializableState } from '@sphereon/ssi-sdk.xstate-machine-persistence';
|
|
22
21
|
|
|
@@ -115,7 +114,6 @@ type SiopV2AuthorizationRequestData = {
|
|
|
115
114
|
clientId?: string;
|
|
116
115
|
entityId?: string;
|
|
117
116
|
presentationDefinitions?: PresentationDefinitionWithLocation[];
|
|
118
|
-
dcqlQuery: DcqlQuery;
|
|
119
117
|
};
|
|
120
118
|
type FirstPartyMachineNavigationArgs = {
|
|
121
119
|
firstPartyMachine: FirstPartyMachineInterpreter;
|
|
@@ -358,7 +356,6 @@ declare enum OID4VCIMachineGuards {
|
|
|
358
356
|
requirePinGuard = "oid4vciRequirePinGuard",
|
|
359
357
|
requireAuthorizationGuard = "oid4vciRequireAuthorizationGuard",
|
|
360
358
|
noAuthorizationGuard = "oid4vciNoAuthorizationGuard",
|
|
361
|
-
hasNonceEndpointGuard = "oid4vciHasNonceEndpointGuard ",
|
|
362
359
|
hasAuthorizationResponse = "oid4vciHasAuthorizationResponse",
|
|
363
360
|
hasNoContactIdentityGuard = "oid4vciHasNoContactIdentityGuard",
|
|
364
361
|
verificationCodeGuard = "oid4vciVerificationCodeGuard",
|
|
@@ -485,7 +482,7 @@ type CredentialToAccept = {
|
|
|
485
482
|
id?: string;
|
|
486
483
|
types: string[];
|
|
487
484
|
issuanceOpt: IssuanceOpts;
|
|
488
|
-
credentialResponse:
|
|
485
|
+
credentialResponse: CredentialResponse;
|
|
489
486
|
};
|
|
490
487
|
type GetCredentialConfigsSupportedArgs = {
|
|
491
488
|
client: OpenID4VCIClient;
|
|
@@ -670,7 +667,7 @@ type RequiredContext = IAgentContext<IIssuanceBranding & IContactManager & ICred
|
|
|
670
667
|
* {@inheritDoc IOID4VCIHolder}
|
|
671
668
|
*/
|
|
672
669
|
declare const oid4vciHolderContextMethods: Array<string>;
|
|
673
|
-
declare function signCallback(identifier: ManagedIdentifierOptsOrResult, context: IAgentContext<IKeyManager & IDIDManager & IResolver & IIdentifierResolution & IJwtService>, nonce?: string): (jwt: Jwt, kid?: string
|
|
670
|
+
declare function signCallback(identifier: ManagedIdentifierOptsOrResult, context: IAgentContext<IKeyManager & IDIDManager & IResolver & IIdentifierResolution & IJwtService>, nonce?: string): (jwt: Jwt, kid?: string) => Promise<string>;
|
|
674
671
|
declare class OID4VCIHolder implements IAgentPlugin {
|
|
675
672
|
private readonly hasher?;
|
|
676
673
|
readonly eventTypes: Array<OID4VCIHolderEvent>;
|
package/dist/index.js
CHANGED
|
@@ -60,7 +60,6 @@ import { DefaultURISchemes, getTypesFromAuthorizationDetails, getTypesFromCreden
|
|
|
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
|
-
import { defaultHasher as defaultHasher2 } from "@sphereon/ssi-sdk.core";
|
|
64
63
|
import { ConnectionType, CorrelationIdentifierType, CredentialCorrelationType, CredentialRole, ensureRawDocument, IdentityOrigin } from "@sphereon/ssi-sdk.data-store";
|
|
65
64
|
import { CredentialMapper as CredentialMapper2, JoseSignatureAlgorithm as JoseSignatureAlgorithm2, Loggers, parseDid } from "@sphereon/ssi-types";
|
|
66
65
|
import { asArray as asArray2, computeEntryHash } from "@veramo/utils";
|
|
@@ -76,18 +75,18 @@ import i18n from "i18n-js";
|
|
|
76
75
|
import memoize from "lodash.memoize";
|
|
77
76
|
|
|
78
77
|
// src/types/IOID4VCIHolder.ts
|
|
79
|
-
var OID4VCIHolderEvent = /* @__PURE__ */
|
|
78
|
+
var OID4VCIHolderEvent = /* @__PURE__ */ function(OID4VCIHolderEvent2) {
|
|
80
79
|
OID4VCIHolderEvent2["CONTACT_IDENTITY_CREATED"] = "contact_identity_created";
|
|
81
80
|
OID4VCIHolderEvent2["CREDENTIAL_STORED"] = "credential_stored";
|
|
82
81
|
OID4VCIHolderEvent2["IDENTIFIER_CREATED"] = "identifier_created";
|
|
83
82
|
return OID4VCIHolderEvent2;
|
|
84
|
-
}
|
|
85
|
-
var SupportedLanguage = /* @__PURE__ */
|
|
83
|
+
}({});
|
|
84
|
+
var SupportedLanguage = /* @__PURE__ */ function(SupportedLanguage2) {
|
|
86
85
|
SupportedLanguage2["ENGLISH"] = "en";
|
|
87
86
|
SupportedLanguage2["DUTCH"] = "nl";
|
|
88
87
|
return SupportedLanguage2;
|
|
89
|
-
}
|
|
90
|
-
var OID4VCIMachineStates = /* @__PURE__ */
|
|
88
|
+
}({});
|
|
89
|
+
var OID4VCIMachineStates = /* @__PURE__ */ function(OID4VCIMachineStates2) {
|
|
91
90
|
OID4VCIMachineStates2["start"] = "start";
|
|
92
91
|
OID4VCIMachineStates2["createCredentialsToSelectFrom"] = "createCredentialsToSelectFrom";
|
|
93
92
|
OID4VCIMachineStates2["getContact"] = "getContact";
|
|
@@ -118,18 +117,18 @@ var OID4VCIMachineStates = /* @__PURE__ */ (function(OID4VCIMachineStates2) {
|
|
|
118
117
|
OID4VCIMachineStates2["error"] = "error";
|
|
119
118
|
OID4VCIMachineStates2["done"] = "done";
|
|
120
119
|
return OID4VCIMachineStates2;
|
|
121
|
-
}
|
|
122
|
-
var OID4VCIMachineAddContactStates = /* @__PURE__ */
|
|
120
|
+
}({});
|
|
121
|
+
var OID4VCIMachineAddContactStates = /* @__PURE__ */ function(OID4VCIMachineAddContactStates2) {
|
|
123
122
|
OID4VCIMachineAddContactStates2["idle"] = "idle";
|
|
124
123
|
OID4VCIMachineAddContactStates2["next"] = "next";
|
|
125
124
|
return OID4VCIMachineAddContactStates2;
|
|
126
|
-
}
|
|
127
|
-
var OID4VCIMachineVerifyPinStates = /* @__PURE__ */
|
|
125
|
+
}({});
|
|
126
|
+
var OID4VCIMachineVerifyPinStates = /* @__PURE__ */ function(OID4VCIMachineVerifyPinStates2) {
|
|
128
127
|
OID4VCIMachineVerifyPinStates2["idle"] = "idle";
|
|
129
128
|
OID4VCIMachineVerifyPinStates2["next"] = "next";
|
|
130
129
|
return OID4VCIMachineVerifyPinStates2;
|
|
131
|
-
}
|
|
132
|
-
var OID4VCIMachineEvents = /* @__PURE__ */
|
|
130
|
+
}({});
|
|
131
|
+
var OID4VCIMachineEvents = /* @__PURE__ */ function(OID4VCIMachineEvents2) {
|
|
133
132
|
OID4VCIMachineEvents2["NEXT"] = "NEXT";
|
|
134
133
|
OID4VCIMachineEvents2["PREVIOUS"] = "PREVIOUS";
|
|
135
134
|
OID4VCIMachineEvents2["DECLINE"] = "DECLINE";
|
|
@@ -142,15 +141,14 @@ var OID4VCIMachineEvents = /* @__PURE__ */ (function(OID4VCIMachineEvents2) {
|
|
|
142
141
|
OID4VCIMachineEvents2["INVOKED_AUTHORIZATION_CODE_REQUEST"] = "INVOKED_AUTHORIZATION_CODE_REQUEST";
|
|
143
142
|
OID4VCIMachineEvents2["PROVIDE_AUTHORIZATION_CODE_RESPONSE"] = "PROVIDE_AUTHORIZATION_CODE_RESPONSE";
|
|
144
143
|
return OID4VCIMachineEvents2;
|
|
145
|
-
}
|
|
146
|
-
var OID4VCIMachineGuards = /* @__PURE__ */
|
|
144
|
+
}({});
|
|
145
|
+
var OID4VCIMachineGuards = /* @__PURE__ */ function(OID4VCIMachineGuards2) {
|
|
147
146
|
OID4VCIMachineGuards2["hasContactGuard"] = "oid4vciHasContactGuard";
|
|
148
147
|
OID4VCIMachineGuards2["hasNoContactGuard"] = "oid4vciHasNoContactGuard";
|
|
149
148
|
OID4VCIMachineGuards2["credentialsToSelectRequiredGuard"] = "oid4vciCredentialsToSelectRequiredGuard";
|
|
150
149
|
OID4VCIMachineGuards2["requirePinGuard"] = "oid4vciRequirePinGuard";
|
|
151
150
|
OID4VCIMachineGuards2["requireAuthorizationGuard"] = "oid4vciRequireAuthorizationGuard";
|
|
152
151
|
OID4VCIMachineGuards2["noAuthorizationGuard"] = "oid4vciNoAuthorizationGuard";
|
|
153
|
-
OID4VCIMachineGuards2["hasNonceEndpointGuard"] = "oid4vciHasNonceEndpointGuard ";
|
|
154
152
|
OID4VCIMachineGuards2["hasAuthorizationResponse"] = "oid4vciHasAuthorizationResponse";
|
|
155
153
|
OID4VCIMachineGuards2["hasNoContactIdentityGuard"] = "oid4vciHasNoContactIdentityGuard";
|
|
156
154
|
OID4VCIMachineGuards2["verificationCodeGuard"] = "oid4vciVerificationCodeGuard";
|
|
@@ -160,8 +158,8 @@ var OID4VCIMachineGuards = /* @__PURE__ */ (function(OID4VCIMachineGuards2) {
|
|
|
160
158
|
OID4VCIMachineGuards2["contactHasLowTrustGuard"] = "oid4vciContactHasLowTrustGuard";
|
|
161
159
|
OID4VCIMachineGuards2["isFirstPartyApplication"] = "oid4vciIsFirstPartyApplication";
|
|
162
160
|
return OID4VCIMachineGuards2;
|
|
163
|
-
}
|
|
164
|
-
var OID4VCIMachineServices = /* @__PURE__ */
|
|
161
|
+
}({});
|
|
162
|
+
var OID4VCIMachineServices = /* @__PURE__ */ function(OID4VCIMachineServices2) {
|
|
165
163
|
OID4VCIMachineServices2["start"] = "start";
|
|
166
164
|
OID4VCIMachineServices2["getContact"] = "getContact";
|
|
167
165
|
OID4VCIMachineServices2["getFederationTrust"] = "getFederationTrust";
|
|
@@ -176,17 +174,17 @@ var OID4VCIMachineServices = /* @__PURE__ */ (function(OID4VCIMachineServices2)
|
|
|
176
174
|
OID4VCIMachineServices2["storeCredentials"] = "storeCredentials";
|
|
177
175
|
OID4VCIMachineServices2["startFirstPartApplicationFlow"] = "startFirstPartApplicationFlow";
|
|
178
176
|
return OID4VCIMachineServices2;
|
|
179
|
-
}
|
|
180
|
-
var RequestType = /* @__PURE__ */
|
|
177
|
+
}({});
|
|
178
|
+
var RequestType = /* @__PURE__ */ function(RequestType2) {
|
|
181
179
|
RequestType2["OPENID_INITIATE_ISSUANCE"] = "openid-initiate-issuance";
|
|
182
180
|
RequestType2["OPENID_CREDENTIAL_OFFER"] = "openid-credential-offer";
|
|
183
181
|
RequestType2["URL"] = "URL";
|
|
184
182
|
return RequestType2;
|
|
185
|
-
}
|
|
186
|
-
var IdentifierAliasEnum = /* @__PURE__ */
|
|
183
|
+
}({});
|
|
184
|
+
var IdentifierAliasEnum = /* @__PURE__ */ function(IdentifierAliasEnum2) {
|
|
187
185
|
IdentifierAliasEnum2["PRIMARY"] = "primary";
|
|
188
186
|
return IdentifierAliasEnum2;
|
|
189
|
-
}
|
|
187
|
+
}({});
|
|
190
188
|
|
|
191
189
|
// src/localization/Localization.ts
|
|
192
190
|
var Localization = class Localization2 {
|
|
@@ -228,7 +226,7 @@ var Localization = class Localization2 {
|
|
|
228
226
|
var translate = Localization.translate;
|
|
229
227
|
|
|
230
228
|
// src/types/FirstPartyMachine.ts
|
|
231
|
-
var FirstPartyMachineStateTypes = /* @__PURE__ */
|
|
229
|
+
var FirstPartyMachineStateTypes = /* @__PURE__ */ function(FirstPartyMachineStateTypes2) {
|
|
232
230
|
FirstPartyMachineStateTypes2["sendAuthorizationChallengeRequest"] = "sendAuthorizationChallengeRequest";
|
|
233
231
|
FirstPartyMachineStateTypes2["sendAuthorizationResponse"] = "sendAuthorizationResponse";
|
|
234
232
|
FirstPartyMachineStateTypes2["selectCredentials"] = "selectCredentials";
|
|
@@ -239,21 +237,21 @@ var FirstPartyMachineStateTypes = /* @__PURE__ */ (function(FirstPartyMachineSta
|
|
|
239
237
|
FirstPartyMachineStateTypes2["aborted"] = "aborted";
|
|
240
238
|
FirstPartyMachineStateTypes2["declined"] = "declined";
|
|
241
239
|
return FirstPartyMachineStateTypes2;
|
|
242
|
-
}
|
|
243
|
-
var FirstPartyMachineServices = /* @__PURE__ */
|
|
240
|
+
}({});
|
|
241
|
+
var FirstPartyMachineServices = /* @__PURE__ */ function(FirstPartyMachineServices2) {
|
|
244
242
|
FirstPartyMachineServices2["sendAuthorizationChallengeRequest"] = "sendAuthorizationChallengeRequest";
|
|
245
243
|
FirstPartyMachineServices2["sendAuthorizationResponse"] = "sendAuthorizationResponse";
|
|
246
244
|
FirstPartyMachineServices2["createConfig"] = "createConfig";
|
|
247
245
|
FirstPartyMachineServices2["getSiopRequest"] = "getSiopRequest";
|
|
248
246
|
return FirstPartyMachineServices2;
|
|
249
|
-
}
|
|
250
|
-
var FirstPartyMachineEvents = /* @__PURE__ */
|
|
247
|
+
}({});
|
|
248
|
+
var FirstPartyMachineEvents = /* @__PURE__ */ function(FirstPartyMachineEvents2) {
|
|
251
249
|
FirstPartyMachineEvents2["NEXT"] = "NEXT";
|
|
252
250
|
FirstPartyMachineEvents2["PREVIOUS"] = "PREVIOUS";
|
|
253
251
|
FirstPartyMachineEvents2["DECLINE"] = "DECLINE";
|
|
254
252
|
FirstPartyMachineEvents2["SET_SELECTED_CREDENTIALS"] = "SET_SELECTED_CREDENTIALS";
|
|
255
253
|
return FirstPartyMachineEvents2;
|
|
256
|
-
}
|
|
254
|
+
}({});
|
|
257
255
|
|
|
258
256
|
// src/machines/oid4vciMachine.ts
|
|
259
257
|
var oid4vciHasNoContactGuard = /* @__PURE__ */ __name((_ctx, _event) => {
|
|
@@ -1540,7 +1538,7 @@ var getCredentialBranding = /* @__PURE__ */ __name(async (args) => {
|
|
|
1540
1538
|
const credentialBranding = {};
|
|
1541
1539
|
await Promise.all(Object.entries(credentialsSupported).map(async ([configId, credentialsConfigSupported]) => {
|
|
1542
1540
|
let sdJwtTypeMetadata;
|
|
1543
|
-
if (credentialsConfigSupported.format === "
|
|
1541
|
+
if (credentialsConfigSupported.format === "vc+sd-jwt") {
|
|
1544
1542
|
const vct = credentialsConfigSupported.vct;
|
|
1545
1543
|
if (vct.startsWith("http")) {
|
|
1546
1544
|
try {
|
|
@@ -1606,13 +1604,7 @@ var selectCredentialLocaleBranding = /* @__PURE__ */ __name(async (args) => {
|
|
|
1606
1604
|
}, "selectCredentialLocaleBranding");
|
|
1607
1605
|
var verifyCredentialToAccept = /* @__PURE__ */ __name(async (args) => {
|
|
1608
1606
|
const { mappedCredential, hasher, onVerifyEBSICredentialIssuer, schemaValidation, context } = args;
|
|
1609
|
-
const
|
|
1610
|
-
let credential;
|
|
1611
|
-
if ("credential" in credentialResponse) {
|
|
1612
|
-
credential = credentialResponse.credential;
|
|
1613
|
-
} else if ("credentials" in credentialResponse && credentialResponse.credentials && Array.isArray(credentialResponse.credentials) && credentialResponse.credentials.length > 0) {
|
|
1614
|
-
credential = credentialResponse.credentials[0].credential;
|
|
1615
|
-
}
|
|
1607
|
+
const credential = mappedCredential.credentialToAccept.credentialResponse.credential;
|
|
1616
1608
|
if (!credential) {
|
|
1617
1609
|
return Promise.reject(Error("No credential found in credential response"));
|
|
1618
1610
|
}
|
|
@@ -1668,12 +1660,7 @@ var verifyCredentialToAccept = /* @__PURE__ */ __name(async (args) => {
|
|
|
1668
1660
|
var mapCredentialToAccept = /* @__PURE__ */ __name(async (args) => {
|
|
1669
1661
|
const { credentialToAccept, hasher } = args;
|
|
1670
1662
|
const credentialResponse = credentialToAccept.credentialResponse;
|
|
1671
|
-
|
|
1672
|
-
if ("credential" in credentialResponse) {
|
|
1673
|
-
verifiableCredential = credentialResponse.credential;
|
|
1674
|
-
} else if ("credentials" in credentialResponse && credentialResponse.credentials && Array.isArray(credentialResponse.credentials) && credentialResponse.credentials.length > 0) {
|
|
1675
|
-
verifiableCredential = credentialResponse.credentials[0].credential;
|
|
1676
|
-
}
|
|
1663
|
+
const verifiableCredential = credentialResponse.credential;
|
|
1677
1664
|
if (!verifiableCredential) {
|
|
1678
1665
|
return Promise.reject(Error("No credential found in credential response"));
|
|
1679
1666
|
}
|
|
@@ -2008,7 +1995,6 @@ var getIssuanceCryptoSuite = /* @__PURE__ */ __name(async (opts) => {
|
|
|
2008
1995
|
case "jwt_vc_json":
|
|
2009
1996
|
case "jwt_vc":
|
|
2010
1997
|
case "vc+sd-jwt":
|
|
2011
|
-
case "dc+sd-jwt":
|
|
2012
1998
|
case "mso_mdoc": {
|
|
2013
1999
|
const supportedPreferences = jwtCryptographicSuitePreferences.filter((suite) => signing_algs_supported.includes(suite));
|
|
2014
2000
|
if (supportedPreferences.length > 0) {
|
|
@@ -2077,6 +2063,7 @@ var startFirstPartApplicationMachine = /* @__PURE__ */ __name(async (args, conte
|
|
|
2077
2063
|
|
|
2078
2064
|
// src/agent/OID4VCIHolder.ts
|
|
2079
2065
|
import "cross-fetch/polyfill";
|
|
2066
|
+
import { defaultHasher as defaultHasher2 } from "@sphereon/ssi-sdk.core";
|
|
2080
2067
|
var oid4vciHolderContextMethods = [
|
|
2081
2068
|
"cmGetContacts",
|
|
2082
2069
|
"cmGetContact",
|
|
@@ -2092,7 +2079,7 @@ var oid4vciHolderContextMethods = [
|
|
|
2092
2079
|
];
|
|
2093
2080
|
var logger = Loggers.DEFAULT.get("sphereon:oid4vci:holder");
|
|
2094
2081
|
function signCallback(identifier, context, nonce) {
|
|
2095
|
-
return async (jwt, kid
|
|
2082
|
+
return async (jwt, kid) => {
|
|
2096
2083
|
let resolution = await context.agent.identifierManagedGet(identifier);
|
|
2097
2084
|
const jwk = jwt.header.jwk ?? (resolution.method === "jwk" ? resolution.jwk : void 0);
|
|
2098
2085
|
if (!resolution.issuer && !jwt.payload.iss) {
|
|
@@ -2110,7 +2097,7 @@ function signCallback(identifier, context, nonce) {
|
|
|
2110
2097
|
return (await context.agent.jwtCreateJwsCompactSignature({
|
|
2111
2098
|
issuer: {
|
|
2112
2099
|
...resolution,
|
|
2113
|
-
noIssPayloadUpdate:
|
|
2100
|
+
noIssPayloadUpdate: false
|
|
2114
2101
|
},
|
|
2115
2102
|
protectedHeader: header,
|
|
2116
2103
|
payload
|
|
@@ -2145,7 +2132,6 @@ var OID4VCIHolder = class _OID4VCIHolder {
|
|
|
2145
2132
|
oid4vciHolderStoreIssuerBranding: this.oid4vciHolderStoreIssuerBranding.bind(this)
|
|
2146
2133
|
};
|
|
2147
2134
|
vcFormatPreferences = [
|
|
2148
|
-
"dc+sd-jwt",
|
|
2149
2135
|
"vc+sd-jwt",
|
|
2150
2136
|
"mso_mdoc",
|
|
2151
2137
|
"jwt_vc_json",
|
|
@@ -2732,16 +2718,7 @@ var OID4VCIHolder = class _OID4VCIHolder {
|
|
|
2732
2718
|
if (Array.isArray(subjectIssuance?.notification_events_supported)) {
|
|
2733
2719
|
event = subjectIssuance.notification_events_supported.includes("credential_accepted_holder_signed") ? "credential_accepted_holder_signed" : "credential_deleted_holder_signed";
|
|
2734
2720
|
logger.log(`Subject issuance/signing will be used, with event`, event);
|
|
2735
|
-
const
|
|
2736
|
-
let issuerVC;
|
|
2737
|
-
if ("credential" in credentialResponse) {
|
|
2738
|
-
issuerVC = credentialResponse.credential;
|
|
2739
|
-
} else if ("credentials" in credentialResponse && credentialResponse.credentials && Array.isArray(credentialResponse.credentials) && credentialResponse.credentials.length > 0) {
|
|
2740
|
-
issuerVC = credentialResponse.credentials[0].credential;
|
|
2741
|
-
}
|
|
2742
|
-
if (!issuerVC) {
|
|
2743
|
-
return Promise.reject(Error("No credential found in credential response"));
|
|
2744
|
-
}
|
|
2721
|
+
const issuerVC = mappedCredentialToAccept.credentialToAccept.credentialResponse.credential;
|
|
2745
2722
|
const wrappedIssuerVC = CredentialMapper2.toWrappedVerifiableCredential(issuerVC, {
|
|
2746
2723
|
hasher: this.hasher ?? defaultHasher2
|
|
2747
2724
|
});
|