@pagopa/io-react-native-wallet 0.21.0 → 0.22.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. package/lib/commonjs/credential/issuance/06-obtain-credential.js +5 -4
  2. package/lib/commonjs/credential/issuance/06-obtain-credential.js.map +1 -1
  3. package/lib/commonjs/credential/issuance/README.md +7 -5
  4. package/lib/commonjs/credential/issuance/types.js +5 -1
  5. package/lib/commonjs/credential/issuance/types.js.map +1 -1
  6. package/lib/commonjs/credential/status/02-status-attestation.js +4 -3
  7. package/lib/commonjs/credential/status/02-status-attestation.js.map +1 -1
  8. package/lib/commonjs/credential/status/README.md +1 -1
  9. package/lib/commonjs/credential/status/types.js +14 -1
  10. package/lib/commonjs/credential/status/types.js.map +1 -1
  11. package/lib/commonjs/sd-jwt/index.js +3 -1
  12. package/lib/commonjs/sd-jwt/index.js.map +1 -1
  13. package/lib/commonjs/trust/types.js +9 -1
  14. package/lib/commonjs/trust/types.js.map +1 -1
  15. package/lib/commonjs/utils/errors.js +57 -29
  16. package/lib/commonjs/utils/errors.js.map +1 -1
  17. package/lib/commonjs/utils/misc.js +11 -2
  18. package/lib/commonjs/utils/misc.js.map +1 -1
  19. package/lib/module/credential/issuance/06-obtain-credential.js +8 -7
  20. package/lib/module/credential/issuance/06-obtain-credential.js.map +1 -1
  21. package/lib/module/credential/issuance/README.md +7 -5
  22. package/lib/module/credential/issuance/types.js +3 -0
  23. package/lib/module/credential/issuance/types.js.map +1 -1
  24. package/lib/module/credential/status/02-status-attestation.js +7 -6
  25. package/lib/module/credential/status/02-status-attestation.js.map +1 -1
  26. package/lib/module/credential/status/README.md +1 -1
  27. package/lib/module/credential/status/types.js +12 -0
  28. package/lib/module/credential/status/types.js.map +1 -1
  29. package/lib/module/sd-jwt/index.js +3 -2
  30. package/lib/module/sd-jwt/index.js.map +1 -1
  31. package/lib/module/trust/types.js +9 -1
  32. package/lib/module/trust/types.js.map +1 -1
  33. package/lib/module/utils/errors.js +52 -25
  34. package/lib/module/utils/errors.js.map +1 -1
  35. package/lib/module/utils/misc.js +9 -1
  36. package/lib/module/utils/misc.js.map +1 -1
  37. package/lib/typescript/credential/issuance/06-obtain-credential.d.ts.map +1 -1
  38. package/lib/typescript/credential/issuance/types.d.ts +8 -0
  39. package/lib/typescript/credential/issuance/types.d.ts.map +1 -1
  40. package/lib/typescript/credential/status/02-status-attestation.d.ts +1 -1
  41. package/lib/typescript/credential/status/02-status-attestation.d.ts.map +1 -1
  42. package/lib/typescript/credential/status/types.d.ts +15 -0
  43. package/lib/typescript/credential/status/types.d.ts.map +1 -1
  44. package/lib/typescript/sd-jwt/index.d.ts.map +1 -1
  45. package/lib/typescript/trust/index.d.ts +14 -0
  46. package/lib/typescript/trust/index.d.ts.map +1 -1
  47. package/lib/typescript/trust/types.d.ts +194 -0
  48. package/lib/typescript/trust/types.d.ts.map +1 -1
  49. package/lib/typescript/utils/errors.d.ts +31 -14
  50. package/lib/typescript/utils/errors.d.ts.map +1 -1
  51. package/lib/typescript/utils/misc.d.ts +1 -0
  52. package/lib/typescript/utils/misc.d.ts.map +1 -1
  53. package/package.json +4 -3
  54. package/src/credential/issuance/06-obtain-credential.ts +11 -7
  55. package/src/credential/issuance/README.md +7 -5
  56. package/src/credential/issuance/types.ts +8 -0
  57. package/src/credential/status/02-status-attestation.ts +13 -5
  58. package/src/credential/status/README.md +1 -1
  59. package/src/credential/status/types.ts +15 -0
  60. package/src/sd-jwt/index.ts +3 -3
  61. package/src/trust/types.ts +12 -0
  62. package/src/utils/errors.ts +72 -26
  63. package/src/utils/misc.ts +12 -4
@@ -1,7 +1,7 @@
1
1
  import { sha256ToBase64, SignJWT } from "@pagopa/io-react-native-jwt";
2
- import { hasStatus } from "../../utils/misc";
3
- import { CredentialIssuingNotSynchronousError, CredentialNotEntitledError, CredentialRequestError, UnexpectedStatusCodeError, ValidationFailed } from "../../utils/errors";
4
- import { CredentialResponse } from "./types";
2
+ import { hasStatus, safeJsonParse } from "../../utils/misc";
3
+ import { CredentialInvalidStatusError, CredentialIssuingNotSynchronousError, CredentialRequestError, UnexpectedStatusCodeError, ValidationFailed } from "../../utils/errors";
4
+ import { CredentialIssuanceFailureResponse, CredentialResponse } from "./types";
5
5
  import { createDPopToken } from "../../utils/dpop";
6
6
  import uuid from "react-native-uuid";
