@sphereon/ssi-sdk.oid4vci-holder 0.34.1-feature.SSISDK.50.98 → 0.34.1-feature.SSISDK.50.type.refactor.142

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.34.1-feature.SSISDK.50.98+48bdc676",
3
+ "version": "0.34.1-feature.SSISDK.50.type.refactor.142+de2d8d54",
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.19.1-feature.SSISDK.45.92",
29
+ "@sphereon/did-auth-siop": "0.19.1-feature.DIIPv4.106",
30
30
  "@sphereon/kmp-mdoc-core": "0.2.0-SNAPSHOT.26",
31
- "@sphereon/oid4vci-client": "0.19.1-feature.SSISDK.45.92",
32
- "@sphereon/oid4vci-common": "0.19.1-feature.SSISDK.45.92",
33
- "@sphereon/ssi-sdk-ext.did-utils": "0.34.1-feature.SSISDK.50.98+48bdc676",
34
- "@sphereon/ssi-sdk-ext.identifier-resolution": "0.34.1-feature.SSISDK.50.98+48bdc676",
35
- "@sphereon/ssi-sdk-ext.jwt-service": "0.34.1-feature.SSISDK.50.98+48bdc676",
36
- "@sphereon/ssi-sdk-ext.key-utils": "0.34.1-feature.SSISDK.50.98+48bdc676",
37
- "@sphereon/ssi-sdk.contact-manager": "0.34.1-feature.SSISDK.50.98+48bdc676",
38
- "@sphereon/ssi-sdk.core": "0.34.1-feature.SSISDK.50.98+48bdc676",
39
- "@sphereon/ssi-sdk.credential-store": "0.34.1-feature.SSISDK.50.98+48bdc676",
40
- "@sphereon/ssi-sdk.credential-validation": "0.34.1-feature.SSISDK.50.98+48bdc676",
41
- "@sphereon/ssi-sdk.data-store": "0.34.1-feature.SSISDK.50.98+48bdc676",
42
- "@sphereon/ssi-sdk.issuance-branding": "0.34.1-feature.SSISDK.50.98+48bdc676",
43
- "@sphereon/ssi-sdk.mdl-mdoc": "0.34.1-feature.SSISDK.50.98+48bdc676",
44
- "@sphereon/ssi-sdk.oidf-client": "0.34.1-feature.SSISDK.50.98+48bdc676",
45
- "@sphereon/ssi-sdk.sd-jwt": "0.34.1-feature.SSISDK.50.98+48bdc676",
46
- "@sphereon/ssi-sdk.siopv2-oid4vp-common": "0.34.1-feature.SSISDK.50.98+48bdc676",
47
- "@sphereon/ssi-sdk.siopv2-oid4vp-op-auth": "0.34.1-feature.SSISDK.50.98+48bdc676",
48
- "@sphereon/ssi-sdk.xstate-machine-persistence": "0.34.1-feature.SSISDK.50.98+48bdc676",
49
- "@sphereon/ssi-types": "0.34.1-feature.SSISDK.50.98+48bdc676",
31
+ "@sphereon/oid4vci-client": "0.19.1-feature.DIIPv4.106",
32
+ "@sphereon/oid4vci-common": "0.19.1-feature.DIIPv4.106",
33
+ "@sphereon/ssi-sdk-ext.did-utils": "0.34.1-feature.SSISDK.50.type.refactor.142+de2d8d54",
34
+ "@sphereon/ssi-sdk-ext.identifier-resolution": "0.34.1-feature.SSISDK.50.type.refactor.142+de2d8d54",
35
+ "@sphereon/ssi-sdk-ext.jwt-service": "0.34.1-feature.SSISDK.50.type.refactor.142+de2d8d54",
36
+ "@sphereon/ssi-sdk-ext.key-utils": "0.34.1-feature.SSISDK.50.type.refactor.142+de2d8d54",
37
+ "@sphereon/ssi-sdk.contact-manager": "0.34.1-feature.SSISDK.50.type.refactor.142+de2d8d54",
38
+ "@sphereon/ssi-sdk.core": "0.34.1-feature.SSISDK.50.type.refactor.142+de2d8d54",
39
+ "@sphereon/ssi-sdk.credential-store": "0.34.1-feature.SSISDK.50.type.refactor.142+de2d8d54",
40
+ "@sphereon/ssi-sdk.credential-validation": "0.34.1-feature.SSISDK.50.type.refactor.142+de2d8d54",
41
+ "@sphereon/ssi-sdk.data-store": "0.34.1-feature.SSISDK.50.type.refactor.142+de2d8d54",
42
+ "@sphereon/ssi-sdk.issuance-branding": "0.34.1-feature.SSISDK.50.type.refactor.142+de2d8d54",
43
+ "@sphereon/ssi-sdk.mdl-mdoc": "0.34.1-feature.SSISDK.50.type.refactor.142+de2d8d54",
44
+ "@sphereon/ssi-sdk.oidf-client": "0.34.1-feature.SSISDK.50.type.refactor.142+de2d8d54",
45
+ "@sphereon/ssi-sdk.sd-jwt": "0.34.1-feature.SSISDK.50.type.refactor.142+de2d8d54",
46
+ "@sphereon/ssi-sdk.siopv2-oid4vp-common": "0.34.1-feature.SSISDK.50.type.refactor.142+de2d8d54",
47
+ "@sphereon/ssi-sdk.siopv2-oid4vp-op-auth": "0.34.1-feature.SSISDK.50.type.refactor.142+de2d8d54",
48
+ "@sphereon/ssi-sdk.xstate-machine-persistence": "0.34.1-feature.SSISDK.50.type.refactor.142+de2d8d54",
49
+ "@sphereon/ssi-types": "0.34.1-feature.SSISDK.50.type.refactor.142+de2d8d54",
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.19.1-feature.SSISDK.45.92",
63
- "@sphereon/ssi-sdk-ext.did-resolver-jwk": "0.34.1-feature.SSISDK.50.98+48bdc676",
62
+ "@sphereon/oid4vc-common": "0.19.1-feature.DIIPv4.106",
63
+ "@sphereon/ssi-sdk-ext.did-resolver-jwk": "0.34.1-feature.SSISDK.50.type.refactor.142+de2d8d54",
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": "48bdc676bed10bd17c66ed7dfdbd401c54925cbb"
93
+ "gitHead": "de2d8d5432490eb88e3f081d2838f8e9164c59ac"
94
94
  }
