@sphereon/ssi-sdk.oid4vci-holder 0.36.1-feature.integration.fides.88 → 0.36.1-feature.vdx24.einvoice.endpoints.122

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.integration.fides.88+5eba8a30",
3
+ "version": "0.36.1-feature.vdx24.einvoice.endpoints.122+88b3421b",
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.1-next.3",
29
+ "@sphereon/did-auth-siop": "0.20.1-next.13",
30
30
  "@sphereon/kmp-mdoc-core": "0.2.0-SNAPSHOT.26",
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.integration.fides.88+5eba8a30",
34
- "@sphereon/ssi-sdk-ext.identifier-resolution": "0.36.1-feature.integration.fides.88+5eba8a30",
35
- "@sphereon/ssi-sdk-ext.jwt-service": "0.36.1-feature.integration.fides.88+5eba8a30",
36
- "@sphereon/ssi-sdk-ext.key-utils": "0.36.1-feature.integration.fides.88+5eba8a30",
37
- "@sphereon/ssi-sdk.contact-manager": "0.36.1-feature.integration.fides.88+5eba8a30",
38
- "@sphereon/ssi-sdk.core": "0.36.1-feature.integration.fides.88+5eba8a30",
39
- "@sphereon/ssi-sdk.credential-store": "0.36.1-feature.integration.fides.88+5eba8a30",
40
- "@sphereon/ssi-sdk.credential-validation": "0.36.1-feature.integration.fides.88+5eba8a30",
41
- "@sphereon/ssi-sdk.data-store-types": "0.36.1-feature.integration.fides.88+5eba8a30",
42
- "@sphereon/ssi-sdk.issuance-branding": "0.36.1-feature.integration.fides.88+5eba8a30",
43
- "@sphereon/ssi-sdk.mdl-mdoc": "0.36.1-feature.integration.fides.88+5eba8a30",
44
- "@sphereon/ssi-sdk.oidf-client": "0.36.1-feature.integration.fides.88+5eba8a30",
45
- "@sphereon/ssi-sdk.sd-jwt": "0.36.1-feature.integration.fides.88+5eba8a30",
46
- "@sphereon/ssi-sdk.siopv2-oid4vp-common": "0.36.1-feature.integration.fides.88+5eba8a30",
47
- "@sphereon/ssi-sdk.siopv2-oid4vp-op-auth": "0.36.1-feature.integration.fides.88+5eba8a30",
48
- "@sphereon/ssi-sdk.xstate-machine-persistence": "0.36.1-feature.integration.fides.88+5eba8a30",
49
- "@sphereon/ssi-types": "0.36.1-feature.integration.fides.88+5eba8a30",
31
+ "@sphereon/oid4vci-client": "0.20.1-next.13",
32
+ "@sphereon/oid4vci-common": "0.20.1-next.13",
33
+ "@sphereon/ssi-sdk-ext.did-utils": "0.36.1-feature.vdx24.einvoice.endpoints.122+88b3421b",
34
+ "@sphereon/ssi-sdk-ext.identifier-resolution": "0.36.1-feature.vdx24.einvoice.endpoints.122+88b3421b",
35
+ "@sphereon/ssi-sdk-ext.jwt-service": "0.36.1-feature.vdx24.einvoice.endpoints.122+88b3421b",
36
+ "@sphereon/ssi-sdk-ext.key-utils": "0.36.1-feature.vdx24.einvoice.endpoints.122+88b3421b",
37
+ "@sphereon/ssi-sdk.contact-manager": "0.36.1-feature.vdx24.einvoice.endpoints.122+88b3421b",
38
+ "@sphereon/ssi-sdk.core": "0.36.1-feature.vdx24.einvoice.endpoints.122+88b3421b",
39
+ "@sphereon/ssi-sdk.credential-store": "0.36.1-feature.vdx24.einvoice.endpoints.122+88b3421b",
40
+ "@sphereon/ssi-sdk.credential-validation": "0.36.1-feature.vdx24.einvoice.endpoints.122+88b3421b",
41
+ "@sphereon/ssi-sdk.data-store-types": "0.36.1-feature.vdx24.einvoice.endpoints.122+88b3421b",
42
+ "@sphereon/ssi-sdk.issuance-branding": "0.36.1-feature.vdx24.einvoice.endpoints.122+88b3421b",
43
+ "@sphereon/ssi-sdk.mdl-mdoc": "0.36.1-feature.vdx24.einvoice.endpoints.122+88b3421b",
44
+ "@sphereon/ssi-sdk.oidf-client": "0.36.1-feature.vdx24.einvoice.endpoints.122+88b3421b",
45
+ "@sphereon/ssi-sdk.sd-jwt": "0.36.1-feature.vdx24.einvoice.endpoints.122+88b3421b",
46
+ "@sphereon/ssi-sdk.siopv2-oid4vp-common": "0.36.1-feature.vdx24.einvoice.endpoints.122+88b3421b",
47
+ "@sphereon/ssi-sdk.siopv2-oid4vp-op-auth": "0.36.1-feature.vdx24.einvoice.endpoints.122+88b3421b",
48
+ "@sphereon/ssi-sdk.xstate-machine-persistence": "0.36.1-feature.vdx24.einvoice.endpoints.122+88b3421b",
49
+ "@sphereon/ssi-types": "0.36.1-feature.vdx24.einvoice.endpoints.122+88b3421b",
50
50
  "@veramo/core": "4.2.0",
