@sphereon/ssi-sdk.oid4vci-holder 0.36.1-feature.SSISDK.44.finish.dcql.1 → 0.36.1-feature.SSISDK.70.integrate.digidentity.55

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sphereon/ssi-sdk.oid4vci-holder",
3
- "version": "0.36.1-feature.SSISDK.44.finish.dcql.1+66f32d8d",
3
+ "version": "0.36.1-feature.SSISDK.70.integrate.digidentity.55+fc4df611",
4
4
  "source": "src/index.ts",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -26,27 +26,27 @@
26
26
  "build": "tsup --config ../../tsup.config.ts --tsconfig ../../tsconfig.tsup.json"
27
27
  },
28
28
  "dependencies": {
29
- "@sphereon/did-auth-siop": "0.20.0",
29
+ "@sphereon/did-auth-siop": "0.20.1-next.3",
30
30
  "@sphereon/kmp-mdoc-core": "0.2.0-SNAPSHOT.26",
31
- "@sphereon/oid4vci-client": "0.20.0",
32
- "@sphereon/oid4vci-common": "0.20.0",
33
- "@sphereon/ssi-sdk-ext.did-utils": "0.36.1-feature.SSISDK.44.finish.dcql.1+66f32d8d",
34
- "@sphereon/ssi-sdk-ext.identifier-resolution": "0.36.1-feature.SSISDK.44.finish.dcql.1+66f32d8d",
35
- "@sphereon/ssi-sdk-ext.jwt-service": "0.36.1-feature.SSISDK.44.finish.dcql.1+66f32d8d",
36
- "@sphereon/ssi-sdk-ext.key-utils": "0.36.1-feature.SSISDK.44.finish.dcql.1+66f32d8d",
37
- "@sphereon/ssi-sdk.contact-manager": "0.36.1-feature.SSISDK.44.finish.dcql.1+66f32d8d",
38
- "@sphereon/ssi-sdk.core": "0.36.1-feature.SSISDK.44.finish.dcql.1+66f32d8d",
39
- "@sphereon/ssi-sdk.credential-store": "0.36.1-feature.SSISDK.44.finish.dcql.1+66f32d8d",
40
- "@sphereon/ssi-sdk.credential-validation": "0.36.1-feature.SSISDK.44.finish.dcql.1+66f32d8d",
41
- "@sphereon/ssi-sdk.data-store-types": "0.36.1-feature.SSISDK.44.finish.dcql.1+66f32d8d",
42
- "@sphereon/ssi-sdk.issuance-branding": "0.36.1-feature.SSISDK.44.finish.dcql.1+66f32d8d",
43
- "@sphereon/ssi-sdk.mdl-mdoc": "0.36.1-feature.SSISDK.44.finish.dcql.1+66f32d8d",
44
- "@sphereon/ssi-sdk.oidf-client": "0.36.1-feature.SSISDK.44.finish.dcql.1+66f32d8d",
45
- "@sphereon/ssi-sdk.sd-jwt": "0.36.1-feature.SSISDK.44.finish.dcql.1+66f32d8d",
46
- "@sphereon/ssi-sdk.siopv2-oid4vp-common": "0.36.1-feature.SSISDK.44.finish.dcql.1+66f32d8d",
47
- "@sphereon/ssi-sdk.siopv2-oid4vp-op-auth": "0.36.1-feature.SSISDK.44.finish.dcql.1+66f32d8d",
48
- "@sphereon/ssi-sdk.xstate-machine-persistence": "0.36.1-feature.SSISDK.44.finish.dcql.1+66f32d8d",
49
- "@sphereon/ssi-types": "0.36.1-feature.SSISDK.44.finish.dcql.1+66f32d8d",
31
+ "@sphereon/oid4vci-client": "0.20.1-next.3",
32
+ "@sphereon/oid4vci-common": "0.20.1-next.3",
33
+ "@sphereon/ssi-sdk-ext.did-utils": "0.36.1-feature.SSISDK.70.integrate.digidentity.55+fc4df611",
34
+ "@sphereon/ssi-sdk-ext.identifier-resolution": "0.36.1-feature.SSISDK.70.integrate.digidentity.55+fc4df611",
35
+ "@sphereon/ssi-sdk-ext.jwt-service": "0.36.1-feature.SSISDK.70.integrate.digidentity.55+fc4df611",
36
+ "@sphereon/ssi-sdk-ext.key-utils": "0.36.1-feature.SSISDK.70.integrate.digidentity.55+fc4df611",
37
+ "@sphereon/ssi-sdk.contact-manager": "0.36.1-feature.SSISDK.70.integrate.digidentity.55+fc4df611",
38
+ "@sphereon/ssi-sdk.core": "0.36.1-feature.SSISDK.70.integrate.digidentity.55+fc4df611",
39
+ "@sphereon/ssi-sdk.credential-store": "0.36.1-feature.SSISDK.70.integrate.digidentity.55+fc4df611",
40
+ "@sphereon/ssi-sdk.credential-validation": "0.36.1-feature.SSISDK.70.integrate.digidentity.55+fc4df611",
41
+ "@sphereon/ssi-sdk.data-store-types": "0.36.1-feature.SSISDK.70.integrate.digidentity.55+fc4df611",
42
+ "@sphereon/ssi-sdk.issuance-branding": "0.36.1-feature.SSISDK.70.integrate.digidentity.55+fc4df611",
43
+ "@sphereon/ssi-sdk.mdl-mdoc": "0.36.1-feature.SSISDK.70.integrate.digidentity.55+fc4df611",
44
+ "@sphereon/ssi-sdk.oidf-client": "0.36.1-feature.SSISDK.70.integrate.digidentity.55+fc4df611",
45
+ "@sphereon/ssi-sdk.sd-jwt": "0.36.1-feature.SSISDK.70.integrate.digidentity.55+fc4df611",
46
+ "@sphereon/ssi-sdk.siopv2-oid4vp-common": "0.36.1-feature.SSISDK.70.integrate.digidentity.55+fc4df611",
47
+ "@sphereon/ssi-sdk.siopv2-oid4vp-op-auth": "0.36.1-feature.SSISDK.70.integrate.digidentity.55+fc4df611",
48
+ "@sphereon/ssi-sdk.xstate-machine-persistence": "0.36.1-feature.SSISDK.70.integrate.digidentity.55+fc4df611",
49
+ "@sphereon/ssi-types": "0.36.1-feature.SSISDK.70.integrate.digidentity.55+fc4df611",
50
50
  "@veramo/core": "4.2.0",
51
51
  "@veramo/data-store": "4.2.0",
52
52
  "@veramo/utils": "4.2.0",
@@ -59,8 +59,8 @@
59
59
  "xstate": "^4.38.3"
60
60
  },