@@ -4,13 +4,14 @@ import {
4
4
  AuthorizationRequestOpts,
5
5
  AuthorizationServerClientOpts,
6
6
  AuthorizationServerOpts,
7
+ CredentialConfigurationSupported,
7
8
  CredentialConfigurationSupportedJwtVcJsonLdAndLdpVcV1_0_15,
8
9
  CredentialDefinitionJwtVcJsonLdAndLdpVcV1_0_15,
9
10
  CredentialOfferRequestWithBaseUrl,
10
11
  DefaultURISchemes,
11
12
  EndpointMetadataResult,
12
13
  getTypesFromAuthorizationDetails,
13
- getTypesFromCredentialOffer,
14
+ getTypesFromCredentialSupported,
14
15
  getTypesFromObject,
15
16
  Jwt,
16
17
  NotificationRequest,
@@ -229,7 +230,7 @@ export class OID4VCIHolder implements IAgentPlugin {
229
230
  oid4vciHolderStoreIssuerBranding: this.oid4vciHolderStoreIssuerBranding.bind(this),
230
231
  }
231
232
 
232
- private readonly vcFormatPreferences: Array<string> = ['dc+sd-jwt', 'vc+sd-jwt', 'mso_mdoc', 'jwt_vc_json', 'jwt_vc', 'ldp_vc']
233
+ private readonly vcFormatPreferences: Array<string> = ['dc+sd-jwt', 'vc+sd-jwt', 'mso_mdoc', 'jwt_vc_json', 'jwt_vc', 'ldp_vc'] // TODO see SSISDK-52 concerning vc+sd-jwt
233
234
  private readonly jsonldCryptographicSuitePreferences: Array<string> = [
234
235
  'Ed25519Signature2018',
235
236
  'EcdsaSecp256k1Signature2019',
@@ -443,7 +444,13 @@ export class OID4VCIHolder implements IAgentPlugin {
443
444
  }
444
445
 
445
446
  if (offer) {
446
- types = getTypesFromCredentialOffer(offer.original_credential_offer)
447
+ const credentialsSupported: CredentialConfigurationSupported[] = offer.original_credential_offer.credential_configuration_ids.flatMap(
448
+ (configId) => {
449
+ const config = oid4vciClient.endpointMetadata.credentialIssuerMetadata?.credential_configurations_supported[configId]
450
+ return config ? [config as CredentialConfigurationSupported] : []
451
+ },
452
+ )
453
+ types = credentialsSupported.map((credentialSupported) => getTypesFromCredentialSupported(credentialSupported))
447
454
  } else {
448
455
  types = asArray(authorizationRequestOpts.authorizationDetails)
449
456
  .map((authReqOpts) => getTypesFromAuthorizationDetails(authReqOpts) ?? [])
@@ -3,7 +3,6 @@ import {
3
3
  AuthorizationChallengeCodeResponse,
4
4
  CredentialConfigurationSupported,
5
5
  CredentialConfigurationSupportedSdJwtVcV1_0_15,
6
- CredentialOfferFormatV1_0_11,
7
6
  CredentialResponse,
8
7
  CredentialResponseV1_0_15,
9
8
  CredentialSupportedSdJwtVc,
@@ -11,7 +10,6 @@ import {
11
10
  getTypesFromCredentialSupported,
12
11
  getTypesFromObject,
13
12
  MetadataDisplay,
14
- OpenId4VCIVersion,
15
13
  } from '@sphereon/oid4vci-common'
16
14
  import { KeyUse } from '@sphereon/ssi-sdk-ext.did-resolver-jwk'
17
15
  import { getOrCreatePrimaryIdentifier, SupportedDidMethodEnum } from '@sphereon/ssi-sdk-ext.did-utils'
@@ -386,7 +384,10 @@ export const getCredentialConfigsSupportedBySingleTypeOrId = async (
386
384
  }
387
385
 
388
386
  if (configurationId) {
389
- const allSupported = client.getCredentialsSupported(false)
387
+ if (!format) {
388
+ return Promise.reject(Error('format parameter missing from input'))
389
+ }
390
+ const allSupported = client.getCredentialsSupported(format)
390
391
  return Object.fromEntries(
391
392
  Object.entries(allSupported).filter(
392
393
  ([id, supported]) => id === configurationId || supported.id === configurationId || createIdFromTypes(supported) === configurationId,
@@ -394,29 +395,15 @@ export const getCredentialConfigsSupportedBySingleTypeOrId = async (
394
395
  )
395
396
  }
396
397
 
397
- if (!types && !client.credentialOffer) {
398
- return Promise.reject(Error('openID4VCIClient has no credentialOffer and no types where provided'))
399
- /*} else if (!format && !client.credentialOffer) {
400
- return Promise.reject(Error('openID4VCIClient has no credentialOffer and no formats where provided'))*/
398
+ if (!client.credentialOffer) {
399
+ return Promise.reject(Error('openID4VCIClient has no credentialOffer'))
401
400
  }
402
- // We should always have a credential offer at this point given the above
403
- if (!Array.isArray(format) && client.credentialOffer) {
404
- if (
405
- client.version() > OpenId4VCIVersion.VER_1_0_09 &&
406
- typeof client.credentialOffer.credential_offer === 'object' &&
407
- 'credentials' in client.credentialOffer.credential_offer
408
- ) {
409
- format = client.credentialOffer.credential_offer.credentials
410
- .filter((cred: CredentialOfferFormatV1_0_11 | string) => typeof cred !== 'string')
411
- .map((cred: CredentialOfferFormatV1_0_11 | string) => (cred as CredentialOfferFormatV1_0_11).format)
412
- if (format?.length === 0) {
413
- format = undefined // Otherwise we would match nothing
414
- }
415
- }
401
+ if (!types) {
402
+ return Promise.reject(Error('openID4VCIClient has no types'))
416
403
  }
417
404
 
418
405
  const offerSupported = getSupportedCredentials({
419
- types: types ? [types] : client.getCredentialOfferTypes(),
406
+ types: [types],
420
407
  format,
421
408
  version: client.version(),
422
409
  issuerMetadata: client.endpointMetadata.credentialIssuerMetadata,
@@ -596,7 +583,7 @@ export const getIssuanceCryptoSuite = async (opts: GetIssuanceCryptoSuiteArgs):
596
583
  case 'jwt':
597
584
  case 'jwt_vc_json':
598
585
  case 'jwt_vc':
599
- case 'vc+sd-jwt':
586
+ //case 'vc+sd-jwt': // TODO see SSISDK-52 concerning vc+sd-jwt
600
587
  case 'dc+sd-jwt':
601
588
  case 'mso_mdoc': {
602
589
  const supportedPreferences: Array<JoseSignatureAlgorithm | JoseSignatureAlgorithmString> = jwtCryptographicSuitePreferences.filter(
@@ -1,12 +1,12 @@
1
- import { BaseActionObject, Interpreter, ResolveTypegenMeta, ServiceMap, State, StateMachine, StatesConfig, TypegenDisabled } from 'xstate'
2
- import { OpenID4VCIClientState } from '@sphereon/oid4vci-client'
3
- import { DidAuthConfig, Party } from '@sphereon/ssi-sdk.data-store'
4
1
  import { RPRegistrationMetadataPayload } from '@sphereon/did-auth-siop'
5
- import { UniqueDigitalCredential } from '@sphereon/ssi-sdk.credential-store'
2
+ import { OpenID4VCIClientState } from '@sphereon/oid4vci-client'
6
3
  import { AuthorizationChallengeCodeResponse } from '@sphereon/oid4vci-common'
4
+ import { UniqueDigitalCredential } from '@sphereon/ssi-sdk.credential-store'
5
+ import { DidAuthConfig, Party } from '@sphereon/ssi-sdk.data-store'
7
6
  import { IIdentifier } from '@veramo/core'
8
- import { ErrorDetails, RequiredContext } from './IOID4VCIHolder'
9
7
  import { DcqlQuery } from 'dcql'
8
+ import { BaseActionObject, Interpreter, ResolveTypegenMeta, ServiceMap, State, StateMachine, StatesConfig, TypegenDisabled } from 'xstate'
9
+ import { ErrorDetails, RequiredContext } from './IOID4VCIHolder'
10
10
 
11
11
  export enum FirstPartyMachineStateTypes {
12
12
  sendAuthorizationChallengeRequest = 'sendAuthorizationChallengeRequest',