@openid4vc/oauth2 0.3.0-alpha-20250714110838 → 0.3.0-alpha-20250811083900

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.mjs CHANGED
@@ -21,11 +21,14 @@ var Oauth2ErrorCodes = /* @__PURE__ */ ((Oauth2ErrorCodes2) => {
21
21
  Oauth2ErrorCodes2["InsufficientAuthorization"] = "insufficient_authorization";
22
22
  Oauth2ErrorCodes2["InvalidCredentialRequest"] = "invalid_credential_request";
23
23
  Oauth2ErrorCodes2["CredentialRequestDenied"] = "credential_request_denied";
24
- Oauth2ErrorCodes2["UnsupportedCredentialType"] = "unsupported_credential_type";
25
- Oauth2ErrorCodes2["UnsupportedCredentialFormat"] = "unsupported_credential_format";
26
24
  Oauth2ErrorCodes2["InvalidProof"] = "invalid_proof";
27
25
  Oauth2ErrorCodes2["InvalidNonce"] = "invalid_nonce";
28
26
  Oauth2ErrorCodes2["InvalidEncryptionParameters"] = "invalid_encryption_parameters";
27
+ Oauth2ErrorCodes2["UnknownCredentialConfiguration"] = "unknown_credential_configuration";
28
+ Oauth2ErrorCodes2["UnknownCredentialIdentifier"] = "unknown_credential_identifier";
29
+ Oauth2ErrorCodes2["InvalidTransactionId"] = "invalid_transaction_id";
30
+ Oauth2ErrorCodes2["UnsupportedCredentialType"] = "unsupported_credential_type";
31
+ Oauth2ErrorCodes2["UnsupportedCredentialFormat"] = "unsupported_credential_format";
29
32
  Oauth2ErrorCodes2["InvalidRequestUri"] = "invalid_request_uri";
30
33
  Oauth2ErrorCodes2["InvalidRequestObject"] = "invalid_request_object";
31
34
  Oauth2ErrorCodes2["RequestNotSupported"] = "request_not_supported";
@@ -430,7 +433,7 @@ var zCompactJwe = z6.string().regex(/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]*\.[A-Za-z0-9
430
433
  message: "Not a valid compact jwe"
431
434
  });
432
435
 
433
- // src/client-attestation/clent-attestation.ts
436
+ // src/client-attestation/client-attestation.ts
434
437
  import { dateToSeconds as dateToSeconds3, parseWithErrorHandling as parseWithErrorHandling5 } from "@openid4vc/utils";
435
438
 
436
439
  // src/common/jwt/verify-jwt.ts
@@ -617,7 +620,7 @@ async function createClientAttestationPopJwt(options) {
617
620
  return jwt;
618
621
  }
619
622
 
620
- // src/client-attestation/clent-attestation.ts
623
+ // src/client-attestation/client-attestation.ts
621
624
  async function verifyClientAttestationJwt(options) {
622
625
  const { header, payload } = decodeJwt({
623
626
  jwt: options.clientAttestationJwt,
@@ -883,7 +886,7 @@ async function fetchWellKnownMetadata(wellKnownMetadataUrl, schema, fetch) {
883
886
  }
884
887
  if (!response.ok) {
885
888
  throw new InvalidFetchResponseError(
886
- `Fetching well known metadata from '${wellKnownMetadataUrl}' resulted in an unsuccessfull response with status '${response.status}'.`,
889
+ `Fetching well known metadata from '${wellKnownMetadataUrl}' resulted in an unsuccessful response with status '${response.status}'.`,
887
890
  await response.clone().text(),
888
891
  response
889
892
  );
@@ -1013,7 +1016,7 @@ async function fetchJwks(jwksUrl, fetch) {
1013
1016
  const { result, response } = await fetcher(zJwkSet, [ContentType2.JwkSet, ContentType2.Json], jwksUrl);
1014
1017
  if (!response.ok) {
1015
1018
  throw new InvalidFetchResponseError2(
1016
- `Fetching JWKs from jwks_uri '${jwksUrl}' resulted in an unsuccessfull response with status code '${response.status}'.`,
1019
+ `Fetching JWKs from jwks_uri '${jwksUrl}' resulted in an unsuccessful response with status code '${response.status}'.`,
1017
1020
  await response.clone().text(),
1018
1021
  response
1019
1022
  );
@@ -1808,7 +1811,7 @@ function parseAccessTokenRequest(options) {
1808
1811
  if (!parsedAccessTokenRequest.success) {
1809
1812
  throw new Oauth2ServerErrorResponseError({
1810
1813
  error: "invalid_request" /* InvalidRequest */,
1811
- error_description: `Error occured during validation of authorization request.
1814
+ error_description: `Error occurred during validation of authorization request.
1812
1815
  ${formatZodError2(parsedAccessTokenRequest.error)}`
1813
1816
  });
1814
1817
  }
@@ -2046,7 +2049,7 @@ async function verifyAccessTokenRequestClientAttestation(options, authorizationS
2046
2049
  throw new Oauth2ServerErrorResponseError(
2047
2050
  {
2048
2051
  error: "invalid_request" /* InvalidRequest */,
2049
- error_description: "Expected the DPoP JWK thumbprint value to match the JWK thumbprint of the client attestation confirmation JWK. Ensrue both DPoP and client attestation use the same key."
2052
+ error_description: "Expected the DPoP JWK thumbprint value to match the JWK thumbprint of the client attestation confirmation JWK. Ensure both DPoP and client attestation use the same key."
2050
2053
  },
2051
2054
  {
2052
2055
  status: 401
@@ -2225,7 +2228,7 @@ function parseAuthorizationChallengeRequest(options) {
2225
2228
  if (!parsedAuthorizationChallengeRequest.success) {
2226
2229
  throw new Oauth2ServerErrorResponseError({
2227
2230
  error: "invalid_request" /* InvalidRequest */,
2228
- error_description: `Error occured during validation of authorization challenge request.
2231
+ error_description: `Error occurred during validation of authorization challenge request.
2229
2232
  ${formatZodError3(parsedAuthorizationChallengeRequest.error)}`
2230
2233
  });
2231
2234
  }
@@ -2298,7 +2301,7 @@ async function verifyAuthorizationRequestClientAttestation(options, authorizatio
2298
2301
  throw new Oauth2ServerErrorResponseError(
2299
2302
  {
2300
2303
  error: "invalid_request" /* InvalidRequest */,
2301
- error_description: "Expected the DPoP JWK thumbprint value to match the JWK thumbprint of the client attestation confirmation JWK. Ensrue both DPoP and client attestation use the same key."
2304
+ error_description: "Expected the DPoP JWK thumbprint value to match the JWK thumbprint of the client attestation confirmation JWK. Ensure both DPoP and client attestation use the same key."
2302
2305
  },
2303
2306
  {
2304
2307
  status: 401