61
61
  "devDependencies": {
62
- "@sphereon/oid4vc-common": "0.20.0",
63
- "@sphereon/ssi-sdk-ext.did-resolver-jwk": "0.36.1-feature.SSISDK.44.finish.dcql.1+66f32d8d",
62
+ "@sphereon/oid4vc-common": "0.20.1-feat.SSISDK.83.1",
63
+ "@sphereon/ssi-sdk-ext.did-resolver-jwk": "0.36.1-feature.SSISDK.70.integrate.digidentity.55+fc4df611",
64
64
  "@sphereon/ssi-sdk.siopv2-oid4vp-common": "workspace:*",
65
65
  "@types/i18n-js": "^3.8.9",
66
66
  "@types/lodash.memoize": "^4.1.9",
@@ -90,5 +90,5 @@
90
90
  "OID4VCI",
91
91
  "State Machine"
92
92
  ],
93
- "gitHead": "66f32d8dcf60bfa79709c5c257be2073015198a0"
93
+ "gitHead": "fc4df611242812613a69238d3d03452395505b64"
94
94
  }
@@ -123,6 +123,7 @@ import {
123
123
  VerificationResult,
124
124
  VerifyEBSICredentialIssuerArgs,
125
125
  VerifyEBSICredentialIssuerResult,
126
+ WalletType,
126
127
  } from '../types/IOID4VCIHolder'
127
128
 