51
51
  "@veramo/data-store": "4.2.0",
52
52
  "@veramo/utils": "4.2.0",
@@ -60,7 +60,7 @@
60
60
  },
61
61
  "devDependencies": {
62
62
  "@sphereon/oid4vc-common": "0.20.1-feat.SSISDK.83.1",
63
- "@sphereon/ssi-sdk-ext.did-resolver-jwk": "0.36.1-feature.integration.fides.88+5eba8a30",
63
+ "@sphereon/ssi-sdk-ext.did-resolver-jwk": "0.36.1-feature.vdx24.einvoice.endpoints.122+88b3421b",
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": "5eba8a30455af768df2d4129f6934bf5c1246715"
93
+ "gitHead": "88b3421b6e5bc5f630bf5f877c8db095c5850444"
94
94
  }
@@ -207,6 +207,7 @@ export async function verifyEBSICredentialIssuer(args: VerifyEBSICredentialIssue
207
207
 
208
208
  export class OID4VCIHolder implements IAgentPlugin {
209
209
  private readonly hasher?: HasherSync
210
+ private readonly defaultHolderIdentifier?: string
210
211
  readonly eventTypes: Array<OID4VCIHolderEvent> = [
211
212
  OID4VCIHolderEvent.CONTACT_IDENTITY_CREATED,
212
213
  OID4VCIHolderEvent.CREDENTIAL_STORED,
@@ -270,9 +271,11 @@ export class OID4VCIHolder implements IAgentPlugin {
270
271
  jwtCryptographicSuitePreferences,
271
272
  defaultAuthorizationRequestOptions,
272
273
  hasher = defaultHasher,
274
+ defaultHolderIdentifier,
273
275
  } = { ...options }
274
276
 
275
277
  this.hasher = hasher
278
+ this.defaultHolderIdentifier = defaultHolderIdentifier
276
279
  if (vcFormatPreferences !== undefined && vcFormatPreferences.length > 0) {
277
280
  this.vcFormatPreferences = vcFormatPreferences
278
281
  }
@@ -679,7 +682,7 @@ export class OID4VCIHolder implements IAgentPlugin {
679
682
  return Promise.reject(Error(`Cannot get credential issuance options`))
680
683
  }
681
684
 
682
- const identifier = await getIdentifierOpts({ issuanceOpt, context })
685
+ const identifier = await getIdentifierOpts({ issuanceOpt, context, defaultHolderIdentifier: this.defaultHolderIdentifier })
683
686
  issuanceOpt.identifier = identifier
684
687
  logger.info(`ID opts`, identifier)
685
688
  const alg: JoseSignatureAlgorithm | JoseSignatureAlgorithmString = await signatureAlgorithmFromKey({ key: identifier.key })
@@ -85,8 +85,8 @@ export const oid4vciCredentialLocaleBrandingFrom = async (args: Oid4vciCredentia
85
85
  }),
86
86
  ...(credentialDisplay.logo && {
87
87
  logo: {
88
- ...((credentialDisplay.logo.url || <string>credentialDisplay.logo.uri) && {
89
- uri: credentialDisplay.logo?.url ?? <string>credentialDisplay.logo.uri,
88
+ ...((credentialDisplay.logo.uri || <string>credentialDisplay.logo.uri) && {
89
+ uri: credentialDisplay.logo?.uri ?? <string>credentialDisplay.logo.uri,
90
90
  }),
91
91
  ...(credentialDisplay.logo.alt_text && {
92
92
  alt: credentialDisplay.logo?.alt_text,
@@ -106,8 +106,8 @@ export const oid4vciCredentialLocaleBrandingFrom = async (args: Oid4vciCredentia
106
106
  background: {
107
107
  ...(credentialDisplay.background_image && {
108
108
  image: {
109
- ...((credentialDisplay.background_image.url || <string>credentialDisplay.background_image.uri) && {
110
- uri: credentialDisplay.background_image?.url ?? <string>credentialDisplay.background_image.uri,
109
+ ...((credentialDisplay.background_image.uri || <string>credentialDisplay.background_image.uri) && {
110
+ uri: credentialDisplay.background_image?.uri ?? <string>credentialDisplay.background_image.uri,
111
111
  }),
112
112
  ...(credentialDisplay.background_image.alt_text && {
113
113
  alt: credentialDisplay.background_image?.alt_text,
@@ -261,8 +261,8 @@ export const issuerLocaleBrandingFrom = async (args: IssuerLocaleBrandingFromArg
261
261
  ...(dynamicRegistrationClientMetadata?.logo_uri && {
262
262
  uri: dynamicRegistrationClientMetadata?.logo_uri,
263
263
  }),
264
- ...((issuerDisplay.logo?.url || <string>issuerDisplay.logo?.uri) && {
265
- uri: issuerDisplay.logo?.url ?? <string>issuerDisplay.logo?.uri,
264
+ ...((issuerDisplay.logo?.uri || <string>issuerDisplay.logo?.uri) && {
265
+ uri: issuerDisplay.logo?.uri ?? <string>issuerDisplay.logo?.uri,
266
266
  }),
267
267
  ...(issuerDisplay.logo?.alt_text && {
268
268
  alt: issuerDisplay.logo?.alt_text,
@@ -263,7 +263,7 @@ export const extractCredentialFromResponse = (credentialResponse: CredentialResp
263
263
  }
264
264
 
265
265
  export const getIdentifierOpts = async (args: GetIdentifierArgs): Promise<ManagedIdentifierResult> => {
266
- const { issuanceOpt, context } = args
266
+ const { issuanceOpt, context, defaultHolderIdentifier } = args
267
267
  const { identifier: identifierArg } = issuanceOpt
268
268
  if (identifierArg && isManagedIdentifierResult(identifierArg)) {
269
269
  return identifierArg
@@ -295,6 +295,11 @@ export const getIdentifierOpts = async (args: GetIdentifierArgs): Promise<Manage
295
295
  (!supportedBindingMethods || supportedBindingMethods.length === 0 || supportedBindingMethods.filter((method) => method.startsWith('did')))
296
296
  ) {
297
297
  // previous code for managing DIDs only
298
+ const identifierFilter = defaultHolderIdentifier
299
+ ? defaultHolderIdentifier.startsWith('did:')
300
+ ? { did: defaultHolderIdentifier }
301
+ : { alias: defaultHolderIdentifier }
302
+ : {}
298
303
  const { result, created } = await getOrCreatePrimaryIdentifier(agentContext, {
299
304
  method: supportedPreferredDidMethod,
300
305
  createOpts: {
@@ -303,6 +308,7 @@ export const getIdentifierOpts = async (args: GetIdentifierArgs): Promise<Manage
303
308
  use: KeyUse.Signature,
304
309
  codecName: issuanceOpt.codecName,
305
310
  kms: issuanceOpt.kms,
311
+ ...identifierFilter,
306
312
  },
307
313
  },
308
314
  })
@@ -113,6 +113,7 @@ export type OID4VCIHolderOptions = {
113
113
  didMethodPreferences?: Array<SupportedDidMethodEnum>
114
114
  jwtCryptographicSuitePreferences?: Array<JoseSignatureAlgorithm | JoseSignatureAlgorithmString>
115
115
  hasher?: HasherSync
116
+ defaultHolderIdentifier?: string
116
117
  }
117
118
 
118
119
  export type OnContactIdentityCreatedArgs = {
@@ -571,6 +572,7 @@ export type DefaultIssuanceOpts = {
571
572
  export type GetIdentifierArgs = {
572
573
  issuanceOpt: IssuanceOpts
573
574
  context: RequiredContext
575
+ defaultHolderIdentifier?: string
574
576
  }
575
577
 
576
578
  export type GetAuthenticationKeyArgs = {