7
7
  export const createNonceProof = async (nonce, issuer, audience, ctx) => {
@@ -87,8 +87,8 @@ export const obtainCredential = async (issuerConf, accessToken, clientId, creden
87
87
  * Handle the credential error by mapping it to a custom exception.
88
88
  * If the error is not an instance of {@link UnexpectedStatusCodeError}, it is thrown as is.
89
89
  * @param e - The error to be handled
90
- * @throws {@link StatusAttestationError} if the status code is different from 404
91
- * @throws {@link StatusAttestationInvalid} if the status code is 404 (meaning the credential is invalid)
90
+ * @throws {@link CredentialRequestError} if the status code is different from 404
91
+ * @throws {@link CredentialInvalidStatusError} if the status code is 404 (meaning the credential is invalid)
92
92
  */
93
93
  const handleObtainCredentialError = e => {
94
94
  if (!(e instanceof UnexpectedStatusCodeError)) {
@@ -100,8 +100,9 @@ const handleObtainCredentialError = e => {
100
100
  if (e.statusCode === 201) {
101
101
  throw new CredentialIssuingNotSynchronousError("This credential cannot be issued synchronously. It will be available at a later time.", e.message);
102
102
  }
103
- if (e.statusCode === 404) {
104
- throw new CredentialNotEntitledError("Invalid status found for the given credential", e.message);
103
+ if ([403, 404].includes(e.statusCode)) {
104
+ const maybeError = CredentialIssuanceFailureResponse.safeParse(safeJsonParse(e.responseBody));
105
+ throw new CredentialInvalidStatusError("Invalid status found for the given credential", maybeError.success ? maybeError.data.error : "unknown", e.message);
105
106
  }
106
107
  throw new CredentialRequestError(`Unable to obtain the requested credential [response status code: ${e.statusCode}]`, e.message);
107
108
  };
@@ -1 +1 @@
1
- {"version":3,"names":["sha256ToBase64","SignJWT","hasStatus","CredentialIssuingNotSynchronousError","CredentialNotEntitledError","CredentialRequestError","UnexpectedStatusCodeError","ValidationFailed","CredentialResponse","createDPopToken","uuid","createNonceProof","nonce","issuer","audience","ctx","jwk","getPublicKey","setPayload","setProtectedHeader","typ","setAudience","setIssuer","setIssuedAt","setExpirationTime","sign","obtainCredential","issuerConf","accessToken","clientId","credentialDefinition","context","credentialCryptoContext","appFetch","fetch","dPopCryptoContext","credentialUrl","openid_credential_issuer","credential_endpoint","signedNonceProof","c_nonce","constainsCredentialDefinition","authorization_details","some","c","credential_configuration_id","format","type","credentialRequestFormBody","credential_definition","proof","jwt","proof_type","tokenRequestSignedDPop","htm","htu","jti","v4","ath","access_token","credentialRes","method","headers","DPoP","Authorization","token_type","body","JSON","stringify","then","res","json","safeParse","catch","handleObtainCredentialError","success","error","message","data","e","statusCode"],"sourceRoot":"../../../../src","sources":["credential/issuance/06-obtain-credential.ts"],"mappings":"AAAA,SACEA,cAAc,EACdC,OAAO,QAEF,6BAA6B;AAGpC,SAASC,SAAS,QAAkB,kBAAkB;AAEtD,SACEC,oCAAoC,EACpCC,0BAA0B,EAC1BC,sBAAsB,EACtBC,yBAAyB,EACzBC,gBAAgB,QACX,oBAAoB;AAC3B,SAASC,kBAAkB,QAAQ,SAAS;AAE5C,SAASC,eAAe,QAAQ,kBAAkB;AAClD,OAAOC,IAAI,MAAM,mBAAmB;AAcpC,OAAO,MAAMC,gBAAgB,GAAG,MAAAA,CAC9BC,KAAa,EACbC,MAAc,EACdC,QAAgB,EAChBC,GAAkB,KACE;EACpB,MAAMC,GAAG,GAAG,MAAMD,GAAG,CAACE,YAAY,CAAC,CAAC;EACpC,OAAO,IAAIhB,OAAO,CAACc,GAAG,CAAC,CACpBG,UAAU,CAAC;IACVN;EACF,CAAC,CAAC,CACDO,kBAAkB,CAAC;IAClBC,GAAG,EAAE,sBAAsB;IAC3BJ;EACF,CAAC,CAAC,CACDK,WAAW,CAACP,QAAQ,CAAC,CACrBQ,SAAS,CAACT,MAAM,CAAC,CACjBU,WAAW,CAAC,CAAC,CACbC,iBAAiB,CAAC,MAAM,CAAC,CACzBC,IAAI,CAAC,CAAC;AACX,CAAC;;AAED;AACA;AACA;AACA;AAC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MAAM,IAAIxE,sBAAsB,CAC7B,oEAAmE0E,CAAC,CAACC,UAAW,GAAE,EACnFD,CAAC,CAACF,OACJ,CAAC;AACH,CAAC"}
1
+ {"version":3,"names":["sha256ToBase64","SignJWT","hasStatus","safeJsonParse","CredentialInvalidStatusError","CredentialIssuingNotSynchronousError","CredentialRequestError","UnexpectedStatusCodeError","ValidationFailed","CredentialIssuanceFailureResponse","CredentialResponse","createDPopToken","uuid","createNonceProof","nonce","issuer","audience","ctx","jwk","getPublicKey","setPayload","setProtectedHeader","typ","setAudience","setIssuer","setIssuedAt","setExpirationTime","sign","obtainCredential","issuerConf","accessToken","clientId","credentialDefinition","context","credentialCryptoContext","appFetch","fetch","dPopCryptoContext","credentialUrl","openid_credential_issuer","credential_endpoint","signedNonceProof","c_nonce","constainsCredentialDefinition","authorization_details","some","c","credential_configuration_id","format","type","credentialRequestFormBody","credential_definition","proof","jwt","proof_type","tokenRequestSignedDPop","htm","htu","jti","v4","ath","access_token","credentialRes","method","headers","DPoP","Authorization","token_type","body","JSON","stringify","then","res","json","safeParse","catch","handleObtainCredentialError","success","error","message","data","e","statusCode","includes","maybeError","responseBody"],"sourceRoot":"../../../../src","sources":["credential/issuance/06-obtain-credential.ts"],"mappings":"AAAA,SACEA,cAAc,EACdC,OAAO,QAEF,6BAA6B;AAGpC,SAASC,SAAS,EAAEC,aAAa,QAAkB,kBAAkB;AAErE,SACEC,4BAA4B,EAC5BC,oCAAoC,EACpCC,sBAAsB,EACtBC,yBAAyB,EACzBC,gBAAgB,QACX,oBAAoB;AAC3B,SAASC,iCAAiC,EAAEC,kBAAkB,QAAQ,SAAS;AAE/E,SAASC,eAAe,QAAQ,kBAAkB;AAClD,OAAOC,IAAI,MAAM,mBAAmB;AAcpC,OAAO,MAAMC,gBAAgB,GAAG,MAAAA,CAC9BC,KAAa,EACbC,MAAc,EACdC,QAAgB,EAChBC,GAAkB,KACE;EACpB,MAAMC,GAAG,GAAG,MAAMD,GAAG,CAACE,YAAY,C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AAI,EAAEA,CAAC,YAAY1E,yBAAyB,CAAC,EAAE;IAC7C,MAAM0E,CAAC;EACT;;EAEA;EACA;EACA,IAAIA,CAAC,CAACC,UAAU,KAAK,GAAG,EAAE;IACxB,MAAM,IAAI7E,oCAAoC,CAC5C,uFAAuF,EACvF4E,CAAC,CAACF,OACJ,CAAC;EACH;EAEA,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAACI,QAAQ,CAACF,CAAC,CAACC,UAAU,CAAC,EAAE;IACrC,MAAME,UAAU,GAAG3E,iCAAiC,CAACiE,SAAS,CAC5DvE,aAAa,CAAC8E,CAAC,CAACI,YAAY,CAC9B,CAAC;IACD,MAAM,IAAIjF,4BAA4B,CACpC,+CAA+C,EAC/CgF,UAAU,CAACP,OAAO,GAAGO,UAAU,CAACJ,IAAI,CAACF,KAAK,GAAG,SAAS,EACtDG,CAAC,CAACF,OACJ,CAAC;EACH;EAEA,MAAM,IAAIzE,sBAAsB,CAC7B,oEAAmE2E,CAAC,CAACC,UAAW,GAAE,EACnFD,CAAC,CAACF,OACJ,CAAC;AACH,CAAC"}
@@ -43,14 +43,16 @@ graph TD;
43
43
 
44
44
  A `201 Created` response is returned by the credential issuer when the request has been queued because the credential cannot be issued synchronously. The consumer should try to obtain the credential at a later time.
45
45
 
46
- ### 404 Not Found (CredentialNotEntitledError)
46
+ Although `201 Created` is not considered an error, it is mapped as an error in this context in order to handle the case where the credential issuance is not synchronous.
47
+ This allows keeping the flow consistent and handle the case where the credential is not immediately available.
47
48
 
48
- A `404 Not Found` response is returned by the credential issuer when the authenticated user is not entitled to receive the requested credential.
49
+ ### 403 Forbidden (CredentialInvalidStatusError)
49
50
 
50
- ### 201 Created (CredentialIssuingNotSynchronousError)
51
+ A `403 Forbidden` response is returned by the credential issuer when the requested credential has an invalid status. It might contain more details in the `errorCode` property.
51
52
 
52
- Although `201 Created` is not considered an error, it is mapped as an error in this context in order to handle the case where the credential issuance is not synchronous.
53
- This allows keeping the flow consistent and handle the case where the credential is not immediately available.
53
+ ### 404 Not Found (CredentialInvalidStatusError)
54
+
55
+ A `404 Not Found` response is returned by the credential issuer when the authenticated user is not entitled to receive the requested credential. It might contain more details in the `errorCode` property.
54
56
 
55
57
  ## Strong authentication for eID issuance (Query Mode)
56
58
 
@@ -22,4 +22,7 @@ export const CredentialResponse = z.object({
22
22
  export const ResponseUriResultShape = z.object({
23
23
  redirect_uri: z.string()
24
24
  });
25
+ export const CredentialIssuanceFailureResponse = z.object({
26
+ error: z.string()
27
+ });
25
28
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["AuthorizationDetail","z","SupportedCredentialFormat","TokenResponse","object","access_token","string","authorization_details","array","c_nonce","c_nonce_expires_in","number","expires_in","token_type","CredentialResponse","credential","format","ResponseUriResultShape","redirect_uri"],"sourceRoot":"../../../../src","sources":["credential/issuance/types.ts"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,iBAAiB;AACrD,OAAO,KAAKC,CAAC,MAAM,KAAK;AACxB,SAASC,yBAAyB,QAAQ,SAAS;AAInD,OAAO,MAAMC,aAAa,GAAGF,CAAC,CAACG,MAAM,CAAC;EACpCC,YAAY,EAAEJ,CAAC,CAACK,MAAM,CAAC,CAAC;EACxBC,qBAAqB,EAAEN,CAAC,CAACO,KAAK,CAACR,mBAAmB,CAAC;EACnDS,OAAO,EAAER,CAAC,CAACK,MAAM,CAAC,CAAC;EACnBI,kBAAkB,EAAET,CAAC,CAACU,MAAM,CAAC,CAAC;EAC9BC,UAAU,EAAEX,CAAC,CAACU,MAAM,CAAC,CAAC;EACtBE,UAAU,EAAEZ,CAAC,CAACK,MAAM,CAAC;AACvB,CAAC,CAAC;AAIF,OAAO,MAAMQ,kBAAkB,GAAGb,CAAC,CAACG,MAAM,CAAC;EACzCK,OAAO,EAAER,CAAC,CAACK,MAAM,CAAC,CAAC;EACnBI,kBAAkB,EAAET,CAAC,CAACU,MAAM,CAAC,CAAC;EAC9BI,UAAU,EAAEd,CAAC,CAACK,MAAM,CAAC,CAAC;EACtBU,MAAM,EAAEd;AACV,CAAC,CAAC;;AAEF;AACA;AACA;AACA,OAAO,MAAMe,sBAAsB,GAAGhB,CAAC,CAACG,MAAM,CAAC;EAC7Cc,YAAY,EAAEjB,CAAC,CAACK,MAAM,CAAC;AACzB,CAAC,CAAC"}
1
+ {"version":3,"names":["AuthorizationDetail","z","SupportedCredentialFormat","TokenResponse","object","access_token","string","authorization_details","array","c_nonce","c_nonce_expires_in","number","expires_in","token_type","CredentialResponse","credential","format","ResponseUriResultShape","redirect_uri","CredentialIssuanceFailureResponse","error"],"sourceRoot":"../../../../src","sources":["credential/issuance/types.ts"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,iBAAiB;AACrD,OAAO,KAAKC,CAAC,MAAM,KAAK;AACxB,SAASC,yBAAyB,QAAQ,SAAS;AAInD,OAAO,MAAMC,aAAa,GAAGF,CAAC,CAACG,MAAM,CAAC;EACpCC,YAAY,EAAEJ,CAAC,CAACK,MAAM,CAAC,CAAC;EACxBC,qBAAqB,EAAEN,CAAC,CAACO,KAAK,CAACR,mBAAmB,CAAC;EACnDS,OAAO,EAAER,CAAC,CAACK,MAAM,CAAC,CAAC;EACnBI,kBAAkB,EAAET,CAAC,CAACU,MAAM,CAAC,CAAC;EAC9BC,UAAU,EAAEX,CAAC,CAACU,MAAM,CAAC,CAAC;EACtBE,UAAU,EAAEZ,CAAC,CAACK,MAAM,CAAC;AACvB,CAAC,CAAC;AAIF,OAAO,MAAMQ,kBAAkB,GAAGb,CAAC,CAACG,MAAM,CAAC;EACzCK,OAAO,EAAER,CAAC,CAACK,MAAM,CAAC,CAAC;EACnBI,kBAAkB,EAAET,CAAC,CAACU,MAAM,CAAC,CAAC;EAC9BI,UAAU,EAAEd,CAAC,CAACK,MAAM,CAAC,CAAC;EACtBU,MAAM,EAAEd;AACV,CAAC,CAAC;;AAEF;AACA;AACA;AACA,OAAO,MAAMe,sBAAsB,GAAGhB,CAAC,CAACG,MAAM,CAAC;EAC7Cc,YAAY,EAAEjB,CAAC,CAACK,MAAM,CAAC;AACzB,CAAC,CAAC;AAIF,OAAO,MAAMa,iCAAiC,GAAGlB,CAAC,CAACG,MAAM,CAAC;EACxDgB,KAAK,EAAEnB,CAAC,CAACK,MAAM,CAAC;AAClB,CAAC,CAAC"}
@@ -1,8 +1,8 @@
1
- import { getCredentialHashWithouDiscloures, hasStatus } from "../../utils/misc";
1
+ import { getCredentialHashWithouDiscloures, hasStatus, safeJsonParse } from "../../utils/misc";
2
2
  import { SignJWT } from "@pagopa/io-react-native-jwt";
3
3
  import uuid from "react-native-uuid";
4
- import { StatusAttestationResponse } from "./types";
5
- import { StatusAttestationError, StatusAttestationInvalid, UnexpectedStatusCodeError } from "../../utils/errors";
4
+ import { InvalidStatusAttestationResponse, StatusAttestationResponse } from "./types";
5
+ import { StatusAttestationError, CredentialInvalidStatusError, UnexpectedStatusCodeError } from "../../utils/errors";
6
6
  /**
7
7
  * WARNING: This function must be called after {@link startFlow}.
8
8
  * Verify the status of the credential attestation.
@@ -10,7 +10,7 @@ import { StatusAttestationError, StatusAttestationInvalid, UnexpectedStatusCodeE
10
10
  * @param credential - The credential to be verified
11
11
  * @param credentialCryptoContext - The credential's crypto context
12
12
  * @param context.appFetch (optional) fetch api implementation. Default: built-in fetch
13
- * @throws {@link StatusAttestationInvalid} if the status attestation is invalid and thus the credential is not valid
13
+ * @throws {@link CredentialInvalidStatusError} if the status attestation is invalid and thus the credential is not valid
14
14
  * @throws {@link StatusAttestationError} if an error occurs during the status attestation
15
15
  * @returns The credential status attestation
16
16
  */
@@ -49,14 +49,15 @@ export const statusAttestation = async function (issuerConf, credential, credent
49
49
  * If the error is not an instance of {@link UnexpectedStatusCodeError}, it is thrown as is.
50
50
  * @param e - The error to be handled
51
51
  * @throws {@link StatusAttestationError} if the status code is different from 404
52
- * @throws {@link StatusAttestationInvalid} if the status code is 404 (meaning the credential is invalid)
52
+ * @throws {@link CredentialInvalidStatusError} if the status code is 404 (meaning the credential is invalid)
53
53
  */
54
54
  const handleStatusAttestationError = e => {
55
55
  if (!(e instanceof UnexpectedStatusCodeError)) {
56
56
  throw e;
57
57
  }
58
58
  if (e.statusCode === 404) {
59
- throw new StatusAttestationInvalid("Invalid status found for the given credential", e.message);
59
+ const maybeError = InvalidStatusAttestationResponse.safeParse(safeJsonParse(e.responseBody));
60
+ throw new CredentialInvalidStatusError("Invalid status found for the given credential", maybeError.success ? maybeError.data.error : "unknown", e.message);
60
61
  }
61
62
  throw new StatusAttestationError(`Unable to obtain the status attestation for the given credential [response status code: ${e.statusCode}]`, e.message);
62
63
  };
@@ -1 +1 @@
1
- {"version":3,"names":["getCredentialHashWithouDiscloures","hasStatus","SignJWT","uuid","StatusAttestationResponse","StatusAttestationError","StatusAttestationInvalid","UnexpectedStatusCodeError","statusAttestation","issuerConf","credential","credentialCryptoContext","appFetch","arguments","length","undefined","fetch","jwk","getPublicKey","credentialHash","statusAttUrl","openid_credential_issuer","status_attestation_endpoint","credentialPop","setPayload","aud","jti","v4","toString","credential_hash","credential_hash_alg","setProtectedHeader","alg","typ","kid","setIssuedAt","setExpirationTime","sign","body","credential_pop","result","method","headers","JSON","stringify","then","raw","json","parse","catch","handleStatusAttestationError","status_attestation","e","statusCode","message"],"sourceRoot":"../../../../src","sources":["credential/status/02-status-attestation.ts"],"mappings":"AAAA,SACEA,iCAAiC,EACjCC,SAAS,QAEJ,kBAAkB;AAEzB,SAASC,OAAO,QAA4B,6BAA6B;AACzE,OAAOC,IAAI,MAAM,mBAAmB;AACpC,SAASC,yBAAyB,QAAQ,SAAS;AACnD,SACEC,sBAAsB,EACtBC,wBAAwB,EACxBC,yBAAyB,QACpB,oBAAoB;AAW3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,iBAAoC,GAAG,eAAAA,CAClDC,UAAU,EACVC,UAAU,EACVC,uBAAuB,EAEpB;EAAA,IADHC,QAA8B,GAAAC,SAAA,CAAA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,iBAAiB,EAAEgC,MAAM,CAACW;EAAmB,CAAC;AACzD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMD,4BAA4B,GAAIE,CAAU,IAAK;EACnD,IAAI,EAAEA,CAAC,YAAY7C,yBAAyB,CAAC,EAAE;IAC7C,MAAM6C,CAAC;EACT;EAEA,IAAIA,CAAC,CAACC,UAAU,KAAK,GAAG,EAAE;IACxB,MAAM,IAAI/C,wBAAwB,CAChC,+CAA+C,EAC/C8C,CAAC,CAACE,OACJ,CAAC;EACH;EAEA,MAAM,IAAIjD,sBAAsB,CAC7B,2FAA0F+C,CAAC,CAACC,UAAW,GAAE,EAC1GD,CAAC,CAACE,OACJ,CAAC;AACH,CAAC"}
1
+ {"version":3,"names":["getCredentialHashWithouDiscloures","hasStatus","safeJsonParse","SignJWT","uuid","InvalidStatusAttestationResponse","StatusAttestationResponse","StatusAttestationError","CredentialInvalidStatusError","UnexpectedStatusCodeError","statusAttestation","issuerConf","credential","credentialCryptoContext","appFetch","arguments","length","undefined","fetch","jwk","getPublicKey","credentialHash","statusAttUrl","openid_credential_issuer","status_attestation_endpoint","credentialPop","setPayload","aud","jti","v4","toString","credential_hash","credential_hash_alg","setProtectedHeader","alg","typ","kid","setIssuedAt","setExpirationTime","sign","body","credential_pop","result","method","headers","JSON","stringify","then","raw","json","parse","catch","handleStatusAttestationError","status_attestation","e","statusCode","maybeError","safeParse","responseBody","success","data","error","message"],"sourceRoot":"../../../../src","sources":["credential/status/02-status-attestation.ts"],"mappings":"AAAA,SACEA,iCAAiC,EACjCC,SAAS,EACTC,aAAa,QAER,kBAAkB;AAEzB,SAASC,OAAO,QAA4B,6BAA6B;AACzE,OAAOC,IAAI,MAAM,mBAAmB;AACpC,SACEC,gCAAgC,EAChCC,yBAAyB,QACpB,SAAS;AAChB,SACEC,sBAAsB,EACtBC,4BAA4B,EAC5BC,yBAAyB,QACpB,oBAAoB;AAW3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA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,CACzBF,IAAI,CAAEE,IAAI,IAAK3C,yBAAyB,CAAC4C,KAAK,CAACD,IAAI,CAAC,CAAC,CACrDE,KAAK,CAACC,4BAA4B,CAAC;EAEtC,OAAO;IAAE1C,iBAAiB,EAAEgC,MAAM,CAACW;EAAmB,CAAC;AACzD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMD,4BAA4B,GAAIE,CAAU,IAAK;EACnD,IAAI,EAAEA,CAAC,YAAY7C,yBAAyB,CAAC,EAAE;IAC7C,MAAM6C,CAAC;EACT;EAEA,IAAIA,CAAC,CAACC,UAAU,KAAK,GAAG,EAAE;IACxB,MAAMC,UAAU,GAAGnD,gCAAgC,CAACoD,SAAS,CAC3DvD,aAAa,CAACoD,CAAC,CAACI,YAAY,CAC9B,CAAC;IACD,MAAM,IAAIlD,4BAA4B,CACpC,+CAA+C,EAC/CgD,UAAU,CAACG,OAAO,GAAGH,UAAU,CAACI,IAAI,CAACC,KAAK,GAAG,SAAS,EACtDP,CAAC,CAACQ,OACJ,CAAC;EACH;EAEA,MAAM,IAAIvD,sBAAsB,CAC7B,2FAA0F+C,CAAC,CAACC,UAAW,GAAE,EAC1GD,CAAC,CAACQ,OACJ,CAAC;AACH,CAAC"}
@@ -18,7 +18,7 @@ graph TD;
18
18
 
19
19
  ## Mapped results
20
20
 
21
- ### 404 Not Found (StatusAttestationInvalid)
21
+ ### 404 Not Found (CredentialInvalidStatusError)
22
22
 
23
23
  A `404 Not Found` response is returned by the credential issuer when the status attestation is invalid.
24
24
 
@@ -37,4 +37,16 @@ export const ParsedStatusAttestation = z.object({
37
37
  iat: UnixTime
38
38
  })
39
39
  });
40
+
41
+ /**
42
+ * Shape from parsing a status attestation response in case of error.
43
+ */
44
+ export const InvalidStatusAttestationResponse = z.object({
45
+ error: z.string()
46
+ });
47
+
48
+ /**
49
+ * Type from parsing a status attestation response in case of error.
50
+ * Inferred from {@link InvalidStatusAttestationResponse}.
51
+ */
40
52
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["UnixTime","JWK","z","StatusAttestationResponse","object","status_attestation","string","ParsedStatusAttestation","header","typ","literal","alg","kid","optional","payload","credential_hash_alg","credential_hash","cnf","jwk","exp","iat"],"sourceRoot":"../../../../src","sources":["credential/status/types.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,GAAG,QAAQ,iBAAiB;AACrC,OAAO,KAAKC,CAAC,MAAM,KAAK;;AAExB;AACA;AACA;AACA,OAAO,MAAMC,yBAAyB,GAAGD,CAAC,CAACE,MAAM,CAAC;EAChDC,kBAAkB,EAAEH,CAAC,CAACI,MAAM,CAAC;AAC/B,CAAC,CAAC;;AAEF;AACA;AACA;AACA;;AAKA;AACA;AACA;;AAGA;AACA;AACA;AACA,OAAO,MAAMC,uBAAuB,GAAGL,CAAC,CAACE,MAAM,CAAC;EAC9CI,MAAM,EAAEN,CAAC,CAACE,MAAM,CAAC;IACfK,GAAG,EAAEP,CAAC,CAACQ,OAAO,CAAC,wBAAwB,CAAC;IACxCC,GAAG,EAAET,CAAC,CAACI,MAAM,CAAC,CAAC;IACfM,GAAG,EAAEV,CAAC,CAACI,MAAM,CAAC,CAAC,CAACO,QAAQ,CAAC;EAC3B,CAAC,CAAC;EACFC,OAAO,EAAEZ,CAAC,CAACE,MAAM,CAAC;IAChBW,mBAAmB,EAAEb,CAAC,CAACI,MAAM,CAAC,CAAC;IAC/BU,eAAe,EAAEd,CAAC,CAACI,MAAM,CAAC,CAAC;IAC3BW,GAAG,EAAEf,CAAC,CAACE,MAAM,CAAC;MACZc,GAAG,EAAEjB;IACP,CAAC,CAAC;IACFkB,GAAG,EAAEnB,QAAQ;IACboB,GAAG,EAAEpB;EACP,CAAC;AACH,CAAC,CAAC"}
1
+ {"version":3,"names":["UnixTime","JWK","z","StatusAttestationResponse","object","status_attestation","string","ParsedStatusAttestation","header","typ","literal","alg","kid","optional","payload","credential_hash_alg","credential_hash","cnf","jwk","exp","iat","InvalidStatusAttestationResponse","error"],"sourceRoot":"../../../../src","sources":["credential/status/types.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,GAAG,QAAQ,iBAAiB;AACrC,OAAO,KAAKC,CAAC,MAAM,KAAK;;AAExB;AACA;AACA;AACA,OAAO,MAAMC,yBAAyB,GAAGD,CAAC,CAACE,MAAM,CAAC;EAChDC,kBAAkB,EAAEH,CAAC,CAACI,MAAM,CAAC;AAC/B,CAAC,CAAC;;AAEF;AACA;AACA;AACA;;AAKA;AACA;AACA;;AAGA;AACA;AACA;AACA,OAAO,MAAMC,uBAAuB,GAAGL,CAAC,CAACE,MAAM,CAAC;EAC9CI,MAAM,EAAEN,CAAC,CAACE,MAAM,CAAC;IACfK,GAAG,EAAEP,CAAC,CAACQ,OAAO,CAAC,wBAAwB,CAAC;IACxCC,GAAG,EAAET,CAAC,CAACI,MAAM,CAAC,CAAC;IACfM,GAAG,EAAEV,CAAC,CAACI,MAAM,CAAC,CAAC,CAACO,QAAQ,CAAC;EAC3B,CAAC,CAAC;EACFC,OAAO,EAAEZ,CAAC,CAACE,MAAM,CAAC;IAChBW,mBAAmB,EAAEb,CAAC,CAACI,MAAM,CAAC,CAAC;IAC/BU,eAAe,EAAEd,CAAC,CAACI,MAAM,CAAC,CAAC;IAC3BW,GAAG,EAAEf,CAAC,CAACE,MAAM,CAAC;MACZc,GAAG,EAAEjB;IACP,CAAC,CAAC;IACFkB,GAAG,EAAEnB,QAAQ;IACboB,GAAG,EAAEpB;EACP,CAAC;AACH,CAAC,CAAC;;AAEF;AACA;AACA;AACA,OAAO,MAAMqB,gCAAgC,GAAGnB,CAAC,CAACE,MAAM,CAAC;EACvDkB,KAAK,EAAEpB,CAAC,CAACI,MAAM,CAAC;AAClB,CAAC,CAAC;;AAEF;AACA;AACA;AACA"}
@@ -1,12 +1,13 @@
1
1
  import { decode as decodeJwt } from "@pagopa/io-react-native-jwt";
2
2
  import { verify as verifyJwt } from "@pagopa/io-react-native-jwt";
3
3
  import { sha256ToBase64 } from "@pagopa/io-react-native-jwt";
4
- import { decodeBase64 } from "@pagopa/io-react-native-jwt";
5
4
  import { Disclosure, SdJwt4VC } from "./types";
6
5
  import { verifyDisclosure } from "./verifier";
7
6
  import { ClaimsNotFoundBetweenDislosures, ClaimsNotFoundInToken } from "../utils/errors";
7
+ import { Base64 } from "js-base64";
8
8
  const decodeDisclosure = encoded => {
9
- const decoded = Disclosure.parse(JSON.parse(decodeBase64(encoded)));
9
+ const utf8String = Base64.decode(encoded); // Decode Base64 into UTF-8 string
10
+ const decoded = Disclosure.parse(JSON.parse(utf8String));
10
11
  return {
11
12
  decoded,
12
13
  encoded
@@ -1 +1 @@
1
- {"version":3,"names":["decode","decodeJwt","verify","verifyJwt","sha256ToBase64","decodeBase64","Disclosure","SdJwt4VC","verifyDisclosure","ClaimsNotFoundBetweenDislosures","ClaimsNotFoundInToken","decodeDisclosure","encoded","decoded","parse","JSON","token","customSchema","slice","rawSdJwt","rawDisclosures","split","decodedJwt","parser","sdJwt","header","protectedHeader","payload","disclosures","map","disclose","claims","paths","Promise","all","claim","disclosure","find","_ref","name","hash","_sd","includes","index","indexOf","path","filteredDisclosures","filter","d","disclosedToken","join","publicKey"],"sourceRoot":"../../../src","sources":["sd-jwt/index.ts"],"mappings":"AAEA,SAASA,MAAM,IAAIC,SAAS,QAAQ,6BAA6B;AACjE,SAASC,MAAM,IAAIC,SAAS,QAAQ,6BAA6B;AACjE,SAASC,cAAc,QAAQ,6BAA6B;AAE5D,SAASC,YAAY,QAAQ,6BAA6B;AAC1D,SAASC,UAAU,EAAEC,QAAQ,QAAoC,SAAS;AAC1E,SAASC,gBAAgB,QAAQ,YAAY;AAE7C,SACEC,+BAA+B,EAC/BC,qBAAqB,QAChB,iBAAiB;AAExB,MAAMC,gBAAgB,GAAIC,OAAe,IAA4B;EACnE,MAAMC,OAAO,GAAGP,UAAU,CAACQ,KAAK,CAACC,IAAI,CAACD,K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A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAM9B,MAAM,GAAG,MAAAA,CACpBc,KAAa,EACbmC,SAAsB,EACtBlC,YAAgB,KAC8C;EAC9D;EACA,MAAM,CAACE,QAAQ,GAAG,EAAE,CAAC,GAAGH,KAAK,CAACK,KAAK,CAAC,GAAG,CAAC;EACxC,MAAMR,OAAO,GAAGb,MAAM,CAACgB,KAAK,EAAEC,YAAY,CAAC;;EAE3C;EACA,MAAMd,SAAS,CAACgB,QAAQ,EAAEgC,SAAS,CAAC;;EAEpC;EACA,MAAMpB,MAAM,GAAG,CAAC,GAAGlB,OAAO,CAACW,KAAK,CAACG,OAAO,CAACc,GAAG,CAAC;EAE7C,MAAMR,OAAO,CAACC,GAAG,CACfrB,OAAO,CAACe,WAAW,CAACC,GAAG,CACrB,MAAOO,UAAU,IAAK,MAAM5B,gBAAgB,CAAC4B,UAAU,EAAEL,MAAM,CACjE,CACF,CAAC;EAED,OAAO;IACLP,KAAK,EAAEX,OAAO,CAACW,KAAK;IACpBI,WAAW,EAAEf,OAAO,CAACe,WAAW,CAACC,GAAG,CAAEmB,CAAC,IAAKA,CAAC,CAACnC,OAAO;EACvD,CAAC;AACH,CAAC;AAED,SAASN,QAAQ"}
1
+ {"version":3,"names":["decode","decodeJwt","verify","verifyJwt","sha256ToBase64","Disclosure","SdJwt4VC","verifyDisclosure","ClaimsNotFoundBetweenDislosures","ClaimsNotFoundInToken","Base64","decodeDisclosure","encoded","utf8String","decoded","parse","JSON","token","customSchema","slice","rawSdJwt","rawDisclosures","split","decodedJwt","parser","sdJwt","header","protectedHeader","payload","disclosures","map","disclose","claims","paths","Promise","all","claim","disclosure","find","_ref","name","hash","_sd","includes","index","indexOf","path","filteredDisclosures","filter","d","disclosedToken","join","publicKey"],"sourceRoot":"../../../src","sources":["sd-jwt/index.ts"],"mappings":"AAEA,SAASA,MAAM,IAAIC,SAAS,QAAQ,6BAA6B;AACjE,SAASC,MAAM,IAAIC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50
50
  }))
51
51
  }));
52
+ const IssuanceErrorSupported = z.object({
53
+ display: z.array(z.object({
54
+ title: z.string(),
55
+ description: z.string(),
56
+ locale: z.string()
57
+ }))
58
+ });
52
59
 
53
60
  // Metadata for a credentia which is supported by a Issuer
54
61
 
@@ -60,7 +67,8 @@ const SupportedCredentialMetadata = z.object({
60
67
  // TODO [SIW-1268]: should not be optional
61
68
  cryptographic_binding_methods_supported: z.array(z.string()),
62
69
  credential_signing_alg_values_supported: z.array(z.string()),
63
- authentic_source: z.string().optional()
70
+ authentic_source: z.string().optional(),
71
+ issuance_errors_supported: z.record(IssuanceErrorSupported).optional()
64
72
  });
65
73
  export const EntityStatement = z.object({
66
74
  header: z.object({
@@ -1 +1 @@
1
- {"version":3,"names":["UnixTime","JWK","z","TrustMark","object","id","string","trust_mark","RelyingPartyMetadata","application_type","optional","client_id","client_name","jwks","keys","array","contacts","CredentialDisplayMetadata","name","locale","logo","url","alt_text","background_color","text_color","CredentialIssuerDisplayMetadata","ClaimsMetadata","record","value_type","display","SupportedCredentialMetadata","format","union","literal","scope","claims","cryptographic_binding_methods_supported","credential_signing_alg_values_supported","authentic_source","EntityStatement","header","typ","alg","kid","payload","iss","sub","trust_marks","iat","number","exp","EntityConfigurationHeader","FederationEntityMetadata","federation_fetch_endpoint","federation_list_endpoint","federation_resolve_endpoint","federation_trust_mark_status_endpoint","federation_trust_mark_list_endpoint","organization_name","homepage_uri","policy_uri","logo_uri","passthrough","BaseEntityConfiguration","authority_hints","metadata","federation_entity","TrustAnchorEntityConfiguration","CredentialIssuerEntityConfiguration","and","openid_credential_issuer","credential_issuer","credential_endpoint","revocation_endpoint","status_attestation_endpoint","credential_configurations_supported","oauth_authorization_server","authorization_endpoint","pushed_authorization_request_endpoint","dpop_signing_alg_values_supported","token_endpoint","introspection_endpoint","client_registration_types_supported","code_challenge_methods_supported","authorization_details_types_supported","acr_values_supported","grant_types_supported","issuer","scopes_supported","request_parameter_supported","boolean","request_uri_parameter_supported","response_types_supported","response_modes_supported","subject_types_supported","token_endpoint_auth_methods_supported","token_endpoint_auth_signing_alg_values_supported","request_object_signing_alg_values_supported","wallet_relying_party","RelyingPartyEntityConfiguration","WalletProviderEntityConfiguration","wallet_provider","aal_values_supported","EntityConfiguration","description"],"sourceRoot":"../../../src","sources":["trust/types.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,GAAG,QAAQ,cAAc;AAClC,OAAO,KAAKC,CAAC,MAAM,KAAK;AAExB,OAAO,MAAMC,SAAS,GAAGD,CAAC,CAACE,MAAM,CAAC;EAAEC,EAAE,EAAEH,CAAC,CAACI,MAAM,CAAC,CAAC;EAAEC,UAAU,EAAEL,CAAC,CAACI,MAAM,CAAC;AAAE,CAAC,CAAC;AAG7E,MAAME,oBAAoB,GAAGN,CAAC,CAACE,MAAM,CAAC;EACpCK,gBAAgB,EAAEP,CAAC,CAACI,MAAM,CAAC,CAAC,CAACI,QAAQ,CAAC,CAAC;EACvCC,SAAS,EAAET,CAAC,CAACI,MAAM,CAAC,CAAC,CAACI,QAAQ,CAAC,CAAC;EAChCE,WAAW,EAAEV,CAAC,CAACI,MAAM,CAAC,CAAC,CAACI,QAAQ,CAAC,CAAC;EAClCG,IAAI,EAAEX,CAAC,CAACE,MAAM,CAAC;IAAEU,IAAI,EAAEZ,CAAC,CAACa,KAAK,CAACd,GAAG;EAAE,CAAC,CAAC;EACtCe,QAAQ,EAAEd,CAAC,CAACa,KAAK,CAACb,CAAC,CAACI,MAAM,CAAC,CAAC,CAAC,CAACI,QAAQ,CAAC;AACzC,CAAC,CAAC;AACF;;AAEA;AACA;AAEA,MAAMO,yBAAyB,GAAGf,CAAC,CAACE,MAAM,CAAC;EACzCc,IAAI,EAAEhB,CAAC,CAACI,MAAM,CAAC,CAAC;EAChBa,MAAM,EAAEjB,CAAC,CAACI,MAAM,CAAC,CAAC;EAClBc,IAAI,EAAElB,CAAC,CACJE,MAAM,CAAC;IACNiB,GAAG,EAAEn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F;IACxB,CAAC;EACH,CAAC;AACH,CAAC,CACH,CAAC;;AAED;;AAIA,OAAO,MAAM4F,iCAAiC,GAAGrC,uBAAuB,CAACM,GAAG,CAC1EnE,CAAC,CAACE,MAAM,CAAC;EACPwC,OAAO,EAAE1C,CAAC,CAACE,MAAM,CAAC;IAChB6D,QAAQ,EAAE/D,CAAC,CAACE,MAAM,CAAC;MACjBiG,eAAe,EAAEnG,CAAC,CACfE,MAAM,CAAC;QACN4E,cAAc,EAAE9E,CAAC,CAACI,MAAM,CAAC,CAAC;QAC1BgG,oBAAoB,EAAEpG,CAAC,CAACa,KAAK,CAACb,CAAC,CAACI,MAAM,CAAC,CAAC,CAAC,CAACI,QAAQ,CAAC,CAAC;QACpD4E,qBAAqB,EAAEpF,CAAC,CAACa,KAAK,CAACb,CAAC,CAACI,MAAM,CAAC,CAAC,CAAC;QAC1CyF,qCAAqC,EAAE7F,CAAC,CAACa,KAAK,CAACb,CAAC,CAACI,MAAM,CAAC,CAAC,CAAC;QAC1D0F,gDAAgD,EAAE9F,CAAC,CAACa,KAAK,CACvDb,CAAC,CAACI,MAAM,CAAC,CACX,CAAC;QACDO,IAAI,EAAEX,CAAC,CAACE,MAAM,CAAC;UAAEU,IAAI,EAAEZ,CAAC,CAACa,KAAK,CAACd,GAAG;QAAE,CAAC;MACvC,CAAC,CAAC,CACD6D,WAAW,CAAC;IACjB,CAAC;EACH,CAAC;AACH,CAAC,CACH,CAAC;;AAED;;AAEA,OAAO,MAAMyC,mBAAmB,GAAGrG,CAAC,CAAC8B,KAAK,CACxC,CACEoE,iCAAiC,EACjChC,mCAAmC,EACnCD,8BAA8B,EAC9BgC,+BAA+B,CAChC,EACD;EACEK,WAAW,EAAE;AACf,CACF,CAAC"}
1
+ {"version":3,"names":["UnixTime","JWK","z","TrustMark","object","id","string","trust_mark","RelyingPartyMetadata","application_type","optional","client_id","client_name","jwks","keys","array","contacts","CredentialDisplayMetadata","name","locale","logo","url","alt_text","background_color","text_color","CredentialIssuerDisplayMetadata","ClaimsMetadata","record","value_type","display","IssuanceErrorSupported","title","description","SupportedCredentialMetadata","format","union","literal","scope","claims","cryptographic_binding_methods_supported","credential_signing_alg_values_supported","authentic_source","issuance_errors_supported","EntityStatement","header","typ","alg","kid","payload","iss","sub","trust_marks","iat","number","exp","EntityConfigurationHeader","FederationEntityMetadata","federation_fetch_endpoint","federation_list_endpoint","federation_resolve_endpoint","federation_trust_mark_status_endpoint","federation_trust_mark_list_endpoint","organization_name","homepage_uri","policy_uri","logo_uri","passthrough","BaseEntityConfiguration","authority_hints","metadata","federation_entity","TrustAnchorEntityConfiguration","CredentialIssuerEntityConfiguration","and","openid_credential_issuer","credential_issuer","credential_endpoint","revocation_endpoint","status_attestation_endpoint","credential_configurations_supported","oauth_authorization_server","authorization_endpoint","pushed_authorization_request_endpoint","dpop_signing_alg_values_supported","token_endpoint","introspection_endpoint","client_registration_types_supported","code_challenge_methods_supported","authorization_details_types_supported","acr_values_supported","grant_types_supported","issuer","scopes_supported","request_parameter_supported","boolean","request_uri_parameter_supported","response_types_supported","response_modes_supported","subject_types_supported","token_endpoint_auth_methods_supported","token_endpoint_auth_signing_alg_values_supported","request_object_signing_alg_values_supported","wallet_relying_party","RelyingPartyEntityConfiguration","WalletProviderEntityConfiguration","wallet_provider","aal_values_supported","EntityConfiguration"],"sourceRoot":"../../../src","sources":["trust/types.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,GAAG,QAAQ,cAAc;AAClC,OAAO,KAAKC,CAAC,MAAM,KAAK;AAExB,OAAO,MAAMC,SAAS,GAAGD,CAAC,CAACE,MAAM,CAAC;EAAEC,EAAE,EAAEH,CAAC,CAACI,MAAM,CAAC,CAAC;EAAEC,UAAU,EAAEL,CAAC,CAACI,MAAM,CAAC;AAAE,CAAC,CAAC;AAG7E,MAAME,oBAAoB,GAAGN,CAAC,CAACE,MAAM,CAAC;EACpCK,gBAAgB,EAAEP,CAAC,CAACI,MAAM,CA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AAM,CAAC;IAChBiE,QAAQ,EAAEnE,CAAC,CAACE,MAAM,CAAC;MACjBqG,eAAe,EAAEvG,CAAC,CACfE,MAAM,CAAC;QACNgF,cAAc,EAAElF,CAAC,CAACI,MAAM,CAAC,CAAC;QAC1BoG,oBAAoB,EAAExG,CAAC,CAACa,KAAK,CAACb,CAAC,CAACI,MAAM,CAAC,CAAC,CAAC,CAACI,QAAQ,CAAC,CAAC;QACpDgF,qBAAqB,EAAExF,CAAC,CAACa,KAAK,CAACb,CAAC,CAACI,MAAM,CAAC,CAAC,CAAC;QAC1C6F,qCAAqC,EAAEjG,CAAC,CAACa,KAAK,CAACb,CAAC,CAACI,MAAM,CAAC,CAAC,CAAC;QAC1D8F,gDAAgD,EAAElG,CAAC,CAACa,KAAK,CACvDb,CAAC,CAACI,MAAM,CAAC,CACX,CAAC;QACDO,IAAI,EAAEX,CAAC,CAACE,MAAM,CAAC;UAAEU,IAAI,EAAEZ,CAAC,CAACa,KAAK,CAACd,GAAG;QAAE,CAAC;MACvC,CAAC,CAAC,CACDiE,WAAW,CAAC;IACjB,CAAC;EACH,CAAC;AACH,CAAC,CACH,CAAC;;AAED;;AAEA,OAAO,MAAMyC,mBAAmB,GAAGzG,CAAC,CAACiC,KAAK,CACxC,CACEqE,iCAAiC,EACjChC,mCAAmC,EACnCD,8BAA8B,EAC9BgC,+BAA+B,CAChC,EACD;EACEvE,WAAW,EAAE;AACf,CACF,CAAC"}
@@ -52,12 +52,15 @@ export class UnexpectedStatusCodeError extends IoWalletError {
52
52
 
53
53
  /** HTTP status code */
54
54
 
55
- constructor(message, statusCode) {
55
+ /** The stringified response body, useful to process the error response */
56
+
57
+ constructor(message, statusCode, responseBody) {
56
58
  super(serializeAttrs({
57
59
  message,
58
60
  statusCode: statusCode.toString()
59
61
  }));
60
62
  this.statusCode = statusCode;
63
+ this.responseBody = responseBody;
61
64
  }
62
65
  }
63
66
  /**
@@ -423,19 +426,26 @@ export class OperationAbortedError extends IoWalletError {
423
426
  }
424
427
 
425
428
  /**
426
- * Error subclass thrown when the status attestation for a credential is invalid.
429
+ * Error subclass thrown when a credential status is invalid, either during issuance or when requesting a status attestation.
427
430
  */
428
- export class StatusAttestationInvalid extends IoWalletError {
431
+ export class CredentialInvalidStatusError extends IoWalletError {
429
432
  static get code() {
430
- return "ERR_STATUS_ATTESTATION_INVALID";
433
+ return "ERR_CREDENTIAL_INVALID_STATUS";
431
434
  }
432
- code = "ERR_STATUS_ATTESTATION_INVALID";
433
- constructor(message) {
434
- let reason = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "unspecified";
435
+ code = "ERR_CREDENTIAL_INVALID_STATUS";
436
+
437
+ /**
438
+ * The error code that should be mapped with one of the `issuance_errors_supported` in the EC.
439
+ */
440
+
441
+ constructor(message, errorCode) {
442
+ let reason = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "unspecified";
435
443
  super(serializeAttrs({
436
444
  message,
445
+ errorCode,
437
446
  reason
438
447
  }));
448
+ this.errorCode = errorCode;
439
449
  this.reason = reason;
440
450
  }
441
451
  }
@@ -458,24 +468,6 @@ export class StatusAttestationError extends IoWalletError {
458
468
  }
459
469
  }
460
470
 
461
- /**
462
- * Error subclass thrown when the the user is not entitled to receive the requested credential.
463
- */
464
- export class CredentialNotEntitledError extends IoWalletError {
465
- static get code() {
466
- return "CREDENTIAL_NOT_ENTITLED_ERROR";
467
- }
468
- code = "CREDENTIAL_NOT_ENTITLED_ERROR";
469
- constructor(message) {
470
- let reason = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "unspecified";
471
- super(serializeAttrs({
472
- message,
473
- reason
474
- }));
475
- this.reason = reason;
476
- }
477
- }
478
-
479
471
  /**
480
472
  * Error subclass thrown when an error occurs while requesting a credential.
481
473
  */
@@ -511,4 +503,39 @@ export class CredentialIssuingNotSynchronousError extends IoWalletError {
511
503
  this.reason = reason;
512
504
  }
513
505
  }
506
+ /**
507
+ * Function to extract the error message from the Entity Configuration's supported error codes.
508
+ * @param errorCode The error code to map to a meaningful message
509
+ * @param params.issuerConf The entity configuration for credentials
510
+ * @param params.credentialType The type of credential the error belongs to
511
+ * @returns A localized error {@link LocalizedIssuanceError} or undefined
512
+ * @throws {Error} When no credential config is found
513
+ */
514
+ export function extractErrorMessageFromIssuerConf(errorCode, _ref2) {
515
+ let {
516
+ issuerConf,
517
+ credentialType
518
+ } = _ref2;
519
+ const credentialConfiguration = issuerConf.openid_credential_issuer.credential_configurations_supported[credentialType];
520
+ if (!credentialConfiguration) {
521
+ throw new Error(`No configuration found for ${credentialType} in the provided EC`);
522
+ }
523
+ const {
524
+ issuance_errors_supported
525
+ } = credentialConfiguration;
526
+ if (!(issuance_errors_supported !== null && issuance_errors_supported !== void 0 && issuance_errors_supported[errorCode])) {
527
+ return undefined;
528
+ }
529
+ const localesList = issuance_errors_supported[errorCode].display;
530
+ return localesList.reduce((acc, _ref3) => {
531
+ let {
532
+ locale,
533
+ ...rest
534
+ } = _ref3;
535
+ return {
536
+ ...acc,
537
+ [locale]: rest
538
+ };
539
+ }, {});
540
+ }
514
541
  //# sourceMappingURL=errors.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["serializeAttrs","attrs","Object","entries","map","_ref","k","v","Array","isArray","join","_","IoWalletError","Error","code","constructor","message","_Error$captureStackTr","name","captureStackTrace","call","UnexpectedStatusCodeError","statusCode","toString","ValidationFailed","claim","arguments","length","undefined","reason","WalletInstanceAttestationIssuingError","AuthRequestDecodeError","PidIssuingError","ClaimsNotFoundBetweenDislosures","claims","c","ClaimsNotFoundInToken","NoSuitableKeysFoundInEntityConfiguration","scenario","PidMetadataError","WalletProviderResponseError","WalletInstanceRevokedError","WalletInstanceNotFoundError","WalletInstanceIntegrityFailedError","WalletInstanceCreationError","WalletInstanceCreationIntegrityError","AuthorizationError","AuthorizationIdpError","error","errorDescription","OperationAbortedError","operation","StatusAttestationInvalid","StatusAttestationError","CredentialNotEntitledError","CredentialRequestError","CredentialIssuingNotSynchronousError"],"sourceRoot":"../../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ACC,OAAe,EAAkC;IAAA,IAAhCa,MAAc,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,aAAa;IACzD,KAAK,CAAC1B,cAAc,CAAC;MAAEgB,OAAO;MAAEa;IAAO,CAAC,CAAC,CAAC;IAC1C,IAAI,CAACA,MAAM,GAAGA,MAAM;EACtB;AACF"}
1
+ {"version":3,"names":["serializeAttrs","attrs","Object","entries","map","_ref","k","v","Array","isArray","join","_","IoWalletError","Error","code","constructor","message","_Error$captureStackTr","name","captureStackTrace","call","UnexpectedStatusCodeError","statusCode","responseBody","toString","ValidationFailed","claim","arguments","length","undefined","reason","WalletInstanceAttestationIssuingError","AuthRequestDecodeError","PidIssuingError","ClaimsNotFoundBetweenDislosures","claims","c","ClaimsNotFoundInToken","NoSuitableKeysFoundInEntityConfiguration","scenario","PidMetadataError","WalletProviderResponseError","WalletInstanceRevokedError","WalletInstanceNotFoundError","WalletInstanceIntegrityFailedError","WalletInstanceCreationError","WalletInstanceCreationIntegrityError","AuthorizationError","AuthorizationIdpError","error","errorDescription","OperationAbortedError","operation","CredentialInvalidStatusError","errorCode","StatusAttestationError","CredentialRequestError","CredentialIssuingNotSynchronousError","extractErrorMessageFromIssuerConf","_ref2","issuerConf","credentialType","credentialConfiguration","openid_credential_issuer","credential_configurations_supported","issuance_errors_supported","localesList","display","reduce","acc","_ref3","locale","rest"],"sourceRoot":"../../../src","sources":["utils/errors.ts"],"mappings":"AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,cAAc,GACzBC,KAAsC,IAEtCC,MAAM,CAACC,OAAO,CAACF,KAAK,CAAC,CAClBG,GAAG,CAACC,IAAA;EAAA,IAAC,CAACC,CAAC,EAAEC,CAAC,CAAC,GAAAF,IAAA;EAAA,OAAK,CAACC,CAAC,EAAEE,KAAK,CAACC,OAAO,CAACF,CAAC,CAAC,GAAI,IAAGA,CAAC,CAACG,IAAI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EA,MAAM;IAAEI;EAA0B,CAAC,GAAGH,uBAAuB;EAE7D,IAAI,EAACG,yBAAyB,aAAzBA,yBAAyB,eAAzBA,yBAAyB,CAAGX,SAAS,CAAC,GAAE;IAC3C,OAAOzB,SAAS;EAClB;EAEA,MAAMqC,WAAW,GAAGD,yBAAyB,CAACX,SAAS,CAAC,CAAEa,OAAO;EAEjE,OAAOD,WAAW,CAACE,MAAM,CACvB,CAACC,GAAG,EAAAC,KAAA;IAAA,IAAE;MAAEC,MAAM;MAAE,GAAGC;IAAK,CAAC,GAAAF,KAAA;IAAA,OAAM;MAAE,GAAGD,GAAG;MAAE,CAACE,MAAM,GAAGC;IAAK,CAAC;EAAA,CAAC,EAC1D,CAAC,CACH,CAAC;AACH"}
@@ -9,7 +9,8 @@ import { sha256 } from "js-sha256";
9
9
  */
10
10
  export const hasStatus = status => async res => {
11
11
  if (res.status !== status) {
12
- throw new UnexpectedStatusCodeError(`Http request failed. Expected ${status}, got ${res.status}, url: ${res.url} with response: ${await res.text()}`, res.status);
12
+ const responseBody = await res.text();
13
+ throw new UnexpectedStatusCodeError(`Http request failed. Expected ${status}, got ${res.status}, url: ${res.url} with response: ${responseBody}`, res.status, responseBody);
13
14
  }
14
15
  return res;
15
16
  };
@@ -80,4 +81,11 @@ export const createAbortPromiseFromSignal = signal => {
80
81
  };
81
82
  };
82
83
  export const isDefined = x => Boolean(x);
84
+ export const safeJsonParse = (text, withDefault) => {
85
+ try {
86
+ return JSON.parse(text);
87
+ } catch (_) {
88
+ return withDefault ?? null;
89
+ }
90
+ };
83
91
  //# sourceMappingURL=misc.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["IoWalletError","UnexpectedStatusCodeError","sha256","hasStatus","status","res","url","text","generateRandomAlphaNumericString","size","Array","from","Math","floor","random","toString","join","until","conditionFunction","timeoutSeconds","Promise","resolve","reject","start","Date","now","poll","undefined","Error","setTimeout","getCredentialHashWithouDiscloures","credential","tildeIndex","indexOf","slice","createAbortPromiseFromSignal","signal","listener","listen","aborted","addEventListener","remove","removeEventListener","isDefined","x","Boolean"],"sourceRoot":"../../../src","sources":["utils/misc.ts"],"mappings":"AAAA,SAASA,aAAa,EAAEC,yBAAyB,QAAQ,UAAU;AACnE,SAASC,MAAM,QAAQ,WAAW;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,SAAS,GACnBC,MAAc,IACf,MAAOC,GAAa,IAAwB;EAC1C,IAAIA,GAAG,CAACD,MAAM,KAAKA,MAAM,EAAE;IACzB,MAAM,IAAIH,yBAAyB,CAChC,iCAAgCG,MAAO,SAAQC,GAAG,CAACD,MAAO,UACzDC,GAAG,CAACC,GACL,mBAAkB,MAAMD,GAAG,CAACE,IAAI,CAAC,CAAE,EAAC,EACrCF,GAAG,CAACD,MACN,CAAC;EACH;EACA,OAAOC,GAAG;AACZ,CAAC;;AAEH;AACA;AAOA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMG,gCAAgC,GAAIC,IAAY,IAC3DC,KAAK,CAACC,IAAI,CAACD,KAAK,CAACD,IAAI,CAAC,EAAE,MACtBG,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,CAACC,QAAQ,CAAC,EAAE,CAC5C,CAAC,CAACC,IAAI,CAAC,EAAE,CAAC;;AAEZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,KAAK,GAAGA,CACnBC,iBAAgC,EAChCC,cAAuB,KAEvB,IAAIC,OAAO,CAAO,CAACC,OAAO,EAAEC,MAAM,KAAK;EACrC,MAAMC,KAAK,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC;EACxB,MAAMC,IAAI,GAAGA,CAAA,KAAM;IACjB,IAAIR,iBAAiB,CAAC,CAAC,EAAE;MACvBG,OAAO,CAAC,CAAC;IACX,CAAC,MAAM,IACLF,cAAc,KAAKQ,SAAS,IAC5BH,IAAI,CAACC,GAAG,CAAC,CAAC,GAAGF,KAAK,IAAIJ,cAAc,GAAG,IAAI,EAC3C;MACAG,MAAM,CAAC,IAAIM,KAAK,CAAC,kBAAkB,CAAC,CAAC;IACvC,CAAC,MAAM;MACLC,UAAU,CAACH,IAAI,EAAE,GAAG,CAAC;IACvB;EACF,CAAC;EAEDA,IAAI,CAAC,CAAC;AACR,CAAC,CAAC;;AAEJ;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMI,iCAAiC,GAAG,MAC/CC,UAAkB,IACE;EACpB,MAAMC,UAAU,GAAGD,UAAU,CAACE,OAAO,CAAC,GAAG,CAAC;EAC1C,IAAID,UAAU,KAAK,CAAC,CAAC,EAAE;IACrB,MAAM,IAAIhC,aAAa,CAAC,2BAA2B,CAAC;EACtD;EACA,OAAOE,MAAM,CAAC6B,UAAU,CAACG,KAAK,CAAC,CAAC,EAAEF,UAAU,CAAC,CAAC;AAChD,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMG,4BAA4B,GAAIC,MAAmB,IAAK;EACnE,IAAIC,QAAoB;EACxB,OAAO;IACLC,MAAM,EAAEA,CAAA,KACN,IAAIlB,OAAO,CAAuBC,OAAO,IAAK;MAC5C,IAAIe,MAAM,CAACG,OAAO,EAAE;QAClB,OAAOlB,OAAO,CAAC,mBAAmB,CAAC;MACrC;MACAgB,QAAQ,GAAGA,CAAA,KAAMhB,OAAO,CAAC,mBAAmB,CAAC;MAC7Ce,MAAM,CAACI,gBAAgB,CAAC,OAAO,EAAEH,QAAQ,CAAC;IAC5C,CAAC,CAAC;IACJI,MAAM,EAAEA,CAAA,KAAML,MAAM,CAACM,mBAAmB,CAAC,OAAO,EAAEL,QAAQ;EAC5D,CAAC;AACH,CAAC;AAED,OAAO,MAAMM,SAAS,GAAOC,CAA4B,IACvDC,OAAO,CAACD,CAAC,CAAC"}
1
+ {"version":3,"names":["IoWalletError","UnexpectedStatusCodeError","sha256","hasStatus","status","res","responseBody","text","url","generateRandomAlphaNumericString","size","Array","from","Math","floor","random","toString","join","until","conditionFunction","timeoutSeconds","Promise","resolve","reject","start","Date","now","poll","undefined","Error","setTimeout","getCredentialHashWithouDiscloures","credential","tildeIndex","indexOf","slice","createAbortPromiseFromSignal","signal","listener","listen","aborted","addEventListener","remove","removeEventListener","isDefined","x","Boolean","safeJsonParse","withDefault","JSON","parse","_"],"sourceRoot":"../../../src","sources":["utils/misc.ts"],"mappings":"AAAA,SAASA,aAAa,EAAEC,yBAAyB,QAAQ,UAAU;AACnE,SAASC,MAAM,QAAQ,WAAW;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,SAAS,GACnBC,MAAc,IACf,MAAOC,GAAa,IAAwB;EAC1C,IAAIA,GAAG,CAACD,MAAM,KAAKA,MAAM,EAAE;IACzB,MAAME,YAAY,GAAG,MAAMD,GAAG,CAACE,IAAI,CAAC,CAAC;IACrC,MAAM,IAAIN,yBAAyB,CAChC,iCAAgCG,MAAO,SAAQC,GAAG,CAACD,MAAO,UAASC,GAAG,CAACG,GAAI,mBAAkBF,YAAa,EAAC,EAC5GD,GAAG,CAACD,MAAM,EACVE,YACF,CAAC;EACH;EACA,OAAOD,GAAG;AACZ,CAAC;;AAEH;AACA;AAOA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMI,gCAAgC,GAAIC,IAAY,IAC3DC,KAAK,CAACC,IAAI,CAACD,KAAK,CAACD,IAAI,CAAC,EAAE,MACtBG,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,CAACC,QAAQ,CAAC,EAAE,CAC5C,CAAC,CAACC,IAAI,CAAC,EAAE,CAAC;;AAEZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,KAAK,GAAGA,CACnBC,iBAAgC,EAChCC,cAAuB,KAEvB,IAAIC,OAAO,CAAO,CAACC,OAAO,EAAEC,MAAM,KAAK;EACrC,MAAMC,KAAK,GAAGC,IAAI,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AEL,QAAQ;EAC5D,CAAC;AACH,CAAC;AAED,OAAO,MAAMM,SAAS,GAAOC,CAA4B,IACvDC,OAAO,CAACD,CAAC,CAAC;AAEZ,OAAO,MAAME,aAAa,GAAGA,CAAIxC,IAAY,EAAEyC,WAAe,KAAe;EAC3E,IAAI;IACF,OAAOC,IAAI,CAACC,KAAK,CAAC3C,IAAI,CAAC;EACzB,CAAC,CAAC,OAAO4C,CAAC,EAAE;IACV,OAAOH,WAAW,IAAI,IAAI;EAC5B;AACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"06-obtain-credential.d.ts","sourceRoot":"","sources":["../../../../src/credential/issuance/06-obtain-credential.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAa,KAAK,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAQ5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAK7C,MAAM,MAAM,gBAAgB,GAAG,CAC7B,UAAU,EAAE,GAAG,CAAC,mBAAmB,CAAC,CAAC,YAAY,CAAC,EAClD,WAAW,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC,aAAa,CAAC,EAChD,QAAQ,EAAE,GAAG,CAAC,sBAAsB,CAAC,CAAC,UAAU,CAAC,EACjD,oBAAoB,EAAE,GAAG,CAAC,sBAAsB,CAAC,CAAC,sBAAsB,CAAC,EACzE,OAAO,EAAE;IACP,iBAAiB,EAAE,aAAa,CAAC;IACjC,uBAAuB,EAAE,aAAa,CAAC;IACvC,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CACjC,KACE,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAEjC,eAAO,MAAM,gBAAgB,UACpB,MAAM,UACL,MAAM,YACJ,MAAM,OACX,aAAa,KACjB,QAAQ,MAAM,CAehB,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,gBAAgB,EAAE,gBAkF9B,CAAC"}
1
+ {"version":3,"file":"06-obtain-credential.d.ts","sourceRoot":"","sources":["../../../../src/credential/issuance/06-obtain-credential.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAA4B,KAAK,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAQ5E,OAAO,EAAqC,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAKhF,MAAM,MAAM,gBAAgB,GAAG,CAC7B,UAAU,EAAE,GAAG,CAAC,mBAAmB,CAAC,CAAC,YAAY,CAAC,EAClD,WAAW,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC,aAAa,CAAC,EAChD,QAAQ,EAAE,GAAG,CAAC,sBAAsB,CAAC,CAAC,UAAU,CAAC,EACjD,oBAAoB,EAAE,GAAG,CAAC,sBAAsB,CAAC,CAAC,sBAAsB,CAAC,EACzE,OAAO,EAAE;IACP,iBAAiB,EAAE,aAAa,CAAC;IACjC,uBAAuB,EAAE,aAAa,CAAC;IACvC,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CACjC,KACE,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAEjC,eAAO,MAAM,gBAAgB,UACpB,MAAM,UACL,MAAM,YACJ,MAAM,OACX,aAAa,KACjB,QAAQ,MAAM,CAehB,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,gBAAgB,EAAE,gBAkF9B,CAAC"}
@@ -70,4 +70,12 @@ export declare const ResponseUriResultShape: z.ZodObject<{
70
70
  redirect_uri: string;
71
71
  }>;
72
72
  export type ResponseMode = "query" | "form_post.jwt";
73
+ export declare const CredentialIssuanceFailureResponse: z.ZodObject<{
74
+ error: z.ZodString;
75
+ }, "strip", z.ZodTypeAny, {
76
+ error: string;
77
+ }, {
78
+ error: string;
79
+ }>;
80
+ export type CredentialIssuanceFailureResponse = z.infer<typeof CredentialIssuanceFailureResponse>;
73
81
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/credential/issuance/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAE1D,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOxB,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEpE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;EAK7B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;EAEjC,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,eAAe,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/credential/issuance/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAE1D,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOxB,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEpE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;EAK7B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;EAEjC,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,eAAe,CAAC;AAErD,eAAO,MAAM,iCAAiC;;;;;;EAE5C,CAAC;AAEH,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CACrD,OAAO,iCAAiC,CACzC,CAAC"}
@@ -12,7 +12,7 @@ export type StatusAttestation = (issuerConf: Out<EvaluateIssuerTrust>["issuerCon
12
12
  * @param credential - The credential to be verified
13
13
  * @param credentialCryptoContext - The credential's crypto context
14
14
  * @param context.appFetch (optional) fetch api implementation. Default: built-in fetch
15
- * @throws {@link StatusAttestationInvalid} if the status attestation is invalid and thus the credential is not valid
15
+ * @throws {@link CredentialInvalidStatusError} if the status attestation is invalid and thus the credential is not valid
16
16
  * @throws {@link StatusAttestationError} if an error occurs during the status attestation
17
17
  * @returns The credential status attestation
18
18
  */
@@ -1 +1 @@
1
- {"version":3,"file":"02-status-attestation.d.ts","sourceRoot":"","sources":["../../../../src/credential/status/02-status-attestation.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,GAAG,EACT,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACzE,OAAO,EAAW,KAAK,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE1E,OAAO,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAOpD,MAAM,MAAM,iBAAiB,GAAG,CAC9B,UAAU,EAAE,GAAG,CAAC,mBAAmB,CAAC,CAAC,YAAY,CAAC,EAClD,UAAU,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC,YAAY,CAAC,EAC/C,uBAAuB,EAAE,aAAa,EACtC,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,KAC5B,OAAO,CAAC;IACX,iBAAiB,EAAE,yBAAyB,CAAC,oBAAoB,CAAC,CAAC;CACpE,CAAC,CAAC;AAEH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,EAAE,iBA2C/B,CAAC"}
1
+ {"version":3,"file":"02-status-attestation.d.ts","sourceRoot":"","sources":["../../../../src/credential/status/02-status-attestation.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,GAAG,EACT,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACzE,OAAO,EAAW,KAAK,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE1E,OAAO,EAEL,yBAAyB,EAC1B,MAAM,SAAS,CAAC;AAOjB,MAAM,MAAM,iBAAiB,GAAG,CAC9B,UAAU,EAAE,GAAG,CAAC,mBAAmB,CAAC,CAAC,YAAY,CAAC,EAClD,UAAU,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC,YAAY,CAAC,EAC/C,uBAAuB,EAAE,aAAa,EACtC,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,KAC5B,OAAO,CAAC;IACX,iBAAiB,EAAE,yBAAyB,CAAC,oBAAoB,CAAC,CAAC;CACpE,CAAC,CAAC;AAEH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,EAAE,iBA2C/B,CAAC"}
@@ -302,4 +302,19 @@ export declare const ParsedStatusAttestation: z.ZodObject<{
302
302
  credential_hash: string;
303
303
  };
304
304
  }>;
305
+ /**
306
+ * Shape from parsing a status attestation response in case of error.
307
+ */
308
+ export declare const InvalidStatusAttestationResponse: z.ZodObject<{
309
+ error: z.ZodString;
310
+ }, "strip", z.ZodTypeAny, {
311
+ error: string;
312
+ }, {
313
+ error: string;
314
+ }>;
315
+ /**
316
+ * Type from parsing a status attestation response in case of error.
317
+ * Inferred from {@link InvalidStatusAttestationResponse}.
318
+ */
319
+ export type InvalidStatusAttestationResponse = z.infer<typeof InvalidStatusAttestationResponse>;
305
320
  //# sourceMappingURL=types.d.ts.map