128
129
  /**
@@ -617,7 +618,7 @@ export class OID4VCIHolder implements IAgentPlugin {
617
618
  }
618
619
 
619
620
  private async oid4vciHolderGetCredentials(args: GetCredentialsArgs, context: RequiredContext): Promise<Array<MappedCredentialToAccept>> {
620
- const { verificationCode, openID4VCIClientState, didMethodPreferences = this.didMethodPreferences, issuanceOpt, accessTokenOpts } = args
621
+ const { verificationCode, openID4VCIClientState, didMethodPreferences, issuanceOpt, accessTokenOpts, walletType } = args
621
622
  logger.debug(`Getting credentials`, issuanceOpt, accessTokenOpts)
622
623
 
623
624
  if (!openID4VCIClientState) {
@@ -636,7 +637,7 @@ export class OID4VCIHolder implements IAgentPlugin {
636
637
  credentialsSupported,
637
638
  serverMetadata,
638
639
  context,
639
- didMethodPreferences: Array.isArray(didMethodPreferences) && didMethodPreferences.length > 0 ? didMethodPreferences : this.didMethodPreferences,
640
+ didMethodPreferences: this.selectDidMethodPreferences(didMethodPreferences, walletType),
640
641
  jwtCryptographicSuitePreferences: this.jwtCryptographicSuitePreferences,
641
642
  jsonldCryptographicSuitePreferences: this.jsonldCryptographicSuitePreferences,
642
643
  ...(issuanceOpt && { forceIssuanceOpt: issuanceOpt }),
@@ -661,6 +662,15 @@ export class OID4VCIHolder implements IAgentPlugin {
661
662
  return allCredentials
662
663
  }
663
664
 
665
+ private selectDidMethodPreferences(didMethodPreferences: Array<SupportedDidMethodEnum> | undefined, walletType: WalletType) {
666
+ const supportedDidMethodEnums =
667
+ Array.isArray(didMethodPreferences) && didMethodPreferences.length > 0 ? didMethodPreferences : this.didMethodPreferences
668
+ if (walletType === 'ORGANIZATIONAL') {
669
+ return [SupportedDidMethodEnum.DID_WEB, ...supportedDidMethodEnums]
670
+ }
671
+ return supportedDidMethodEnums
672
+ }
673
+
664
674
  private async oid4vciHolderGetCredential(args: GetCredentialArgs, context: RequiredContext): Promise<MappedCredentialToAccept> {
665
675
  const { issuanceOpt, pin, client, accessTokenOpts } = args
666
676
  logger.info(`Getting credential`, issuanceOpt)
@@ -3,7 +3,7 @@ import { AuthorizationRequestOpts, AuthorizationServerClientOpts, AuthzFlowType,
3
3
  import { DefaultLinkPriorities, LinkHandlerAdapter } from '@sphereon/ssi-sdk.core'
4
4
  import { IMachineStatePersistence, interpreterStartOrResume, SerializableState } from '@sphereon/ssi-sdk.xstate-machine-persistence'
5
5
  import { IAgentContext } from '@veramo/core'
6
- import { GetMachineArgs, IOID4VCIHolder, OID4VCIMachineEvents, OID4VCIMachineStateNavigationListener } from '../types/IOID4VCIHolder'
6
+ import { GetMachineArgs, IOID4VCIHolder, OID4VCIMachineEvents, OID4VCIMachineStateNavigationListener, WalletType } from '../types/IOID4VCIHolder'
7
7
  import { FirstPartyMachineStateNavigationListener } from '../types/FirstPartyMachine'
8
8
 
9
9
  /**
@@ -14,6 +14,7 @@ export class OID4VCIHolderLinkHandler extends LinkHandlerAdapter {
14
14
  private readonly stateNavigationListener?: OID4VCIMachineStateNavigationListener
15
15
  private readonly firstPartyStateNavigationListener?: FirstPartyMachineStateNavigationListener
16
16
  private readonly noStateMachinePersistence: boolean
17
+ private readonly walletType: WalletType
17
18
  private readonly authorizationRequestOpts?: AuthorizationRequestOpts
18
19
  private readonly clientOpts?: AuthorizationServerClientOpts
19
20
  private readonly trustAnchors?: Array<string>
@@ -21,7 +22,7 @@ export class OID4VCIHolderLinkHandler extends LinkHandlerAdapter {
21
22
  constructor(
22
23
  args: Pick<
23
24
  GetMachineArgs,
24
- 'stateNavigationListener' | 'authorizationRequestOpts' | 'clientOpts' | 'trustAnchors' | 'firstPartyStateNavigationListener'
25
+ 'stateNavigationListener' | 'authorizationRequestOpts' | 'clientOpts' | 'trustAnchors' | 'firstPartyStateNavigationListener' | 'walletType'
25
26
  > & {
26
27
  priority?: number | DefaultLinkPriorities
27
28
  protocols?: Array<string | RegExp>
@@ -33,6 +34,7 @@ export class OID4VCIHolderLinkHandler extends LinkHandlerAdapter {
33
34
  this.authorizationRequestOpts = args.authorizationRequestOpts
34
35
  this.clientOpts = args.clientOpts
35
36
  this.context = args.context
37
+ this.walletType = args.walletType ?? 'NATURAL_PERSON'
36
38
  this.noStateMachinePersistence = args.noStateMachinePersistence === true
37
39
  this.stateNavigationListener = args.stateNavigationListener
38
40
  this.firstPartyStateNavigationListener = args.firstPartyStateNavigationListener
@@ -68,6 +70,7 @@ export class OID4VCIHolderLinkHandler extends LinkHandlerAdapter {
68
70
  ...((clientOpts.clientId || clientOpts.clientAssertionType) && { clientOpts: clientOpts as AuthorizationServerClientOpts }),
69
71
  stateNavigationListener: this.stateNavigationListener,
70
72
  firstPartyStateNavigationListener: this.firstPartyStateNavigationListener,
73
+ walletType: this.walletType,
71
74
  })
72
75
 
73
76
  const interpreter = oid4vciMachine.interpreter
@@ -126,6 +126,7 @@ const createOID4VCIMachine = (opts?: CreateOID4VCIMachineOpts): OID4VCIStateMach
126
126
  // TODO WAL-671 we need to store the data from OpenIdProvider here in the context and make sure we can restart the machine with it and init the OpenIdProvider
127
127
  accessTokenOpts: opts?.accessTokenOpts,
128
128
  requestData: opts?.requestData,
129
+ walletType: opts?.walletType ?? 'NATURAL_PERSON',
129
130
  trustAnchors: opts?.trustAnchors ?? [],
130
131
  issuanceOpt: opts?.issuanceOpt,
131
132
  didMethodPreferences: opts?.didMethodPreferences,
@@ -214,7 +214,7 @@ export const mapCredentialToAccept = async (args: MapCredentialToAcceptArgs): Pr
214
214
  if (!hasher) {
215
215
  return Promise.reject('a hasher is required for encoded SD-JWT credentials')
216
216
  }
217
- const asyncHasher: Hasher = (data: string | ArrayBuffer, algorithm: string) => Promise.resolve(hasher(data, algorithm))
217
+ const asyncHasher: Hasher = (data: string | ArrayBuffer | SharedArrayBuffer, algorithm: string) => Promise.resolve(hasher(data, algorithm))
218
218
  const decodedSdJwt = await CredentialMapper.decodeSdJwtVcAsync(wrappedVerifiableCredential.credential, asyncHasher)
219
219
  uniformVerifiableCredential = sdJwtDecodedCredentialToUniformCredential(<SdJwtDecodedVerifiableCredential>decodedSdJwt)
220
220
  } else if (CredentialMapper.isMsoMdocDecodedCredential(wrappedVerifiableCredential.credential)) {
@@ -136,6 +136,7 @@ export type OnIdentifierCreatedArgs = {
136
136
 
137
137
  export type GetMachineArgs = {
138
138
  requestData: RequestData
139
+ walletType: WalletType
139
140
  trustAnchors?: Array<string>
140
141
  authorizationRequestOpts?: AuthorizationRequestOpts
141
142
  clientOpts?: AuthorizationServerClientOpts
@@ -157,7 +158,7 @@ export type CreateCredentialsToSelectFromArgs = Pick<
157
158
  export type GetContactArgs = Pick<OID4VCIMachineContext, 'serverMetadata'>
158
159
  export type GetCredentialsArgs = Pick<
159
160
  OID4VCIMachineContext,
160
- 'verificationCode' | 'openID4VCIClientState' | 'selectedCredentials' | 'didMethodPreferences' | 'issuanceOpt' | 'accessTokenOpts'
161
+ 'verificationCode' | 'openID4VCIClientState' | 'selectedCredentials' | 'didMethodPreferences' | 'issuanceOpt' | 'accessTokenOpts' | 'walletType'
161
162
  >
162
163
  export type AddContactIdentityArgs = Pick<OID4VCIMachineContext, 'credentialsToAccept' | 'contact'>
163
164
  export type GetIssuerBrandingArgs = Pick<OID4VCIMachineContext, 'serverMetadata' | 'contact'>
@@ -233,6 +234,7 @@ export type OID4VCIMachineContext = {
233
234
  openID4VCIClientState?: OpenID4VCIClientState
234
235
  credentialToSelectFrom: Array<CredentialToSelectFromResult>
235
236
  contactAlias: string
237
+ walletType: WalletType
236
238
  contact?: Party
237
239
  selectedCredentials: Array<string>
238
240
  credentialsToAccept: Array<MappedCredentialToAccept>
@@ -316,6 +318,7 @@ export type OID4VCIStateMachine = StateMachine<
316
318
 
317
319
  export type CreateOID4VCIMachineOpts = {
318
320
  requestData: RequestData
321
+ walletType: WalletType
319
322
  machineName?: string
320
323
  locale?: string
321
324
  trustAnchors?: Array<string>
@@ -729,6 +732,8 @@ export type DynamicRegistrationClientMetadataDisplay = Pick<
729
732
  'client_name' | 'client_uri' | 'contacts' | 'tos_uri' | 'policy_uri' | 'logo_uri'
730
733
  >
731
734
 
735
+ export type WalletType = 'NATURAL_PERSON' | 'ORGANIZATIONAL'
736
+
732
737
  export type DidAgents = TAgent<IResolver & IDIDManager>
733
738
 
734
739
  export type RequiredContext = IAgentContext<