@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.d.cts
CHANGED
|
@@ -2,16 +2,16 @@ import { AuthorizationChallengeCodeResponse, EndpointMetadataResult, CredentialO
|
|
|
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';
|
|
5
|
-
import { OpenID4VCIClientState, OpenID4VCIClient } from '@sphereon/oid4vci-client';
|
|
6
5
|
import { DynamicRegistrationClientMetadata } from '@sphereon/oid4vc-common';
|
|
6
|
+
import { OpenID4VCIClientState, OpenID4VCIClientV1_0_15 } from '@sphereon/oid4vci-client';
|
|
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 { ICredentialValidation, SchemaValidation } from '@sphereon/ssi-sdk.credential-validation';
|
|
10
11
|
import { Party, DidAuthConfig, IIssuerLocaleBranding, IBasicIssuerLocaleBranding, IBasicCredentialLocaleBranding, Identity, DigitalCredential, IBasicCredentialClaim } from '@sphereon/ssi-sdk.data-store-types';
|
|
11
12
|
import { IIssuanceBranding } from '@sphereon/ssi-sdk.issuance-branding';
|
|
12
13
|
import { ImDLMdoc } from '@sphereon/ssi-sdk.mdl-mdoc';
|
|
13
14
|
import { ISDJwtPlugin } from '@sphereon/ssi-sdk.sd-jwt';
|
|
14
|
-
import { ICredentialValidation, SchemaValidation } from '@sphereon/ssi-sdk.credential-validation';
|
|
15
15
|
import { IDidAuthSiopOpAuthenticator, CreateConfigResult } from '@sphereon/ssi-sdk.siopv2-oid4vp-op-auth';
|
|
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';
|
|
@@ -493,7 +493,7 @@ type CredentialToAccept = {
|
|
|
493
493
|
credentialResponse: CredentialResponseV1_0_15 | CredentialResponse;
|
|
494
494
|
};
|
|
495
495
|
type GetCredentialConfigsSupportedArgs = {
|
|
496
|
-
client:
|
|
496
|
+
client: OpenID4VCIClientV1_0_15;
|
|
497
497
|
vcFormatPreferences: Array<string>;
|
|
498
498
|
format?: Array<string>;
|
|
499
499
|
types?: Array<Array<string>>;
|
|
@@ -504,7 +504,7 @@ type GetCredentialConfigsSupportedArgs = {
|
|
|
504
504
|
* It can potentially return multiple results mainly because of different formats.
|
|
505
505
|
*/
|
|
506
506
|
type GetCredentialConfigsSupportedBySingleTypeOrIdArgs = {
|
|
507
|
-
client:
|
|
507
|
+
client: OpenID4VCIClientV1_0_15;
|
|
508
508
|
vcFormatPreferences: Array<string>;
|
|
509
509
|
format?: string[];
|
|
510
510
|
types?: string[];
|
|
@@ -533,7 +533,7 @@ type GetDefaultIssuanceOptsArgs = {
|
|
|
533
533
|
context: RequiredContext;
|
|
534
534
|
};
|
|
535
535
|
type DefaultIssuanceOpts = {
|
|
536
|
-
client:
|
|
536
|
+
client: OpenID4VCIClientV1_0_15;
|
|
537
537
|
};
|
|
538
538
|
type GetIdentifierArgs = {
|
|
539
539
|
issuanceOpt: IssuanceOpts;
|
|
@@ -563,7 +563,7 @@ type CreateIdentifierCreateOpts = {
|
|
|
563
563
|
options?: IdentifierProviderOpts;
|
|
564
564
|
};
|
|
565
565
|
type GetIssuanceOptsArgs = {
|
|
566
|
-
client:
|
|
566
|
+
client: OpenID4VCIClientV1_0_15;
|
|
567
567
|
credentialsSupported: Record<string, CredentialConfigurationSupported>;
|
|
568
568
|
serverMetadata: EndpointMetadataResult;
|
|
569
569
|
context: RequiredContext;
|
|
@@ -574,19 +574,19 @@ type GetIssuanceOptsArgs = {
|
|
|
574
574
|
};
|
|
575
575
|
type GetIssuanceDidMethodArgs = {
|
|
576
576
|
credentialSupported: CredentialConfigurationSupported;
|
|
577
|
-
client:
|
|
577
|
+
client: OpenID4VCIClientV1_0_15;
|
|
578
578
|
didMethodPreferences: Array<SupportedDidMethodEnum>;
|
|
579
579
|
};
|
|
580
580
|
type GetIssuanceCryptoSuiteArgs = {
|
|
581
581
|
credentialSupported: CredentialConfigurationSupported;
|
|
582
|
-
client:
|
|
582
|
+
client: OpenID4VCIClientV1_0_15;
|
|
583
583
|
jwtCryptographicSuitePreferences: Array<JoseSignatureAlgorithm | JoseSignatureAlgorithmString>;
|
|
584
584
|
jsonldCryptographicSuitePreferences: Array<string>;
|
|
585
585
|
};
|
|
586
586
|
type GetCredentialArgs = {
|
|
587
587
|
pin?: string;
|
|
588
588
|
issuanceOpt: IssuanceOpts;
|
|
589
|
-
client:
|
|
589
|
+
client: OpenID4VCIClientV1_0_15;
|
|
590
590
|
accessTokenOpts?: AccessTokenOpts;
|
|
591
591
|
};
|
|
592
592
|
type AccessTokenOpts = {
|
package/dist/index.d.ts
CHANGED
|
@@ -2,16 +2,16 @@ import { AuthorizationChallengeCodeResponse, EndpointMetadataResult, CredentialO
|
|
|
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';
|
|
5
|
-
import { OpenID4VCIClientState, OpenID4VCIClient } from '@sphereon/oid4vci-client';
|
|
6
5
|
import { DynamicRegistrationClientMetadata } from '@sphereon/oid4vc-common';
|
|
6
|
+
import { OpenID4VCIClientState, OpenID4VCIClientV1_0_15 } from '@sphereon/oid4vci-client';
|
|
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 { ICredentialValidation, SchemaValidation } from '@sphereon/ssi-sdk.credential-validation';
|
|
10
11
|
import { Party, DidAuthConfig, IIssuerLocaleBranding, IBasicIssuerLocaleBranding, IBasicCredentialLocaleBranding, Identity, DigitalCredential, IBasicCredentialClaim } from '@sphereon/ssi-sdk.data-store-types';
|
|
11
12
|
import { IIssuanceBranding } from '@sphereon/ssi-sdk.issuance-branding';
|
|
12
13
|
import { ImDLMdoc } from '@sphereon/ssi-sdk.mdl-mdoc';
|
|
13
14
|
import { ISDJwtPlugin } from '@sphereon/ssi-sdk.sd-jwt';
|
|
14
|
-
import { ICredentialValidation, SchemaValidation } from '@sphereon/ssi-sdk.credential-validation';
|
|
15
15
|
import { IDidAuthSiopOpAuthenticator, CreateConfigResult } from '@sphereon/ssi-sdk.siopv2-oid4vp-op-auth';
|
|
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';
|
|
@@ -493,7 +493,7 @@ type CredentialToAccept = {
|
|
|
493
493
|
credentialResponse: CredentialResponseV1_0_15 | CredentialResponse;
|
|
494
494
|
};
|
|
495
495
|
type GetCredentialConfigsSupportedArgs = {
|
|
496
|
-
client:
|
|
496
|
+
client: OpenID4VCIClientV1_0_15;
|
|
497
497
|
vcFormatPreferences: Array<string>;
|
|
498
498
|
format?: Array<string>;
|
|
499
499
|
types?: Array<Array<string>>;
|
|
@@ -504,7 +504,7 @@ type GetCredentialConfigsSupportedArgs = {
|
|
|
504
504
|
* It can potentially return multiple results mainly because of different formats.
|
|
505
505
|
*/
|
|
506
506
|
type GetCredentialConfigsSupportedBySingleTypeOrIdArgs = {
|
|
507
|
-
client:
|
|
507
|
+
client: OpenID4VCIClientV1_0_15;
|
|
508
508
|
vcFormatPreferences: Array<string>;
|
|
509
509
|
format?: string[];
|
|
510
510
|
types?: string[];
|
|
@@ -533,7 +533,7 @@ type GetDefaultIssuanceOptsArgs = {
|
|
|
533
533
|
context: RequiredContext;
|
|
534
534
|
};
|
|
535
535
|
type DefaultIssuanceOpts = {
|
|
536
|
-
client:
|
|
536
|
+
client: OpenID4VCIClientV1_0_15;
|
|
537
537
|
};
|
|
538
538
|
type GetIdentifierArgs = {
|
|
539
539
|
issuanceOpt: IssuanceOpts;
|
|
@@ -563,7 +563,7 @@ type CreateIdentifierCreateOpts = {
|
|
|
563
563
|
options?: IdentifierProviderOpts;
|
|
564
564
|
};
|
|
565
565
|
type GetIssuanceOptsArgs = {
|
|
566
|
-
client:
|
|
566
|
+
client: OpenID4VCIClientV1_0_15;
|
|
567
567
|
credentialsSupported: Record<string, CredentialConfigurationSupported>;
|
|
568
568
|
serverMetadata: EndpointMetadataResult;
|
|
569
569
|
context: RequiredContext;
|
|
@@ -574,19 +574,19 @@ type GetIssuanceOptsArgs = {
|
|
|
574
574
|
};
|
|
575
575
|
type GetIssuanceDidMethodArgs = {
|
|
576
576
|
credentialSupported: CredentialConfigurationSupported;
|
|
577
|
-
client:
|
|
577
|
+
client: OpenID4VCIClientV1_0_15;
|
|
578
578
|
didMethodPreferences: Array<SupportedDidMethodEnum>;
|
|
579
579
|
};
|
|
580
580
|
type GetIssuanceCryptoSuiteArgs = {
|
|
581
581
|
credentialSupported: CredentialConfigurationSupported;
|
|
582
|
-
client:
|
|
582
|
+
client: OpenID4VCIClientV1_0_15;
|
|
583
583
|
jwtCryptographicSuitePreferences: Array<JoseSignatureAlgorithm | JoseSignatureAlgorithmString>;
|
|
584
584
|
jsonldCryptographicSuitePreferences: Array<string>;
|
|
585
585
|
};
|
|
586
586
|
type GetCredentialArgs = {
|
|
587
587
|
pin?: string;
|
|
588
588
|
issuanceOpt: IssuanceOpts;
|
|
589
|
-
client:
|
|
589
|
+
client: OpenID4VCIClientV1_0_15;
|
|
590
590
|
accessTokenOpts?: AccessTokenOpts;
|
|
591
591
|
};
|
|
592
592
|
type AccessTokenOpts = {
|
package/dist/index.js
CHANGED
|
@@ -55,7 +55,7 @@ var require_nl = __commonJS({
|
|
|
55
55
|
});
|
|
56
56
|
|
|
57
57
|
// src/agent/OID4VCIHolder.ts
|
|
58
|
-
import { CredentialOfferClient, MetadataClient, OpenID4VCIClient as OpenID4VCIClient2 } from "@sphereon/oid4vci-client";
|
|
58
|
+
import { CredentialOfferClient, MetadataClient, OpenID4VCIClient as OpenID4VCIClient2, OpenID4VCIClientV1_0_15 } from "@sphereon/oid4vci-client";
|
|
59
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";
|
|
@@ -311,7 +311,7 @@ var oid4vciRequireAuthorizationGuard = /* @__PURE__ */ __name((ctx, _event) => {
|
|
|
311
311
|
if (!openID4VCIClientState) {
|
|
312
312
|
throw Error("Missing openID4VCI client state in context");
|
|
313
313
|
}
|
|
314
|
-
if (openID4VCIClientState.authorizationRequestOpts) {
|
|
314
|
+
if (openID4VCIClientState.authorizationURL && openID4VCIClientState.authorizationRequestOpts) {
|
|
315
315
|
return !ctx.openID4VCIClientState?.authorizationCodeResponse;
|
|
316
316
|
} else if (openID4VCIClientState.credentialOffer?.supportedFlows?.includes(AuthzFlowType.AUTHORIZATION_CODE_FLOW)) {
|
|
317
317
|
return !ctx.openID4VCIClientState?.authorizationCodeResponse;
|
|
@@ -598,6 +598,10 @@ var createOID4VCIMachine = /* @__PURE__ */ __name((opts) => {
|
|
|
598
598
|
target: OID4VCIMachineStates.startFirstPartApplicationFlow,
|
|
599
599
|
cond: OID4VCIMachineGuards.isFirstPartyApplication
|
|
600
600
|
},
|
|
601
|
+
{
|
|
602
|
+
target: OID4VCIMachineStates.prepareAuthorizationRequest,
|
|
603
|
+
cond: OID4VCIMachineGuards.requireAuthorizationGuard
|
|
604
|
+
},
|
|
601
605
|
{
|
|
602
606
|
target: OID4VCIMachineStates.initiateAuthorizationRequest,
|
|
603
607
|
cond: OID4VCIMachineGuards.requireAuthorizationGuard
|
|
@@ -673,6 +677,10 @@ var createOID4VCIMachine = /* @__PURE__ */ __name((opts) => {
|
|
|
673
677
|
target: OID4VCIMachineStates.startFirstPartApplicationFlow,
|
|
674
678
|
cond: OID4VCIMachineGuards.isFirstPartyApplication
|
|
675
679
|
},
|
|
680
|
+
{
|
|
681
|
+
target: OID4VCIMachineStates.prepareAuthorizationRequest,
|
|
682
|
+
cond: OID4VCIMachineGuards.requireAuthorizationGuard
|
|
683
|
+
},
|
|
676
684
|
{
|
|
677
685
|
target: OID4VCIMachineStates.verifyPin,
|
|
678
686
|
cond: OID4VCIMachineGuards.requirePinGuard
|
|
@@ -1686,7 +1694,7 @@ var mapCredentialToAccept = /* @__PURE__ */ __name(async (args) => {
|
|
|
1686
1694
|
});
|
|
1687
1695
|
let uniformVerifiableCredential;
|
|
1688
1696
|
if (CredentialMapper.isSdJwtDecodedCredential(wrappedVerifiableCredential.credential)) {
|
|
1689
|
-
uniformVerifiableCredential =
|
|
1697
|
+
uniformVerifiableCredential = sdJwtDecodedCredentialToUniformCredential(wrappedVerifiableCredential.credential);
|
|
1690
1698
|
} else if (CredentialMapper.isSdJwtEncoded(wrappedVerifiableCredential.credential)) {
|
|
1691
1699
|
if (!hasher) {
|
|
1692
1700
|
return Promise.reject("a hasher is required for encoded SD-JWT credentials");
|
|
@@ -1832,7 +1840,7 @@ var getCredentialConfigsSupportedBySingleTypeOrId = /* @__PURE__ */ __name(async
|
|
|
1832
1840
|
}
|
|
1833
1841
|
__name(createIdFromTypes, "createIdFromTypes");
|
|
1834
1842
|
if (configurationId) {
|
|
1835
|
-
const allSupported2 = client.getCredentialsSupported(format);
|
|
1843
|
+
const allSupported2 = client.getCredentialsSupported(void 0, format);
|
|
1836
1844
|
return Object.fromEntries(Object.entries(allSupported2).filter(([id, supported]) => id === configurationId || supported.id === configurationId || createIdFromTypes(supported) === configurationId));
|
|
1837
1845
|
}
|
|
1838
1846
|
if (!client.credentialOffer) {
|
|
@@ -2312,7 +2320,7 @@ var OID4VCIHolder = class _OID4VCIHolder {
|
|
|
2312
2320
|
let oid4vciClient;
|
|
2313
2321
|
let offer;
|
|
2314
2322
|
if (requestData.existingClientState) {
|
|
2315
|
-
oid4vciClient = await
|
|
2323
|
+
oid4vciClient = await OpenID4VCIClientV1_0_15.fromState({
|
|
2316
2324
|
state: requestData.existingClientState
|
|
2317
2325
|
});
|
|
2318
2326
|
offer = oid4vciClient.credentialOffer;
|
|
@@ -2329,7 +2337,7 @@ var OID4VCIHolder = class _OID4VCIHolder {
|
|
|
2329
2337
|
}
|
|
2330
2338
|
if (!offer) {
|
|
2331
2339
|
logger.log(`Issuer url received (no credential offer): ${uri}`);
|
|
2332
|
-
oid4vciClient = await
|
|
2340
|
+
oid4vciClient = await OpenID4VCIClientV1_0_15.fromCredentialIssuer({
|
|
2333
2341
|
credentialIssuer: uri,
|
|
2334
2342
|
authorizationRequest: authorizationRequestOpts,
|
|
2335
2343
|
clientId: authorizationRequestOpts.clientId,
|
|
@@ -2337,7 +2345,7 @@ var OID4VCIHolder = class _OID4VCIHolder {
|
|
|
2337
2345
|
});
|
|
2338
2346
|
} else {
|
|
2339
2347
|
logger.log(`Credential offer received: ${uri}`);
|
|
2340
|
-
oid4vciClient = await
|
|
2348
|
+
oid4vciClient = await OpenID4VCIClientV1_0_15.fromURI({
|
|
2341
2349
|
uri,
|
|
2342
2350
|
authorizationRequest: authorizationRequestOpts,
|
|
2343
2351
|
clientId: authorizationRequestOpts.clientId,
|
|
@@ -2470,7 +2478,7 @@ var OID4VCIHolder = class _OID4VCIHolder {
|
|
|
2470
2478
|
if (!openID4VCIClientState) {
|
|
2471
2479
|
return Promise.reject(Error("Missing openID4VCI client state in context"));
|
|
2472
2480
|
}
|
|
2473
|
-
const client = await
|
|
2481
|
+
const client = await OpenID4VCIClientV1_0_15.fromState({
|
|
2474
2482
|
state: openID4VCIClientState
|
|
2475
2483
|
});
|
|
2476
2484
|
const credentialsSupported = await getCredentialConfigsSupportedMerged({
|