@openeudi/openid4vp 0.10.0 → 0.10.1

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
@@ -684,6 +684,6 @@ declare class LotlTrustStore implements TrustStore {
684
684
  private refresh;
685
685
  }
686
686
 
687
- declare const VERSION = "0.10.0";
687
+ declare const VERSION = "0.10.1";
688
688
 
689
689
  export { type AuthorizationRequest, type AuthorizationRequestInput, type AuthorizationResponse, type Cache, CertificateChainError, type ChainErrorReason, CompositeTrustStore, type CredentialClaims, type CredentialFormat, DecryptionFailedError, type EncryptedResponse, ExpiredCredentialError, type Fetcher, HAIP_DOCTYPE_NAMESPACES, type HaipQueryInput, type HaipValidationCode, HaipValidationError, type ICredentialParser, InMemoryCache, InvalidSignatureError, type IssuerInfo, type LotlAnchorMetadata, LotlFetchError, LotlSignatureError, LotlTrustStore, type LotlTrustStoreOptions, MalformedCredentialError, MdocParser, MissingDecryptionKeyError, MissingVerifierEncryptionKeyError, MultipleCredentialsNotSupportedError, NonceValidationError, OpenID4VPError, type ParseOptions, type PresentationResult, RevocationCheckFailedError, RevokedCertificateError, SdJwtParser, type SignedAuthorizationRequest, type SignedAuthorizationRequestInput, SignedRequestBuildError, type SignedRequestBuildErrorCode, StaticTrustStore, type TrustAnchor, TrustAnchorNotFoundError, type TrustStore, type TrustStoreHint, type TrustStoreInput, UnsupportedFormatError, UnsupportedJweError, VERSION, type VerifyAuthorizationResponseOptions, type VerifyOptions, type VerifyResult, buildHaipQuery, buildOid4vpSessionTranscript, buildOpenID4VPHandoverSessionTranscript, createAuthorizationRequest, createSignedAuthorizationRequest, decryptAuthorizationResponse, isHaipQuery, parsePresentation, validateHaipQuery, verifyAuthorizationResponse, verifyPresentation };
package/dist/index.d.ts CHANGED
@@ -684,6 +684,6 @@ declare class LotlTrustStore implements TrustStore {
684
684
  private refresh;
685
685
  }
686
686
 
687
- declare const VERSION = "0.10.0";
687
+ declare const VERSION = "0.10.1";
688
688
 
689
689
  export { type AuthorizationRequest, type AuthorizationRequestInput, type AuthorizationResponse, type Cache, CertificateChainError, type ChainErrorReason, CompositeTrustStore, type CredentialClaims, type CredentialFormat, DecryptionFailedError, type EncryptedResponse, ExpiredCredentialError, type Fetcher, HAIP_DOCTYPE_NAMESPACES, type HaipQueryInput, type HaipValidationCode, HaipValidationError, type ICredentialParser, InMemoryCache, InvalidSignatureError, type IssuerInfo, type LotlAnchorMetadata, LotlFetchError, LotlSignatureError, LotlTrustStore, type LotlTrustStoreOptions, MalformedCredentialError, MdocParser, MissingDecryptionKeyError, MissingVerifierEncryptionKeyError, MultipleCredentialsNotSupportedError, NonceValidationError, OpenID4VPError, type ParseOptions, type PresentationResult, RevocationCheckFailedError, RevokedCertificateError, SdJwtParser, type SignedAuthorizationRequest, type SignedAuthorizationRequestInput, SignedRequestBuildError, type SignedRequestBuildErrorCode, StaticTrustStore, type TrustAnchor, TrustAnchorNotFoundError, type TrustStore, type TrustStoreHint, type TrustStoreInput, UnsupportedFormatError, UnsupportedJweError, VERSION, type VerifyAuthorizationResponseOptions, type VerifyOptions, type VerifyResult, buildHaipQuery, buildOid4vpSessionTranscript, buildOpenID4VPHandoverSessionTranscript, createAuthorizationRequest, createSignedAuthorizationRequest, decryptAuthorizationResponse, isHaipQuery, parsePresentation, validateHaipQuery, verifyAuthorizationResponse, verifyPresentation };
package/dist/index.js CHANGED
@@ -9674,8 +9674,9 @@ async function verifyPresentation(vpToken, query, options) {
9674
9674
  const parsed = await parsePresentation(vpToken, options);
9675
9675
  const dcqlFormat = INTERNAL_TO_DCQL_FORMAT[parsed.format] ?? parsed.format;
9676
9676
  const decodedClaims = parsed.format === "mdoc" && parsed.namespacedClaims !== void 0 ? parsed.namespacedClaims : parsed.claims;
9677
+ const presentedCredentialQuery = query.credentials.find((c) => c.format === dcqlFormat) ?? query.credentials[0];
9677
9678
  const decoded = {
9678
- id: query.credentials[0]?.id ?? "presented",
9679
+ id: presentedCredentialQuery?.id ?? "presented",
9679
9680
  format: dcqlFormat,
9680
9681
  claims: decodedClaims
9681
9682
  };
@@ -9796,8 +9797,12 @@ async function verifyAuthorizationResponse(envelope, query, options) {
9796
9797
  if (queryIds.length > 1 || presentationCount > 1) {
9797
9798
  throw new MultipleCredentialsNotSupportedError(queryIds.length, presentationCount);
9798
9799
  }
9799
- const presentation = vpToken[queryIds[0]][0];
9800
- const decodedPresentation = query.credentials[0]?.format === "mso_mdoc" && typeof presentation === "string" ? base64UrlToBytes(presentation) : presentation;
9800
+ const presentedQueryId = queryIds[0];
9801
+ const presentation = vpToken[presentedQueryId][0];
9802
+ const presentedCredentialQuery = query.credentials.find(
9803
+ (c) => c.id === presentedQueryId
9804
+ );
9805
+ const decodedPresentation = presentedCredentialQuery?.format === "mso_mdoc" && typeof presentation === "string" ? base64UrlToBytes(presentation) : presentation;
9801
9806
  return verifyPresentation(decodedPresentation, query, options);
9802
9807
  }
9803
9808
 
@@ -10430,7 +10435,7 @@ function equalBytes(a, b) {
10430
10435
 
10431
10436
  // src/index.ts
10432
10437
  init_errors();
10433
- var VERSION = "0.10.0";
10438
+ var VERSION = "0.10.1";
10434
10439
  /*! Bundled license information:
10435
10440
 
10436
10441
  pvtsutils/build/index.es.js: