@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/dist/index.d.cts CHANGED
@@ -151,6 +151,7 @@ type OID4VCIHolderOptions = {
151
151
  didMethodPreferences?: Array<SupportedDidMethodEnum>;
152
152
  jwtCryptographicSuitePreferences?: Array<JoseSignatureAlgorithm | JoseSignatureAlgorithmString>;
153
153
  hasher?: HasherSync;
154
+ defaultHolderIdentifier?: string;
154
155
  };
155
156
  type OnContactIdentityCreatedArgs = {
156
157
  contactId: string;
@@ -542,6 +543,7 @@ type DefaultIssuanceOpts = {
542
543
  type GetIdentifierArgs = {
543
544
  issuanceOpt: IssuanceOpts;
544
545
  context: RequiredContext;
546
+ defaultHolderIdentifier?: string;
545
547
  };
546
548
  type GetAuthenticationKeyArgs = {
547
549
  identifier: ManagedIdentifierOptsOrResult;
@@ -683,6 +685,7 @@ declare const oid4vciHolderContextMethods: Array<string>;
683
685
  declare function signCallback(identifier: ManagedIdentifierOptsOrResult, context: IAgentContext<IKeyManager & IDIDManager & IResolver & IIdentifierResolution & IJwtService>, nonce?: string): (jwt: Jwt, kid?: string, noIssPayloadUpdate?: boolean) => Promise<string>;
684
686
  declare class OID4VCIHolder implements IAgentPlugin {
685
687
  private readonly hasher?;
688
+ private readonly defaultHolderIdentifier?;
686
689
  readonly eventTypes: Array<OID4VCIHolderEvent>;
687
690
  readonly methods: IOID4VCIHolder;
688
691
  private readonly vcFormatPreferences;
package/dist/index.d.ts CHANGED
@@ -151,6 +151,7 @@ type OID4VCIHolderOptions = {
151
151
  didMethodPreferences?: Array<SupportedDidMethodEnum>;
152
152
  jwtCryptographicSuitePreferences?: Array<JoseSignatureAlgorithm | JoseSignatureAlgorithmString>;
153
153
  hasher?: HasherSync;
154
+ defaultHolderIdentifier?: string;
154
155
  };
155
156
  type OnContactIdentityCreatedArgs = {
156
157
  contactId: string;
@@ -542,6 +543,7 @@ type DefaultIssuanceOpts = {
542
543
  type GetIdentifierArgs = {
543
544
  issuanceOpt: IssuanceOpts;
544
545
  context: RequiredContext;
546
+ defaultHolderIdentifier?: string;
545
547
  };
546
548
  type GetAuthenticationKeyArgs = {
547
549
  identifier: ManagedIdentifierOptsOrResult;
@@ -683,6 +685,7 @@ declare const oid4vciHolderContextMethods: Array<string>;
683
685
  declare function signCallback(identifier: ManagedIdentifierOptsOrResult, context: IAgentContext<IKeyManager & IDIDManager & IResolver & IIdentifierResolution & IJwtService>, nonce?: string): (jwt: Jwt, kid?: string, noIssPayloadUpdate?: boolean) => Promise<string>;
684
686
  declare class OID4VCIHolder implements IAgentPlugin {
685
687
  private readonly hasher?;
688
+ private readonly defaultHolderIdentifier?;
686
689
  readonly eventTypes: Array<OID4VCIHolderEvent>;
687
690
  readonly methods: IOID4VCIHolder;
688
691
  private readonly vcFormatPreferences;
package/dist/index.js CHANGED
@@ -1360,8 +1360,8 @@ var oid4vciCredentialLocaleBrandingFrom = /* @__PURE__ */ __name(async (args) =>
1360
1360
  },
1361
1361
  ...credentialDisplay.logo && {
1362
1362
  logo: {
1363
- ...(credentialDisplay.logo.url || credentialDisplay.logo.uri) && {
1364
- uri: credentialDisplay.logo?.url ?? credentialDisplay.logo.uri
1363
+ ...(credentialDisplay.logo.uri || credentialDisplay.logo.uri) && {
1364
+ uri: credentialDisplay.logo?.uri ?? credentialDisplay.logo.uri
1365
1365
  },
1366
1366
  ...credentialDisplay.logo.alt_text && {
1367
1367
  alt: credentialDisplay.logo?.alt_text
@@ -1380,8 +1380,8 @@ var oid4vciCredentialLocaleBrandingFrom = /* @__PURE__ */ __name(async (args) =>
1380
1380
  background: {
1381
1381
  ...credentialDisplay.background_image && {
1382
1382
  image: {
1383
- ...(credentialDisplay.background_image.url || credentialDisplay.background_image.uri) && {
1384
- uri: credentialDisplay.background_image?.url ?? credentialDisplay.background_image.uri
1383
+ ...(credentialDisplay.background_image.uri || credentialDisplay.background_image.uri) && {
1384
+ uri: credentialDisplay.background_image?.uri ?? credentialDisplay.background_image.uri
1385
1385
  },
1386
1386
  ...credentialDisplay.background_image.alt_text && {
1387
1387
  alt: credentialDisplay.background_image?.alt_text
@@ -1527,8 +1527,8 @@ var issuerLocaleBrandingFrom = /* @__PURE__ */ __name(async (args) => {
1527
1527
  ...dynamicRegistrationClientMetadata?.logo_uri && {
1528
1528
  uri: dynamicRegistrationClientMetadata?.logo_uri
1529
1529
  },
1530
- ...(issuerDisplay.logo?.url || issuerDisplay.logo?.uri) && {
1531
- uri: issuerDisplay.logo?.url ?? issuerDisplay.logo?.uri
1530
+ ...(issuerDisplay.logo?.uri || issuerDisplay.logo?.uri) && {
1531
+ uri: issuerDisplay.logo?.uri ?? issuerDisplay.logo?.uri
1532
1532
  },
1533
1533
  ...issuerDisplay.logo?.alt_text && {
1534
1534
  alt: issuerDisplay.logo?.alt_text
@@ -1727,7 +1727,7 @@ var extractCredentialFromResponse = /* @__PURE__ */ __name((credentialResponse)
1727
1727
  return credential;
1728
1728
  }, "extractCredentialFromResponse");
1729
1729
  var getIdentifierOpts = /* @__PURE__ */ __name(async (args) => {
1730
- const { issuanceOpt, context } = args;
1730
+ const { issuanceOpt, context, defaultHolderIdentifier } = args;
1731
1731
  const { identifier: identifierArg } = issuanceOpt;
1732
1732
  if (identifierArg && isManagedIdentifierResult(identifierArg)) {
1733
1733
  return identifierArg;
@@ -1750,6 +1750,11 @@ var getIdentifierOpts = /* @__PURE__ */ __name(async (args) => {
1750
1750
  agent: context.agent
1751
1751
  };
1752
1752
  if ((!identifierArg || isIIdentifier(identifierArg.identifier)) && supportedPreferredDidMethod && (!supportedBindingMethods || supportedBindingMethods.length === 0 || supportedBindingMethods.filter((method) => method.startsWith("did")))) {
1753
+ const identifierFilter = defaultHolderIdentifier ? defaultHolderIdentifier.startsWith("did:") ? {
1754
+ did: defaultHolderIdentifier
1755
+ } : {
1756
+ alias: defaultHolderIdentifier
1757
+ } : {};
1753
1758
  const { result, created } = await getOrCreatePrimaryIdentifier(agentContext, {
1754
1759
  method: supportedPreferredDidMethod,
1755
1760
  createOpts: {
@@ -1757,7 +1762,8 @@ var getIdentifierOpts = /* @__PURE__ */ __name(async (args) => {
1757
1762
  type: issuanceOpt.keyType,
1758
1763
  use: KeyUse.Signature,
1759
1764
  codecName: issuanceOpt.codecName,
1760
- kms: issuanceOpt.kms
1765
+ kms: issuanceOpt.kms,
1766
+ ...identifierFilter
1761
1767
  }
1762
1768
  }
1763
1769
  });
@@ -2136,6 +2142,7 @@ var OID4VCIHolder = class _OID4VCIHolder {
2136
2142
  __name(this, "OID4VCIHolder");
2137
2143
  }
2138
2144
  hasher;
2145
+ defaultHolderIdentifier;
2139
2146
  eventTypes = [
2140
2147
  OID4VCIHolderEvent.CONTACT_IDENTITY_CREATED,
2141
2148
  OID4VCIHolderEvent.CREDENTIAL_STORED,
@@ -2193,10 +2200,11 @@ var OID4VCIHolder = class _OID4VCIHolder {
2193
2200
  onIdentifierCreated;
2194
2201
  onVerifyEBSICredentialIssuer;
2195
2202
  constructor(options) {
2196
- const { onContactIdentityCreated, onCredentialStored, onIdentifierCreated, onVerifyEBSICredentialIssuer, vcFormatPreferences, jsonldCryptographicSuitePreferences, didMethodPreferences, jwtCryptographicSuitePreferences, defaultAuthorizationRequestOptions, hasher = defaultHasher2 } = {
2203
+ const { onContactIdentityCreated, onCredentialStored, onIdentifierCreated, onVerifyEBSICredentialIssuer, vcFormatPreferences, jsonldCryptographicSuitePreferences, didMethodPreferences, jwtCryptographicSuitePreferences, defaultAuthorizationRequestOptions, hasher = defaultHasher2, defaultHolderIdentifier } = {
2197
2204
  ...options
2198
2205
  };
2199
2206
  this.hasher = hasher;
2207
+ this.defaultHolderIdentifier = defaultHolderIdentifier;
2200
2208
  if (vcFormatPreferences !== void 0 && vcFormatPreferences.length > 0) {
2201
2209
  this.vcFormatPreferences = vcFormatPreferences;
2202
2210
  }
@@ -2523,7 +2531,8 @@ var OID4VCIHolder = class _OID4VCIHolder {
2523
2531
  }
2524
2532
  const identifier = await getIdentifierOpts({
2525
2533
  issuanceOpt,
2526
- context
2534
+ context,
2535
+ defaultHolderIdentifier: this.defaultHolderIdentifier
2527
2536
  });
2528
2537
  issuanceOpt.identifier = identifier;
2529
2538
  logger.info(`ID opts`, identifier);