@pagopa/io-react-native-wallet 0.24.0 → 0.25.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (192) hide show
  1. package/lib/commonjs/client/generated/wallet-provider.js +39 -16
  2. package/lib/commonjs/client/generated/wallet-provider.js.map +1 -1
  3. package/lib/commonjs/client/index.js +25 -10
  4. package/lib/commonjs/client/index.js.map +1 -1
  5. package/lib/commonjs/credential/issuance/03-start-user-authorization.js +1 -1
  6. package/lib/commonjs/credential/issuance/04-complete-user-authorization.js +21 -14
  7. package/lib/commonjs/credential/issuance/04-complete-user-authorization.js.map +1 -1
  8. package/lib/commonjs/credential/issuance/05-authorize-access.js +5 -2
  9. package/lib/commonjs/credential/issuance/05-authorize-access.js.map +1 -1
  10. package/lib/commonjs/credential/issuance/06-obtain-credential.js +26 -17
  11. package/lib/commonjs/credential/issuance/06-obtain-credential.js.map +1 -1
  12. package/lib/commonjs/credential/issuance/README.md +8 -14
  13. package/lib/commonjs/credential/issuance/errors.js +52 -0
  14. package/lib/commonjs/credential/issuance/errors.js.map +1 -0
  15. package/lib/commonjs/credential/issuance/index.js +7 -2
  16. package/lib/commonjs/credential/issuance/index.js.map +1 -1
  17. package/lib/commonjs/credential/issuance/types.js +1 -5
  18. package/lib/commonjs/credential/issuance/types.js.map +1 -1
  19. package/lib/commonjs/credential/presentation/01-start-flow.js +1 -1
  20. package/lib/commonjs/credential/presentation/01-start-flow.js.map +1 -1
  21. package/lib/commonjs/credential/presentation/03-get-request-object.js +2 -2
  22. package/lib/commonjs/credential/presentation/03-get-request-object.js.map +1 -1
  23. package/lib/commonjs/credential/presentation/04-send-authorization-response.js +2 -2
  24. package/lib/commonjs/credential/presentation/04-send-authorization-response.js.map +1 -1
  25. package/lib/commonjs/credential/presentation/errors.js +49 -0
  26. package/lib/commonjs/credential/presentation/errors.js.map +1 -0
  27. package/lib/commonjs/credential/presentation/index.js +5 -0
  28. package/lib/commonjs/credential/presentation/index.js.map +1 -1
  29. package/lib/commonjs/credential/status/02-status-attestation.js +8 -6
  30. package/lib/commonjs/credential/status/02-status-attestation.js.map +1 -1
  31. package/lib/commonjs/credential/status/README.md +5 -2
  32. package/lib/commonjs/credential/status/types.js +1 -14
  33. package/lib/commonjs/credential/status/types.js.map +1 -1
  34. package/lib/commonjs/credential/trustmark/get-credential-trustmark.js +14 -5
  35. package/lib/commonjs/credential/trustmark/get-credential-trustmark.js.map +1 -1
  36. package/lib/commonjs/sd-jwt/errors.js +40 -0
  37. package/lib/commonjs/sd-jwt/errors.js.map +1 -0
  38. package/lib/commonjs/sd-jwt/index.js +8 -4
  39. package/lib/commonjs/sd-jwt/index.js.map +1 -1
  40. package/lib/commonjs/sd-jwt/verifier.js +5 -1
  41. package/lib/commonjs/sd-jwt/verifier.js.map +1 -1
  42. package/lib/commonjs/trust/index.js +2 -2
  43. package/lib/commonjs/trust/index.js.map +1 -1
  44. package/lib/commonjs/utils/decoder.js +3 -1
  45. package/lib/commonjs/utils/decoder.js.map +1 -1
  46. package/lib/commonjs/utils/error-codes.js +51 -0
  47. package/lib/commonjs/utils/error-codes.js.map +1 -0
  48. package/lib/commonjs/utils/errors.js +119 -463
  49. package/lib/commonjs/utils/errors.js.map +1 -1
  50. package/lib/commonjs/utils/misc.js +21 -14
  51. package/lib/commonjs/utils/misc.js.map +1 -1
  52. package/lib/commonjs/utils/par.js +2 -1
  53. package/lib/commonjs/utils/par.js.map +1 -1
  54. package/lib/commonjs/wallet-instance/README.md +26 -5
  55. package/lib/commonjs/wallet-instance/index.js +33 -7
  56. package/lib/commonjs/wallet-instance/index.js.map +1 -1
  57. package/lib/commonjs/wallet-instance-attestation/README.md +8 -2
  58. package/lib/commonjs/wallet-instance-attestation/issuing.js +13 -10
  59. package/lib/commonjs/wallet-instance-attestation/issuing.js.map +1 -1
  60. package/lib/module/client/generated/wallet-provider.js +31 -11
  61. package/lib/module/client/generated/wallet-provider.js.map +1 -1
  62. package/lib/module/client/index.js +22 -8
  63. package/lib/module/client/index.js.map +1 -1
  64. package/lib/module/credential/issuance/03-start-user-authorization.js +1 -1
  65. package/lib/module/credential/issuance/04-complete-user-authorization.js +16 -9
  66. package/lib/module/credential/issuance/04-complete-user-authorization.js.map +1 -1
  67. package/lib/module/credential/issuance/05-authorize-access.js +7 -4
  68. package/lib/module/credential/issuance/05-authorize-access.js.map +1 -1
  69. package/lib/module/credential/issuance/06-obtain-credential.js +29 -20
  70. package/lib/module/credential/issuance/06-obtain-credential.js.map +1 -1
  71. package/lib/module/credential/issuance/README.md +8 -14
  72. package/lib/module/credential/issuance/errors.js +44 -0
  73. package/lib/module/credential/issuance/errors.js.map +1 -0
  74. package/lib/module/credential/issuance/index.js +3 -2
  75. package/lib/module/credential/issuance/index.js.map +1 -1
  76. package/lib/module/credential/issuance/types.js +0 -3
  77. package/lib/module/credential/issuance/types.js.map +1 -1
  78. package/lib/module/credential/presentation/01-start-flow.js +1 -1
  79. package/lib/module/credential/presentation/01-start-flow.js.map +1 -1
  80. package/lib/module/credential/presentation/03-get-request-object.js +3 -3
  81. package/lib/module/credential/presentation/03-get-request-object.js.map +1 -1
  82. package/lib/module/credential/presentation/04-send-authorization-response.js +3 -3
  83. package/lib/module/credential/presentation/04-send-authorization-response.js.map +1 -1
  84. package/lib/module/credential/presentation/errors.js +42 -0
  85. package/lib/module/credential/presentation/errors.js.map +1 -0
  86. package/lib/module/credential/presentation/index.js +2 -1
  87. package/lib/module/credential/presentation/index.js.map +1 -1
  88. package/lib/module/credential/status/02-status-attestation.js +11 -9
  89. package/lib/module/credential/status/02-status-attestation.js.map +1 -1
  90. package/lib/module/credential/status/README.md +5 -2
  91. package/lib/module/credential/status/types.js +0 -12
  92. package/lib/module/credential/status/types.js.map +1 -1
  93. package/lib/module/credential/trustmark/get-credential-trustmark.js +14 -5
  94. package/lib/module/credential/trustmark/get-credential-trustmark.js.map +1 -1
  95. package/lib/module/sd-jwt/errors.js +32 -0
  96. package/lib/module/sd-jwt/errors.js.map +1 -0
  97. package/lib/module/sd-jwt/index.js +5 -5
  98. package/lib/module/sd-jwt/index.js.map +1 -1
  99. package/lib/module/sd-jwt/verifier.js +5 -1
  100. package/lib/module/sd-jwt/verifier.js.map +1 -1
  101. package/lib/module/trust/index.js +3 -3
  102. package/lib/module/trust/index.js.map +1 -1
  103. package/lib/module/utils/decoder.js +3 -1
  104. package/lib/module/utils/decoder.js.map +1 -1
  105. package/lib/module/utils/error-codes.js +43 -0
  106. package/lib/module/utils/error-codes.js.map +1 -0
  107. package/lib/module/utils/errors.js +98 -438
  108. package/lib/module/utils/errors.js.map +1 -1
  109. package/lib/module/utils/misc.js +18 -11
  110. package/lib/module/utils/misc.js.map +1 -1
  111. package/lib/module/utils/par.js +3 -2
  112. package/lib/module/utils/par.js.map +1 -1
  113. package/lib/module/wallet-instance/README.md +26 -5
  114. package/lib/module/wallet-instance/index.js +32 -7
  115. package/lib/module/wallet-instance/index.js.map +1 -1
  116. package/lib/module/wallet-instance-attestation/README.md +8 -2
  117. package/lib/module/wallet-instance-attestation/issuing.js +15 -12
  118. package/lib/module/wallet-instance-attestation/issuing.js.map +1 -1
  119. package/lib/typescript/client/generated/wallet-provider.d.ts +138 -27
  120. package/lib/typescript/client/generated/wallet-provider.d.ts.map +1 -1
  121. package/lib/typescript/client/index.d.ts +7 -1
  122. package/lib/typescript/client/index.d.ts.map +1 -1
  123. package/lib/typescript/credential/issuance/03-start-user-authorization.d.ts +1 -1
  124. package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts +1 -1
  125. package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts.map +1 -1
  126. package/lib/typescript/credential/issuance/05-authorize-access.d.ts.map +1 -1
  127. package/lib/typescript/credential/issuance/06-obtain-credential.d.ts.map +1 -1
  128. package/lib/typescript/credential/issuance/errors.d.ts +28 -0
  129. package/lib/typescript/credential/issuance/errors.d.ts.map +1 -0
  130. package/lib/typescript/credential/issuance/index.d.ts +3 -2
  131. package/lib/typescript/credential/issuance/index.d.ts.map +1 -1
  132. package/lib/typescript/credential/issuance/types.d.ts +0 -8
  133. package/lib/typescript/credential/issuance/types.d.ts.map +1 -1
  134. package/lib/typescript/credential/presentation/03-get-request-object.d.ts.map +1 -1
  135. package/lib/typescript/credential/presentation/04-send-authorization-response.d.ts.map +1 -1
  136. package/lib/typescript/credential/presentation/errors.d.ts +25 -0
  137. package/lib/typescript/credential/presentation/errors.d.ts.map +1 -0
  138. package/lib/typescript/credential/presentation/index.d.ts +2 -1
  139. package/lib/typescript/credential/presentation/index.d.ts.map +1 -1
  140. package/lib/typescript/credential/status/02-status-attestation.d.ts.map +1 -1
  141. package/lib/typescript/credential/status/types.d.ts +0 -15
  142. package/lib/typescript/credential/status/types.d.ts.map +1 -1
  143. package/lib/typescript/credential/trustmark/get-credential-trustmark.d.ts +4 -2
  144. package/lib/typescript/credential/trustmark/get-credential-trustmark.d.ts.map +1 -1
  145. package/lib/typescript/sd-jwt/errors.d.ts +20 -0
  146. package/lib/typescript/sd-jwt/errors.d.ts.map +1 -0
  147. package/lib/typescript/sd-jwt/index.d.ts +3 -2
  148. package/lib/typescript/sd-jwt/index.d.ts.map +1 -1
  149. package/lib/typescript/utils/error-codes.d.ts +45 -0
  150. package/lib/typescript/utils/error-codes.d.ts.map +1 -0
  151. package/lib/typescript/utils/errors.d.ts +88 -225
  152. package/lib/typescript/utils/errors.d.ts.map +1 -1
  153. package/lib/typescript/utils/misc.d.ts +9 -4
  154. package/lib/typescript/utils/misc.d.ts.map +1 -1
  155. package/lib/typescript/utils/par.d.ts.map +1 -1
  156. package/lib/typescript/wallet-instance/index.d.ts +17 -1
  157. package/lib/typescript/wallet-instance/index.d.ts.map +1 -1
  158. package/lib/typescript/wallet-instance-attestation/issuing.d.ts.map +1 -1
  159. package/lib/typescript/wallet-instance-attestation/types.d.ts +4 -4
  160. package/package.json +1 -1
  161. package/src/client/generated/wallet-provider.ts +43 -13
  162. package/src/client/index.ts +28 -15
  163. package/src/credential/issuance/03-start-user-authorization.ts +1 -1
  164. package/src/credential/issuance/04-complete-user-authorization.ts +21 -21
  165. package/src/credential/issuance/05-authorize-access.ts +7 -4
  166. package/src/credential/issuance/06-obtain-credential.ts +39 -39
  167. package/src/credential/issuance/README.md +8 -14
  168. package/src/credential/issuance/errors.ts +44 -0
  169. package/src/credential/issuance/index.ts +4 -2
  170. package/src/credential/issuance/types.ts +0 -8
  171. package/src/credential/presentation/01-start-flow.ts +1 -1
  172. package/src/credential/presentation/03-get-request-object.ts +3 -3
  173. package/src/credential/presentation/04-send-authorization-response.ts +3 -3
  174. package/src/credential/presentation/errors.ts +41 -0
  175. package/src/credential/presentation/index.ts +2 -0
  176. package/src/credential/status/02-status-attestation.ts +17 -25
  177. package/src/credential/status/README.md +5 -2
  178. package/src/credential/status/types.ts +0 -15
  179. package/src/credential/trustmark/get-credential-trustmark.ts +13 -4
  180. package/src/sd-jwt/errors.ts +39 -0
  181. package/src/sd-jwt/index.ts +5 -8
  182. package/src/sd-jwt/verifier.ts +5 -5
  183. package/src/trust/index.ts +3 -3
  184. package/src/utils/decoder.ts +3 -3
  185. package/src/utils/error-codes.ts +50 -0
  186. package/src/utils/errors.ts +152 -476
  187. package/src/utils/misc.ts +20 -17
  188. package/src/utils/par.ts +3 -2
  189. package/src/wallet-instance/README.md +26 -5
  190. package/src/wallet-instance/index.ts +40 -18
  191. package/src/wallet-instance-attestation/README.md +8 -2
  192. package/src/wallet-instance-attestation/issuing.ts +28 -36
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.Errors = void 0;
6
7
  Object.defineProperty(exports, "authorizeAccess", {
7
8
  enumerable: true,
8
9
  get: function () {
@@ -39,10 +40,10 @@ Object.defineProperty(exports, "obtainCredential", {
39
40
  return _obtainCredential.obtainCredential;
40
41
  }
41
42
  });
42
- Object.defineProperty(exports, "parseAuthroizationResponse", {
43
+ Object.defineProperty(exports, "parseAuthorizationResponse", {
43
44
  enumerable: true,
44
45
  get: function () {
45
- return _completeUserAuthorization.parseAuthroizationResponse;
46
+ return _completeUserAuthorization.parseAuthorizationResponse;
46
47
  }
47
48
  });
48
49
  Object.defineProperty(exports, "startUserAuthorization", {
@@ -63,4 +64,8 @@ var _completeUserAuthorization = require("./04-complete-user-authorization");
63
64
  var _authorizeAccess = require("./05-authorize-access");
64
65
  var _obtainCredential = require("./06-obtain-credential");
65
66
  var _verifyAndParseCredential = require("./07-verify-and-parse-credential");
67
+ var Errors = _interopRequireWildcard(require("./errors"));
68
+ exports.Errors = Errors;
69
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
70
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
66
71
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_evaluateIssuerTrust","require","_startUserAuthorization","_completeUserAuthorization","_authorizeAccess","_obtainCredential","_verifyAndParseCredential"],"sourceRoot":"../../../../src","sources":["credential/issuance/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,oBAAA,GAAAC,OAAA;AAIA,IAAAC,uBAAA,GAAAD,OAAA;AAIA,IAAAE,0BAAA,GAAAF,OAAA;AASA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AAIA,IAAAK,yBAAA,GAAAL,OAAA"}
1
+ {"version":3,"names":["_evaluateIssuerTrust","require","_startUserAuthorization","_completeUserAuthorization","_authorizeAccess","_obtainCredential","_verifyAndParseCredential","Errors","_interopRequireWildcard","exports","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set"],"sourceRoot":"../../../../src","sources":["credential/issuance/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,oBAAA,GAAAC,OAAA;AAIA,IAAAC,uBAAA,GAAAD,OAAA;AAIA,IAAAE,0BAAA,GAAAF,OAAA;AASA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AAIA,IAAAK,yBAAA,GAAAL,OAAA;AAIA,IAAAM,MAAA,GAAAC,uBAAA,CAAAP,OAAA;AAAmCQ,OAAA,CAAAF,MAAA,GAAAA,MAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAH,wBAAAO,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA"}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.TokenResponse = exports.ResponseUriResultShape = exports.CredentialResponse = exports.CredentialIssuanceFailureResponse = void 0;
6
+ exports.TokenResponse = exports.ResponseUriResultShape = exports.CredentialResponse = void 0;
7
7
  var _par = require("../../utils/par");
8
8
  var z = _interopRequireWildcard(require("zod"));
9
9
  var _const = require("./const");
@@ -33,8 +33,4 @@ const ResponseUriResultShape = z.object({
33
33
  redirect_uri: z.string()
34
34
  });
35
35
  exports.ResponseUriResultShape = ResponseUriResultShape;
36
- const CredentialIssuanceFailureResponse = z.object({
37
- error: z.string()
38
- });
39
- exports.CredentialIssuanceFailureResponse = CredentialIssuanceFailureResponse;
40
36
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_par","require","z","_interopRequireWildcard","_const","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","TokenResponse","object","access_token","string","authorization_details","array","AuthorizationDetail","c_nonce","c_nonce_expires_in","number","expires_in","token_type","exports","CredentialResponse","credential","format","SupportedCredentialFormat","ResponseUriResultShape","redirect_uri","CredentialIssuanceFailureResponse","error"],"sourceRoot":"../../../../src","sources":["credential/issuance/types.ts"],"mappings":";;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,CAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAAoD,SAAAI,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAH,wBAAAO,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IA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AME,iCAAiC,GAAG5C,CAAC,CAAC0B,MAAM,CAAC;EACxDmB,KAAK,EAAE7C,CAAC,CAAC4B,MAAM,CAAC;AAClB,CAAC,CAAC;AAACS,OAAA,CAAAO,iCAAA,GAAAA,iCAAA"}
1
+ {"version":3,"names":["_par","require","z","_interopRequireWildcard","_const","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","TokenResponse","object","access_token","string","authorization_details","array","AuthorizationDetail","c_nonce","c_nonce_expires_in","number","expires_in","token_type","exports","CredentialResponse","credential","format","SupportedCredentialFormat","ResponseUriResultShape","redirect_uri"],"sourceRoot":"../../../../src","sources":["credential/issuance/types.ts"],"mappings":";;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,CAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAAoD,SAAAI,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAH,wBAAAO,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GA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CAAAC,kBAAA,GAAAA,kBAAA;AAGO,MAAMI,sBAAsB,GAAG1C,CAAC,CAAC0B,MAAM,CAAC;EAC7CiB,YAAY,EAAE3C,CAAC,CAAC4B,MAAM,CAAC;AACzB,CAAC,CAAC;AAACS,OAAA,CAAAK,sBAAA,GAAAA,sBAAA"}
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.startFlowFromQR = void 0;
7
7
  var z = _interopRequireWildcard(require("zod"));
8
8
  var _ioReactNativeJwt = require("@pagopa/io-react-native-jwt");
9
- var _errors = require("../../utils/errors");
9
+ var _errors = require("./errors");
10
10
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
11
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
12
12
  const QRCodePayload = z.object({
@@ -1 +1 @@
1
- {"version":3,"names":["z","_interopRequireWildcard","require","_ioReactNativeJwt","_errors","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","QRCodePayload","object","protocol","string","resource","clientId","requestURI","startFlowFromQR","qrcode","decoded","decodeBase64","decodedUrl","URL","hostname","searchParams","result","safeParse","success","data","AuthRequestDecodeError","error","message","exports"],"sourceRoot":"../../../../src","sources":["credential/presentation/01-start-flow.ts"],"mappings":";;;;;;AAAA,IAAAA,CAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAA4D,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAL,wBAAAS,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAA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AACF,CAAC;AAACW,OAAA,CAAAf,eAAA,GAAAA,eAAA"}
1
+ {"version":3,"names":["z","_interopRequireWildcard","require","_ioReactNativeJwt","_errors","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","QRCodePayload","object","protocol","string","resource","clientId","requestURI","startFlowFromQR","qrcode","decoded","decodeBase64","decodedUrl","URL","hostname","searchParams","result","safeParse","success","data","AuthRequestDecodeError","error","message","exports"],"sourceRoot":"../../../../src","sources":["credential/presentation/01-start-flow.ts"],"mappings":";;;;;;AAAA,IAAAA,CAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAAkD,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAL,wBAAAS,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,G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ACrCd,QAAQ;IACRE,QAAQ;IACRE,UAAU;IACVD;EACF,CAAC,CAAC;EAEF,IAAIU,MAAM,CAACE,OAAO,EAAE;IAClB,OAAOF,MAAM,CAACG,IAAI;EACpB,CAAC,MAAM;IACL,MAAM,IAAIC,8BAAsB,CAACJ,MAAM,CAACK,KAAK,CAACC,OAAO,EAAG,GAAEV,UAAW,EAAC,CAAC;EACzE;AACF,CAAC;AAACW,OAAA,CAAAf,eAAA,GAAAA,eAAA"}
@@ -7,7 +7,7 @@ exports.getRequestObject = void 0;
7
7
  var _reactNativeUuid = _interopRequireDefault(require("react-native-uuid"));
8
8
  var _ioReactNativeJwt = require("@pagopa/io-react-native-jwt");
9
9
  var _dpop = require("../../utils/dpop");
10
- var _errors = require("../../utils/errors");
10
+ var _errors = require("./errors");
11
11
  var _misc = require("../../utils/misc");
12
12
  var _types = require("./types");
13
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -40,7 +40,7 @@ const getRequestObject = async (requestUri, rpConf, _ref) => {
40
40
  Authorization: `DPoP ${walletInstanceAttestation}`,
41
41
  DPoP: signedWalletInstanceDPoP
42
42
  }
43
- }).then((0, _misc.hasStatus)(200)).then(res => res.json()).then(responseJson => responseJson.response);
43
+ }).then((0, _misc.hasStatusOrThrow)(200)).then(res => res.json()).then(responseJson => responseJson.response);
44
44
  const responseJwt = (0, _ioReactNativeJwt.decode)(responseEncodedJwt);
45
45
 
46
46
  // verify token signature according to RP's entity configuration
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNativeUuid","_interopRequireDefault","require","_ioReactNativeJwt","_dpop","_errors","_misc","_types","obj","__esModule","default","getRequestObject","requestUri","rpConf","_ref","wiaCryptoContext","appFetch","fetch","walletInstanceAttestation","signedWalletInstanceDPoP","createDPopToken","jti","uuid","v4","htm","htu","ath","sha256ToBase64","responseEncodedJwt","method","headers","Authorization","DPoP","then","hasStatus","res","json","responseJson","response","responseJwt","decodeJwt","pubKey","wallet_relying_party","jwks","keys","find","_ref2","kid","protectedHeader","NoSuitableKeysFoundInEntityConfiguration","verify","requestObject","RequestObject","parse","payload","exports"],"sourceRoot":"../../../../src","sources":["credential/presentation/03-get-request-object.ts"],"mappings":";;;;;;AAAA,IAAAA,gBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AAOA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAEA,IAAAI,KAAA,GAAAJ,OAAA;AAEA,IAAAK,MAAA,GAAAL,OAAA;AAAwC,SAAAD,uBAAAO,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAYxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,gBAAkC,GAAG,MAAAA,CAChDC,UAAU,EACVC,MAAM,EAAAC,IAAA,KAEH;EAAA,IADH;IAAEC,gBAAgB;IAAEC,QAAQ,GAAGC,KAAK;IAAEC;EAA0B,CAAC,GAAAJ,IAAA;EAEjE,MAAMK,wBAAwB,GAAG,MAAM,IAAAC,qBAAe,EACpD;IACEC,GAAG,EAAG,GAAEC,wBAAI,CAACC,EAAE,CAAC,CAAE,EAAC;IACnBC,GAAG,EAAE,KAAK;IACVC,GAAG,EAAEb,UAAU;IACfc,GAAG,EAAE,MAAM,IAAAC,gCAAc,EAACT,yBAAyB;EACrD,CAAC,EACDH,gBACF,CAAC;EAED,MAAMa,kBAAkB,GAAG,MAAMZ,QAAQ,CAACJ,UAAU,EAAE;IACpDiB,MAAM,EAAE,KAAK;IACbC,OAAO,EAAE;MACPC,aAAa,EAAG,QAAOb,yBAA0B,EAAC;MAClDc,IAAI,EAAEb;IACR;EACF,CAAC,CAAC,CACCc,IAAI,CAAC,IAAAC,eAAS,EAAC,GAAG,CAAC,CAAC,CACpBD,IAAI,CAAEE,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC,CAAC,CAAC,CACzBH,IAAI,CAAEI,YAAY,IAAKA,YAAY,CAACC,QAAQ,CAAC;EAEhD,MAAMC,WAAW,GAAG,IAAAC,wBAAS,EAACZ,kBAAkB,CAAC;;EAEjD;EACA;EACA;IACE,MAAMa,MAAM,GAAG5B,MAAM,CAAC6B,oBAAoB,CAACC,IAAI,CAACC,IAAI,CAACC,IAAI,CACvDC,KAAA;MAAA,IAAC;QAAEC;MAAI,CAAC,GAAAD,KAAA;MAAA,OAAKC,GAAG,KAAKR,WAAW,CAACS,eAAe,CAACD,GAAG;IAAA,CACtD,CAAC;IACD,IAAI,CAACN,MAAM,EAAE;MACX,MAAM,IAAIQ,gDAAwC,CAChD,uCACF,CAAC;IACH;IACA,MAAM,IAAAC,wBAAM,EAACtB,kBAAkB,EAAEa,MAAM,CAAC;EAC1C;;EAEA;EACA,MAAMU,aAAa,GAAGC,oBAAa,CAACC,KAAK,CAACd,WAAW,CAACe,OAAO,CAAC;EAE9D,OAAO;IACLH;EACF,CAAC;AACH,CAAC;AAACI,OAAA,CAAA5C,gBAAA,GAAAA,gBAAA"}
1
+ {"version":3,"names":["_reactNativeUuid","_interopRequireDefault","require","_ioReactNativeJwt","_dpop","_errors","_misc","_types","obj","__esModule","default","getRequestObject","requestUri","rpConf","_ref","wiaCryptoContext","appFetch","fetch","walletInstanceAttestation","signedWalletInstanceDPoP","createDPopToken","jti","uuid","v4","htm","htu","ath","sha256ToBase64","responseEncodedJwt","method","headers","Authorization","DPoP","then","hasStatusOrThrow","res","json","responseJson","response","responseJwt","decodeJwt","pubKey","wallet_relying_party","jwks","keys","find","_ref2","kid","protectedHeader","NoSuitableKeysFoundInEntityConfiguration","verify","requestObject","RequestObject","parse","payload","exports"],"sourceRoot":"../../../../src","sources":["credential/presentation/03-get-request-object.ts"],"mappings":";;;;;;AAAA,IAAAA,gBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AAOA,IAAAE,KAA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AAI,CACvDC,KAAA;MAAA,IAAC;QAAEC;MAAI,CAAC,GAAAD,KAAA;MAAA,OAAKC,GAAG,KAAKR,WAAW,CAACS,eAAe,CAACD,GAAG;IAAA,CACtD,CAAC;IACD,IAAI,CAACN,MAAM,EAAE;MACX,MAAM,IAAIQ,gDAAwC,CAChD,uCACF,CAAC;IACH;IACA,MAAM,IAAAC,wBAAM,EAACtB,kBAAkB,EAAEa,MAAM,CAAC;EAC1C;;EAEA;EACA,MAAMU,aAAa,GAAGC,oBAAa,CAACC,KAAK,CAACd,WAAW,CAACe,OAAO,CAAC;EAE9D,OAAO;IACLH;EACF,CAAC;AACH,CAAC;AAACI,OAAA,CAAA5C,gBAAA,GAAAA,gBAAA"}
@@ -7,7 +7,7 @@ exports.sendAuthorizationResponse = exports.AuthorizationResponse = void 0;
7
7
  var _ioReactNativeJwt = require("@pagopa/io-react-native-jwt");
8
8
  var _reactNativeUuid = _interopRequireDefault(require("react-native-uuid"));
9
9
  var WalletInstanceAttestation = _interopRequireWildcard(require("../../wallet-instance-attestation"));
10
- var _errors = require("../../utils/errors");
10
+ var _errors = require("./errors");
11
11
  var _misc = require("../../utils/misc");
12
12
  var _sdJwt = require("../../sd-jwt");
13
13
  var z = _interopRequireWildcard(require("zod"));
@@ -133,7 +133,7 @@ const sendAuthorizationResponse = async (requestObject, rpConf, presentation, _r
133
133
  "Content-Type": "application/x-www-form-urlencoded"
134
134
  },
135
135
  body
136
- }).then((0, _misc.hasStatus)(200)).then(res => res.json()).then(AuthorizationResponse.parse);
136
+ }).then((0, _misc.hasStatusOrThrow)(200)).then(res => res.json()).then(AuthorizationResponse.parse);
137
137
  };
138
138
  exports.sendAuthorizationResponse = sendAuthorizationResponse;
139
139
  //# sourceMappingURL=04-send-authorization-response.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_ioReactNativeJwt","require","_reactNativeUuid","_interopRequireDefault","WalletInstanceAttestation","_interopRequireWildcard","_errors","_misc","_sdJwt","z","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","AuthorizationResponse","object","status","string","response_code","optional","exports","chooseRSAPublicKeyToEncrypt","entity","usingRsa256","wallet_relying_party","jwks","keys","filter","jwk","use","kty","NoSuitableKeysFoundInEntityConfiguration","prepareVpToken","requestObject","walletInstanceAttestation","_ref","vc","claims","cryptoCtx","token","vp","paths","disclose","payload","iss","decode","pidKid","getPublicKey","then","_","kid","vp_token","SignJWT","setProtectedHeader","typ","setPayload","jti","uuid","v4","nonce","setAudience","response_uri","setIssuedAt","setExpirationTime","sign","vc_scope","scope","presentation_submission","definition_id","id","descriptor_map","map","p","path","format","sendAuthorizationResponse","rpConf","presentation","_ref2","appFetch","fetch","rsaPublicJwk","authzResponsePayload","JSON","stringify","state","encrypted","EncryptJwe","alg","enc","encrypt","formBody","URLSearchParams","response","body","toString","method","headers","hasStatus","res","json","parse"],"sourceRoot":"../../../../src","sources":["credential/presentation/04-send-authorization-response.ts"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,yBAAA,GAAAC,uBAAA,CAAAJ,OAAA;AAEA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAEA,IAAAO,MAAA,GAAAP,OAAA;AAGA,IAAAQ,CAAA,GAAAJ,uBAAA,CAAAJ,OAAA;AAAyB,SAAAS,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAN,wBAAAU,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,G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BAAU,CAACL,oBAAoB,EAAE;IAC3DM,GAAG,EAAE,cAAc;IACnBC,GAAG,EAAE,eAAe;IACpBvC,GAAG,EAAE+B,YAAY,CAAC/B;EACpB,CAAC,CAAC,CAACwC,OAAO,CAACT,YAAY,CAAC;EAExB,MAAMU,QAAQ,GAAG,IAAIC,eAAe,CAAC;IAAEC,QAAQ,EAAEP;EAAU,CAAC,CAAC;EAC7D,MAAMQ,IAAI,GAAGH,QAAQ,CAACI,QAAQ,CAAC,CAAC;EAEhC,OAAOhB,QAAQ,CAAC9C,aAAa,CAAC4B,YAAY,EAAE;IAC1CmC,MAAM,EAAE,MAAM;IACdC,OAAO,EAAE;MACP,cAAc,EAAE;IAClB,CAAC;IACDH;EACF,CAAC,CAAC,CACC9C,IAAI,CAAC,IAAAkD,eAAS,EAAC,GAAG,CAAC,CAAC,CACpBlD,IAAI,CAAEmD,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC,CAAC,CAAC,CACzBpD,IAAI,CAAClC,qBAAqB,CAACuF,KAAK,CAAC;AACtC,CAAC;AAACjF,OAAA,CAAAuD,yBAAA,GAAAA,yBAAA"}
1
+ {"version":3,"names":["_ioReactNativeJwt","require","_reactNativeUuid","_interopRequireDefault","WalletInstanceAttestation","_interopRequireWildcard","_errors","_misc","_sdJwt","z","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","AuthorizationResponse","object","status","string","response_code","optional","exports","chooseRSAPublicKeyToEncrypt","entity","usingRsa256","wallet_relying_party","jwks","keys","filter","jwk","use","kty","NoSuitableKeysFoundInEntityConfiguration","prepareVpToken","requestObject","walletInstanceAttestation","_ref","vc","claims","cryptoCtx","token","vp","paths","disclose","payload","iss","decode","pidKid","getPublicKey","then","_","kid","vp_token","SignJWT","setProtectedHeader","typ","setPayload","jti","uuid","v4","nonce","setAudience","response_uri","setIssuedAt","setExpirationTime","sign","vc_scope","scope","presentation_submission","definition_id","id","descriptor_map","map","p","path","format","sendAuthorizationResponse","rpConf","presentation","_ref2","appFetch","fetch","rsaPublicJwk","authzResponsePayload","JSON","stringify","state","encrypted","EncryptJwe","alg","enc","encrypt","formBody","URLSearchParams","response","body","toString","method","headers","hasStatusOrThrow","res","json","parse"],"sourceRoot":"../../../../src","sources":["credential/presentation/04-send-authorization-response.ts"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,yBAAA,GAAAC,uBAAA,CAAAJ,OAAA;AAEA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAEA,IAAAO,MAAA,GAAAP,OAAA;AAGA,IAAAQ,CAAA,GAAAJ,uBAAA,CAAAJ,OAAA;AAAyB,SAAAS,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAN,wBAAAU,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAA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OAAO,EAAE;MACP,cAAc,EAAE;IAClB,CAAC;IACDH;EACF,CAAC,CAAC,CACC9C,IAAI,CAAC,IAAAkD,sBAAgB,EAAC,GAAG,CAAC,CAAC,CAC3BlD,IAAI,CAAEmD,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC,CAAC,CAAC,CACzBpD,IAAI,CAAClC,qBAAqB,CAACuF,KAAK,CAAC;AACtC,CAAC;AAACjF,OAAA,CAAAuD,yBAAA,GAAAA,yBAAA"}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.NoSuitableKeysFoundInEntityConfiguration = exports.AuthRequestDecodeError = void 0;
7
+ var _errors = require("../../utils/errors");
8
+ /**
9
+ * An error subclass thrown when auth request decode fail
10
+ *
11
+ */
12
+ class AuthRequestDecodeError extends _errors.IoWalletError {
13
+ code = "ERR_IO_WALLET_AUTHENTICATION_REQUEST_DECODE_FAILED";
14
+
15
+ /** The Claim for which the validation failed. */
16
+
17
+ /** Reason code for the validation failure. */
18
+
19
+ constructor(message) {
20
+ let claim = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "unspecified";
21
+ let reason = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "unspecified";
22
+ super((0, _errors.serializeAttrs)({
23
+ message,
24
+ claim,
25
+ reason
26
+ }));
27
+ this.claim = claim;
28
+ this.reason = reason;
29
+ }
30
+ }
31
+
32
+ /**
33
+ * When selecting a public key from an entity configuration, and no one meets the requirements for the scenario
34
+ *
35
+ */
36
+ exports.AuthRequestDecodeError = AuthRequestDecodeError;
37
+ class NoSuitableKeysFoundInEntityConfiguration extends _errors.IoWalletError {
38
+ code = "ERR_NO_SUITABLE_KEYS_NOT_FOUND";
39
+
40
+ /**
41
+ * @param scenario describe the scenario in which the error arise
42
+ */
43
+ constructor(scenario) {
44
+ const message = `Entity configuration do not provide any suitable keys (${scenario}).`;
45
+ super(message);
46
+ }
47
+ }
48
+ exports.NoSuitableKeysFoundInEntityConfiguration = NoSuitableKeysFoundInEntityConfiguration;
49
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_errors","require","AuthRequestDecodeError","IoWalletError","code","constructor","message","claim","arguments","length","undefined","reason","serializeAttrs","exports","NoSuitableKeysFoundInEntityConfiguration","scenario"],"sourceRoot":"../../../../src","sources":["credential/presentation/errors.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACO,MAAMC,sBAAsB,SAASC,qBAAa,CAAC;EACxDC,IAAI,GAAG,oDAAoD;;EAE3D;;EAGA;;EAGAC,WAAWA,CACTC,OAAe,EAGf;IAAA,IAFAC,KAAa,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,aAAa;IAAA,IAC7BG,MAAc,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,aAAa;IAE9B,KAAK,CAAC,IAAAI,sBAAc,EAAC;MAAEN,OAAO;MAAEC,KAAK;MAAEI;IAAO,CAAC,CAAC,CAAC;IACjD,IAAI,CAACJ,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACI,MAAM,GAAGA,MAAM;EACtB;AACF;;AAEA;AACA;AACA;AACA;AAHAE,OAAA,CAAAX,sBAAA,GAAAA,sBAAA;AAIO,MAAMY,wCAAwC,SAASX,qBAAa,CAAC;EAC1EC,IAAI,GAAG,gCAAgC;;EAEvC;AACF;AACA;EACEC,WAAWA,CAACU,QAAgB,EAAE;IAC5B,MAAMT,OAAO,GAAI,0DAAyDS,QAAS,IAAG;IACtF,KAAK,CAACT,OAAO,CAAC;EAChB;AACF;AAACO,OAAA,CAAAC,wCAAA,GAAAA,wCAAA"}
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.Errors = void 0;
6
7
  Object.defineProperty(exports, "evaluateRelyingPartyTrust", {
7
8
  enumerable: true,
8
9
  get: function () {
@@ -31,4 +32,8 @@ var _startFlow = require("./01-start-flow");
31
32
  var _evaluateRpTrust = require("./02-evaluate-rp-trust");
32
33
  var _getRequestObject = require("./03-get-request-object");
33
34
  var _sendAuthorizationResponse = require("./04-send-authorization-response");
35
+ var Errors = _interopRequireWildcard(require("./errors"));
36
+ exports.Errors = Errors;
37
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
38
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
34
39
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_startFlow","require","_evaluateRpTrust","_getRequestObject","_sendAuthorizationResponse"],"sourceRoot":"../../../../src","sources":["credential/presentation/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AAIA,IAAAE,iBAAA,GAAAF,OAAA;AAIA,IAAAG,0BAAA,GAAAH,OAAA"}
1
+ {"version":3,"names":["_startFlow","require","_evaluateRpTrust","_getRequestObject","_sendAuthorizationResponse","Errors","_interopRequireWildcard","exports","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set"],"sourceRoot":"../../../../src","sources":["credential/presentation/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AAIA,IAAAE,iBAAA,GAAAF,OAAA;AAIA,IAAAG,0BAAA,GAAAH,OAAA;AAIA,IAAAI,MAAA,GAAAC,uBAAA,CAAAL,OAAA;AAAmCM,OAAA,CAAAF,MAAA,GAAAA,MAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAH,wBAAAO,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA"}
@@ -45,7 +45,7 @@ const statusAttestation = async function (issuerConf, credential, credentialCryp
45
45
  "Content-Type": "application/json"
46
46
  },
47
47
  body: JSON.stringify(body)
48
- }).then((0, _misc.hasStatus)(201)).then(raw => raw.json()).then(json => _types.StatusAttestationResponse.parse(json)).catch(handleStatusAttestationError);
48
+ }).then((0, _misc.hasStatusOrThrow)(201)).then(raw => raw.json()).then(json => _types.StatusAttestationResponse.parse(json)).catch(handleStatusAttestationError);
49
49
  return {
50
50
  statusAttestation: result.status_attestation
51
51
  };
@@ -63,10 +63,12 @@ const handleStatusAttestationError = e => {
63
63
  if (!(e instanceof _errors.UnexpectedStatusCodeError)) {
64
64
  throw e;
65
65
  }
66
- if (e.statusCode === 404) {
67
- const maybeError = _types.InvalidStatusAttestationResponse.safeParse((0, _misc.safeJsonParse)(e.responseBody));
68
- throw new _errors.CredentialInvalidStatusError("Invalid status found for the given credential", maybeError.success ? maybeError.data.error : "unknown", e.message);
69
- }
70
- throw new _errors.StatusAttestationError(`Unable to obtain the status attestation for the given credential [response status code: ${e.statusCode}]`, e.message);
66
+ throw new _errors.ResponseErrorBuilder(_errors.IssuerResponseError).handle(404, {
67
+ code: _errors.IssuerResponseErrorCodes.CredentialInvalidStatus,
68
+ message: "Invalid status found for the given credential"
69
+ }).handle("*", {
70
+ code: _errors.IssuerResponseErrorCodes.StatusAttestationRequestFailed,
71
+ message: `Unable to obtain the status attestation for the given credential`
72
+ }).buildFrom(e);
71
73
  };
72
74
  //# sourceMappingURL=02-status-attestation.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_misc","require","_ioReactNativeJwt","_reactNativeUuid","_interopRequireDefault","_types","_errors","obj","__esModule","default","statusAttestation","issuerConf","credential","credentialCryptoContext","appFetch","arguments","length","undefined","fetch","jwk","getPublicKey","credentialHash","getCredentialHashWithouDiscloures","statusAttUrl","openid_credential_issuer","status_attestation_endpoint","credentialPop","SignJWT","setPayload","aud","jti","uuid","v4","toString","credential_hash","credential_hash_alg","setProtectedHeader","alg","typ","kid","setIssuedAt","setExpirationTime","sign","body","credential_pop","result","method","headers","JSON","stringify","then","hasStatus","raw","json","StatusAttestationResponse","parse","catch","handleStatusAttestationError","status_attestation","exports","e","UnexpectedStatusCodeError","statusCode","maybeError","InvalidStatusAttestationResponse","safeParse","safeJsonParse","responseBody","CredentialInvalidStatusError","success","data","error","message","StatusAttestationError"],"sourceRoot":"../../../../src","sources":["credential/status/02-status-attestation.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAOA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,gBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAIA,IAAAK,OAAA,GAAAL,OAAA;AAI4B,SAAAG,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAW5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,iBAAoC,GAAG,eAAAA,CAClDC,UAAU,EACVC,UAAU,EACVC,uBAAuB,EAEpB;EAAA,IADHC,QAA8B,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGG,KAAK;EAEtC,MAAMC,GAAG,GAAG,MAAMN,uBAAuB,CAAC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AAjD,iBAAA,GAAAA,iBAAA;AAOA,MAAM+C,4BAA4B,GAAIG,CAAU,IAAK;EACnD,IAAI,EAAEA,CAAC,YAAYC,iCAAyB,CAAC,EAAE;IAC7C,MAAMD,CAAC;EACT;EAEA,IAAIA,CAAC,CAACE,UAAU,KAAK,GAAG,EAAE;IACxB,MAAMC,UAAU,GAAGC,uCAAgC,CAACC,SAAS,CAC3D,IAAAC,mBAAa,EAACN,CAAC,CAACO,YAAY,CAC9B,CAAC;IACD,MAAM,IAAIC,oCAA4B,CACpC,+CAA+C,EAC/CL,UAAU,CAACM,OAAO,GAAGN,UAAU,CAACO,IAAI,CAACC,KAAK,GAAG,SAAS,EACtDX,CAAC,CAACY,OACJ,CAAC;EACH;EAEA,MAAM,IAAIC,8BAAsB,CAC7B,2FAA0Fb,CAAC,CAACE,UAAW,GAAE,EAC1GF,CAAC,CAACY,OACJ,CAAC;AACH,CAAC"}
1
+ {"version":3,"names":["_misc","require","_ioReactNativeJwt","_reactNativeUuid","_interopRequireDefault","_types","_errors","obj","__esModule","default","statusAttestation","issuerConf","credential","credentialCryptoContext","appFetch","arguments","length","undefined","fetch","jwk","getPublicKey","credentialHash","getCredentialHashWithouDiscloures","statusAttUrl","openid_credential_issuer","status_attestation_endpoint","credentialPop","SignJWT","setPayload","aud","jti","uuid","v4","toString","credential_hash","credential_hash_alg","setProtectedHeader","alg","typ","kid","setIssuedAt","setExpirationTime","sign","body","credential_pop","result","method","headers","JSON","stringify","then","hasStatusOrThrow","raw","json","StatusAttestationResponse","parse","catch","handleStatusAttestationError","status_attestation","exports","e","UnexpectedStatusCodeError","ResponseErrorBuilder","IssuerResponseError","handle","code","IssuerResponseErrorCodes","CredentialInvalidStatus","message","StatusAttestationRequestFailed","buildFrom"],"sourceRoot":"../../../../src","sources":["credential/status/02-status-attestation.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAMA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,gBAAA,G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IACdC,OAAO,EAAE;MACP,cAAc,EAAE;IAClB,CAAC;IACDJ,IAAI,EAAEK,IAAI,CAACC,SAAS,CAACN,IAAI;EAC3B,CAAC,CAAC,CACCO,IAAI,CAAC,IAAAC,sBAAgB,EAAC,GAAG,CAAC,CAAC,CAC3BD,IAAI,CAAEE,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC,CAAC,CAAC,CACzBH,IAAI,CAAEG,IAAI,IAAKC,gCAAyB,CAACC,KAAK,CAACF,IAAI,CAAC,CAAC,CACrDG,KAAK,CAACC,4BAA4B,CAAC;EAEtC,OAAO;IAAE/C,iBAAiB,EAAEmC,MAAM,CAACa;EAAmB,CAAC;AACzD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AANAC,OAAA,CAAAjD,iBAAA,GAAAA,iBAAA;AAOA,MAAM+C,4BAA4B,GAAIG,CAAU,IAAK;EACnD,IAAI,EAAEA,CAAC,YAAYC,iCAAyB,CAAC,EAAE;IAC7C,MAAMD,CAAC;EACT;EAEA,MAAM,IAAIE,4BAAoB,CAACC,2BAAmB,CAAC,CAChDC,MAAM,CAAC,GAAG,EAAE;IACXC,IAAI,EAAEC,gCAAwB,CAACC,uBAAuB;IACtDC,OAAO,EAAE;EACX,CAAC,CAAC,CACDJ,MAAM,CAAC,GAAG,EAAE;IACXC,IAAI,EAAEC,gCAAwB,CAACG,8BAA8B;IAC7DD,OAAO,EAAG;EACZ,CAAC,CAAC,CACDE,SAAS,CAACV,CAAC,CAAC;AACjB,CAAC"}
@@ -16,11 +16,14 @@ graph TD;
16
16
  1 --> 2
17
17
  ```
18
18
 
19
+
19
20
  ## Mapped results
20
21
 
21
- ### 404 Not Found (CredentialInvalidStatusError)
22
+ The following errors are mapped to a `IssuerResponseError` with specific codes.
22
23
 
23
- A `404 Not Found` response is returned by the credential issuer when the status attestation is invalid.
24
+ |HTTP Status|Error Code|Description|
25
+ |-----------|----------|-----------|
26
+ |`404 Not Found`|`ERR_CREDENTIAL_INVALID_STATUS`|This response is returned by the credential issuer when the status attestation is invalid. It might contain more details in the `reason` property.|
24
27
 
25
28
  ## Example
26
29
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.StatusAttestationResponse = exports.ParsedStatusAttestation = exports.InvalidStatusAttestationResponse = void 0;
6
+ exports.StatusAttestationResponse = exports.ParsedStatusAttestation = void 0;
7
7
  var _types = require("../../sd-jwt/types");
8
8
  var _jwk = require("../../utils/jwk");
9
9
  var z = _interopRequireWildcard(require("zod"));
@@ -44,18 +44,5 @@ const ParsedStatusAttestation = z.object({
44
44
  iat: _types.UnixTime
45
45
  })
46
46
  });
47
-
48
- /**
49
- * Shape from parsing a status attestation response in case of error.
50
- */
51
47
  exports.ParsedStatusAttestation = ParsedStatusAttestation;
52
- const InvalidStatusAttestationResponse = z.object({
53
- error: z.string()
54
- });
55
-
56
- /**
57
- * Type from parsing a status attestation response in case of error.
58
- * Inferred from {@link InvalidStatusAttestationResponse}.
59
- */
60
- exports.InvalidStatusAttestationResponse = InvalidStatusAttestationResponse;
61
48
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_types","require","_jwk","z","_interopRequireWildcard","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","StatusAttestationResponse","object","status_attestation","string","exports","ParsedStatusAttestation","header","typ","literal","alg","kid","optional","payload","credential_hash_alg","credential_hash","cnf","jwk","JWK","exp","UnixTime","iat","InvalidStatusAttestationResponse","error"],"sourceRoot":"../../../../src","sources":["credential/status/types.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,CAAA,GAAAC,uBAAA,CAAAH,OAAA;AAAyB,SAAAI,yBAAA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A;;AAKA;AACA;AACA;AAFAC,OAAA,CAAAJ,yBAAA,GAAAA,yBAAA;AAKA;AACA;AACA;AACO,MAAMK,uBAAuB,GAAG7B,CAAC,CAACyB,MAAM,CAAC;EAC9CK,MAAM,EAAE9B,CAAC,CAACyB,MAAM,CAAC;IACfM,GAAG,EAAE/B,CAAC,CAACgC,OAAO,CAAC,wBAAwB,CAAC;IACxCC,GAAG,EAAEjC,CAAC,CAAC2B,MAAM,CAAC,CAAC;IACfO,GAAG,EAAElC,CAAC,CAAC2B,MAAM,CAAC,CAAC,CAACQ,QAAQ,CAAC;EAC3B,CAAC,CAAC;EACFC,OAAO,EAAEpC,CAAC,CAACyB,MAAM,CAAC;IAChBY,mBAAmB,EAAErC,CAAC,CAAC2B,MAAM,CAAC,CAAC;IAC/BW,eAAe,EAAEtC,CAAC,CAAC2B,MAAM,CAAC,CAAC;IAC3BY,GAAG,EAAEvC,CAAC,CAACyB,MAAM,CAAC;MACZe,GAAG,EAAEC;IACP,CAAC,CAAC;IACFC,GAAG,EAAEC,eAAQ;IACbC,GAAG,EAAED;EACP,CAAC;AACH,CAAC,CAAC;;AAEF;AACA;AACA;AAFAf,OAAA,CAAAC,uBAAA,GAAAA,uBAAA;AAGO,MAAMgB,gCAAgC,GAAG7C,CAAC,CAACyB,MAAM,CAAC;EACvDqB,KAAK,EAAE9C,CAAC,CAAC2B,MAAM,CAAC;AAClB,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AAHAC,OAAA,CAAAiB,gCAAA,GAAAA,gCAAA"}
1
+ {"version":3,"names":["_types","require","_jwk","z","_interopRequireWildcard","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","StatusAttestationResponse","object","status_attestation","string","exports","ParsedStatusAttestation","header","typ","literal","alg","kid","optional","payload","credential_hash_alg","credential_hash","cnf","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AA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA;AAEzB;AACA;AACA;AACO,MAAMW,yBAAyB,GAAGxB,CAAC,CAACyB,MAAM,CAAC;EAChDC,kBAAkB,EAAE1B,CAAC,CAAC2B,MAAM,CAAC;AAC/B,CAAC,CAAC;;AAEF;AACA;AACA;AACA;;AAKA;AACA;AACA;AAFAC,OAAA,CAAAJ,yBAAA,GAAAA,yBAAA;AAKA;AACA;AACA;AACO,MAAMK,uBAAuB,GAAG7B,CAAC,CAACyB,MAAM,CAAC;EAC9CK,MAAM,EAAE9B,CAAC,CAACyB,MAAM,CAAC;IACfM,GAAG,EAAE/B,CAAC,CAACgC,OAAO,CAAC,wBAAwB,CAAC;IACxCC,GAAG,EAAEjC,CAAC,CAAC2B,MAAM,CAAC,CAAC;IACfO,GAAG,EAAElC,CAAC,CAAC2B,MAAM,CAAC,CAAC,CAACQ,QAAQ,CAAC;EAC3B,CAAC,CAAC;EACFC,OAAO,EAAEpC,CAAC,CAACyB,MAAM,CAAC;IAChBY,mBAAmB,EAAErC,CAAC,CAAC2B,MAAM,CAAC,CAAC;IAC/BW,eAAe,EAAEtC,CAAC,CAAC2B,MAAM,CAAC,CAAC;IAC3BY,GAAG,EAAEvC,CAAC,CAACyB,MAAM,CAAC;MACZe,GAAG,EAAEC;IACP,CAAC,CAAC;IACFC,GAAG,EAAEC,eAAQ;IACbC,GAAG,EAAED;EACP,CAAC;AACH,CAAC,CAAC;AAACf,OAAA,CAAAC,uBAAA,GAAAA,uBAAA"}
@@ -19,9 +19,11 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
19
19
  * @param credentialType The type of credential for which the trustmark is generated
20
20
  * @param docNumber (Optional) Document number contained in the credential, if applicable
21
21
  * @param expirationTime (Optional) Expiration time for the trustmark, default is 2 minutes.
22
- * If a number is provided, it is interpreted as a timestamp in seconds.
23
- * If a string is provided, it is interpreted as a time span and added to the current timestamp.
22
+ * If a number is provided, it is interpreted as a timestamp in seconds.
23
+ * If a string is provided, it is interpreted as a time span and added to the current timestamp.
24
+ * @throws {IoWalletError} If the WIA is expired
24
25
  * @throws {IoWalletError} If the public key associated to the WIA is not the same for the CryptoContext
26
+ * @throws {JWSSignatureVerificationFailed} If the WIA signature is not valid
25
27
  * @returns A promise containing the signed JWT and its expiration time in seconds
26
28
  */
27
29
  const getCredentialTrustmark = async _ref => {
@@ -38,6 +40,13 @@ const getCredentialTrustmark = async _ref => {
38
40
  const holderBindingKey = await wiaCryptoContext.getPublicKey();
39
41
  const decodedWia = WalletInstanceAttestation.decode(walletInstanceAttestation);
40
42
 
43
+ /**
44
+ * Check that the WIA is not expired
45
+ */
46
+ if (decodedWia.payload.exp * 1000 < Date.now()) {
47
+ throw new _errors.IoWalletError("Wallet Instance Attestation expired");
48
+ }
49
+
41
50
  /**
42
51
  * Verify holder binding by comparing thumbprints of the WIA and the CryptoContext key
43
52
  */
@@ -54,13 +63,13 @@ const getCredentialTrustmark = async _ref => {
54
63
  alg: "ES256"
55
64
  }).setPayload({
56
65
  iss: walletInstanceAttestation,
57
- sub: credentialType,
58
66
  /**
59
67
  * If present, the document number is obfuscated before adding it to the payload
60
68
  */
61
69
  ...(docNumber ? {
62
- subtyp: (0, _string.obfuscateString)(docNumber)
63
- } : {})
70
+ sub: (0, _string.obfuscateString)(docNumber)
71
+ } : {}),
72
+ subtyp: credentialType
64
73
  }).setIssuedAt().setExpirationTime(expirationTime).sign();
65
74
  const decodedTrustmark = (0, _ioReactNativeJwt.decode)(signedTrustmarkJwt);
66
75
  return {
@@ -1 +1 @@
1
- {"version":3,"names":["_ioReactNativeJwt","require","WalletInstanceAttestation","_interopRequireWildcard","_errors","_string","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","getCredentialTrustmark","_ref","walletInstanceAttestation","wiaCryptoContext","credentialType","docNumber","expirationTime","holderBindingKey","getPublicKey","decodedWia","decode","wiaThumbprint","thumbprint","payload","cnf","jwk","cryptoContextThumbprint","IoWalletError","signedTrustmarkJwt","SignJWT","setProtectedHeader","alg","setPayload","iss","sub","subtyp","obfuscateString","setIssuedAt","setExpirationTime","sign","decodedTrustmark","decodeJwt","jwt","exp","exports"],"sourceRoot":"../../../../src","sources":["credential/trustmark/get-credential-trustmark.ts"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAMA,IAAAC,yBAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAAqD,SAAAK,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAJ,wBAAAQ,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,I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,SAAS,GAAG;MAAEoB,MAAM,EAAE,IAAAC,uBAAe,EAACrB,SAAS;IAAE,CAAC,GAAG,CAAC,CAAC;EAC7D,CAAC,CAAC,CACDsB,WAAW,CAAC,CAAC,CACbC,iBAAiB,CAACtB,cAAc,CAAC,CACjCuB,IAAI,CAAC,CAAC;EAET,MAAMC,gBAAgB,GAAG,IAAAC,wBAAS,EAACb,kBAAkB,CAAC;EAEtD,OAAO;IACLc,GAAG,EAAEd,kBAAkB;IACvBZ,cAAc,EAAEwB,gBAAgB,CAACjB,OAAO,CAACoB,GAAG,IAAI;EAClD,CAAC;AACH,CAAC;AAACC,OAAA,CAAAlC,sBAAA,GAAAA,sBAAA"}
1
+ {"version":3,"names":["_ioReactNativeJwt","require","WalletInstanceAttestation","_interopRequireWildcard","_errors","_string","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","getCredentialTrustmark","_ref","walletInstanceAttestation","wiaCryptoContext","credentialType","docNumber","expirationTime","holderBindingKey","getPublicKey","decodedWia","decode","payload","exp","Date","now","IoWalletError","wiaThumbprint","thumbprint","cnf","jwk","cryptoContextThumbprint","signedTrustmarkJwt","SignJWT","setProtectedHeader","alg","setPayload","iss","sub","obfuscateString","subtyp","setIssuedAt","setExpirationTime","sign","decodedTrustmark","decodeJwt","jwt","exports"],"sourceRoot":"../../../../src","sources":["credential/trustmark/get-credential-trustmark.ts"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAMA,IAAAC,yBAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAAqD,SAAAK,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,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,CAAC;AACH,CAAC;AAACwB,OAAA,CAAApC,sBAAA,GAAAA,sBAAA"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ClaimsNotFoundInToken = exports.ClaimsNotFoundBetweenDisclosures = void 0;
7
+ /**
8
+ * When claims are requested but not found in the credential
9
+ *
10
+ */
11
+ class ClaimsNotFoundBetweenDisclosures extends Error {
12
+ code = "ERR_CLAIMS_NOT_FOUND";
13
+
14
+ /** The Claims not found */
15
+
16
+ constructor(claims) {
17
+ const c = Array.isArray(claims) ? claims : [claims];
18
+ const message = `Some requested claims are not present in the disclosurable values, claims: ${c.join(", ")}`;
19
+ super(message);
20
+ this.claims = c;
21
+ }
22
+ }
23
+
24
+ /**
25
+ * When the SD-JWT does not contain an hashed reference to a given set of claims
26
+ */
27
+ exports.ClaimsNotFoundBetweenDisclosures = ClaimsNotFoundBetweenDisclosures;
28
+ class ClaimsNotFoundInToken extends Error {
29
+ code = "ERR_CLAIMS_NOT_FOUND_IN_TOKEN";
30
+
31
+ /** The Claims not found */
32
+
33
+ constructor(claims) {
34
+ const claimsArray = Array.isArray(claims) ? claims : [claims];
35
+ super(`Some requested claims are not present in the disclosurable values: ${claimsArray.join(", ")}`);
36
+ this.claims = claimsArray;
37
+ }
38
+ }
39
+ exports.ClaimsNotFoundInToken = ClaimsNotFoundInToken;
40
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ClaimsNotFoundBetweenDisclosures","Error","code","constructor","claims","c","Array","isArray","message","join","exports","ClaimsNotFoundInToken","claimsArray"],"sourceRoot":"../../../src","sources":["sd-jwt/errors.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACO,MAAMA,gCAAgC,SAASC,KAAK,CAAC;EAC1DC,IAAI,GAAG,sBAAsB;;EAE7B;;EAGAC,WAAWA,CAACC,MAAyB,EAAE;IACrC,MAAMC,CAAC,GAAGC,KAAK,CAACC,OAAO,CAACH,MAAM,CAAC,GAAGA,MAAM,GAAG,CAACA,MAAM,CAAC;IACnD,MAAMI,OAAO,GAAI,8EAA6EH,CAAC,CAACI,IAAI,CAClG,IACF,CAAE,EAAC;IACH,KAAK,CAACD,OAAO,CAAC;IACd,IAAI,CAACJ,MAAM,GAAGC,CAAC;EACjB;AACF;;AAEA;AACA;AACA;AAFAK,OAAA,CAAAV,gCAAA,GAAAA,gCAAA;AAGO,MAAMW,qBAAqB,SAASV,KAAK,CAAC;EAC/CC,IAAI,GAAG,+BAA+B;;EAEtC;;EAGAC,WAAWA,CAACC,MAAyB,EAAE;IACrC,MAAMQ,WAAW,GAAGN,KAAK,CAACC,OAAO,CAACH,MAAM,CAAC,GAAGA,MAAM,GAAG,CAACA,MAAM,CAAC;IAC7D,KAAK,CACF,sEAAqEQ,WAAW,CAACH,IAAI,CACpF,IACF,CAAE,EACJ,CAAC;IACD,IAAI,CAACL,MAAM,GAAGQ,WAAW;EAC3B;AACF;AAACF,OAAA,CAAAC,qBAAA,GAAAA,qBAAA"}
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.Errors = void 0;
6
7
  Object.defineProperty(exports, "SdJwt4VC", {
7
8
  enumerable: true,
8
9
  get: function () {
@@ -13,8 +14,11 @@ exports.verify = exports.disclose = exports.decode = void 0;
13
14
  var _ioReactNativeJwt = require("@pagopa/io-react-native-jwt");
14
15
  var _types = require("./types");
15
16
  var _verifier = require("./verifier");
16
- var _errors = require("../utils/errors");
17
+ var Errors = _interopRequireWildcard(require("./errors"));
18
+ exports.Errors = Errors;
17
19
  var _jsBase = require("js-base64");
20
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
18
22
  const decodeDisclosure = encoded => {
19
23
  const utf8String = _jsBase.Base64.decode(encoded); // Decode Base64 into UTF-8 string
20
24
  const decoded = _types.Disclosure.parse(JSON.parse(utf8String));
@@ -74,7 +78,7 @@ const decode = (token, customSchema) => {
74
78
  * @param token The encoded token that represents a valid sd-jwt for verifiable credentials
75
79
  * @param claims The list of claims to be disclosed
76
80
  *
77
- * @throws {ClaimsNotFoundBetweenDislosures} When one or more claims does not relate to any discloure.
81
+ * @throws {ClaimsNotFoundBetweenDisclosures} When one or more claims does not relate to any discloure.
78
82
  * @throws {ClaimsNotFoundInToken} When one or more claims are not contained in the SD-JWT token.
79
83
  * @returns The encoded token with only the requested disclosures, along with the path each claim can be found on the SD-JWT token
80
84
  *
@@ -98,7 +102,7 @@ const disclose = async (token, claims) => {
98
102
 
99
103
  // check every claim represents a known disclosure
100
104
  if (!disclosure) {
101
- throw new _errors.ClaimsNotFoundBetweenDislosures(claim);
105
+ throw new Errors.ClaimsNotFoundBetweenDisclosures(claim);
102
106
  }
103
107
  const hash = await (0, _ioReactNativeJwt.sha256ToBase64)(disclosure.encoded);
104
108
 
@@ -111,7 +115,7 @@ const disclose = async (token, claims) => {
111
115
  path: `verified_claims.claims._sd[${index}]`
112
116
  };
113
117
  }
114
- throw new _errors.ClaimsNotFoundInToken(claim);
118
+ throw new Errors.ClaimsNotFoundInToken(claim);
115
119
  }));
116
120
  const filteredDisclosures = rawDisclosures.filter(d => {
117
121
  const {
@@ -1 +1 @@
1
- {"version":3,"names":["_ioReactNativeJwt","require","_types","_verifier","_errors","_jsBase","decodeDisclosure","encoded","utf8String","Base64","decode","decoded","Disclosure","parse","JSON","token","customSchema","slice","rawSdJwt","rawDisclosures","split","decodedJwt","decodeJwt","parser","SdJwt4VC","sdJwt","header","protectedHeader","payload","disclosures","map","exports","disclose","claims","paths","Promise","all","claim","disclosure","find","_ref","name","ClaimsNotFoundBetweenDislosures","hash","sha256ToBase64","_sd","includes","index","indexOf","path","ClaimsNotFoundInToken","filteredDisclosures","filter","d","disclosedToken","join","verify","publicKey","verifyJwt","verifyDisclosure"],"sourceRoot":"../../../src","sources":["sd-jwt/index.ts"],"mappings":";;;;;;;;;;;;AAEA,IAAAA,iBAAA,GAAAC,OAAA;AAGA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAEA,IAAAG,OAAA,GAAAH,OAAA;AAIA,IAAAI,OAAA,GAAAJ,OAAA;AAEA,MAAMK,gBAAgB,GAAIC,OAAe,IAA4B;EACnE,MAAMC,UAAU,GAAGC,cAAM,CAACC,MAAM,CAACH,OAAO,CAAC,CAAC,CAAC;EAC3C,MAAMI,OAAO,GAAGC,iBAAU,CAACC,KAAK,CAACC,IAAI,CAACD,KAAK,CAACL,UAAU,CAAC,CAAC;EACxD,OAAO;IAAEG,OAAO;IAAEJ;EAAQ,CAAC;AAC7B,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,MAAM,GAAGA,CACpBK,KAAa,EACbC,YAAgB,KAIb;EACH;EACA,IAAID,KAAK,CAACE,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;IAC3BF,KAAK,GAAGA,KAAK,CAACE,KAAK,CAAC,C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CAAC;;EAE3C;EACA,MAAM,IAAA0C,wBAAS,EAACxC,QAAQ,EAAEuC,SAAS,CAAC;;EAEpC;EACA,MAAMxB,MAAM,GAAG,CAAC,GAAGtB,OAAO,CAACc,KAAK,CAACG,OAAO,CAACiB,GAAG,CAAC;EAE7C,MAAMV,OAAO,CAACC,GAAG,CACfzB,OAAO,CAACkB,WAAW,CAACC,GAAG,CACrB,MAAOQ,UAAU,IAAK,MAAM,IAAAqB,0BAAgB,EAACrB,UAAU,EAAEL,MAAM,CACjE,CACF,CAAC;EAED,OAAO;IACLR,KAAK,EAAEd,OAAO,CAACc,KAAK;IACpBI,WAAW,EAAElB,OAAO,CAACkB,WAAW,CAACC,GAAG,CAAEuB,CAAC,IAAKA,CAAC,CAAC1C,OAAO;EACvD,CAAC;AACH,CAAC;AAACoB,OAAA,CAAAyB,MAAA,GAAAA,MAAA"}
1
+ {"version":3,"names":["_ioReactNativeJwt","require","_types","_verifier","Errors","_interopRequireWildcard","exports","_jsBase","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","decodeDisclosure","encoded","utf8String","Base64","decode","decoded","Disclosure","parse","JSON","token","customSchema","slice","rawSdJwt","rawDisclosures","split","decodedJwt","decodeJwt","parser","SdJwt4VC","sdJwt","header","protectedHeader","payload","disclosures","map","disclose","claims","paths","Promise","all","claim","disclosure","find","_ref","name","ClaimsNotFoundBetweenDisclosures","hash","sha256ToBase64","_sd","includes","index","indexOf","path","ClaimsNotFoundInToken","filteredDisclosures","filter","d","disclosedToken","join","verify","publicKey","verifyJwt","verifyDisclosure"],"sourceRoot":"../../../src","sources":["sd-jwt/index.ts"],"mappings":";;;;;;;;;;;;;AAEA,IAAAA,iBAAA,GAAAC,OAAA;AAGA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,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B,CAAC,CAAC;;EAEF;EACA,MAAMa,cAAc,GAAG,CAACnC,QAAQ,EAAE,GAAGgC,mBAAmB,CAAC,CAACI,IAAI,CAAC,GAAG,CAAC;EAEnE,OAAO;IAAEvC,KAAK,EAAEsC,cAAc;IAAEpB;EAAM,CAAC;AACzC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfAnD,OAAA,CAAAiD,QAAA,GAAAA,QAAA;AAgBO,MAAMwB,MAAM,GAAG,MAAAA,CACpBxC,KAAa,EACbyC,SAAsB,EACtBxC,YAAgB,KAC8C;EAC9D;EACA,MAAM,CAACE,QAAQ,GAAG,EAAE,CAAC,GAAGH,KAAK,CAACK,KAAK,CAAC,GAAG,CAAC;EACxC,MAAMT,OAAO,GAAGD,MAAM,CAACK,KAAK,EAAEC,YAAY,CAAC;;EAE3C;EACA,MAAM,IAAAyC,wBAAS,EAACvC,QAAQ,EAAEsC,SAAS,CAAC;;EAEpC;EACA,MAAMxB,MAAM,GAAG,CAAC,GAAGrB,OAAO,CAACc,KAAK,CAACG,OAAO,CAACgB,GAAG,CAAC;EAE7C,MAAMV,OAAO,CAACC,GAAG,CACfxB,OAAO,CAACkB,WAAW,CAACC,GAAG,CACrB,MAAOO,UAAU,IAAK,MAAM,IAAAqB,0BAAgB,EAACrB,UAAU,EAAEL,MAAM,CACjE,CACF,CAAC;EAED,OAAO;IACLP,KAAK,EAAEd,OAAO,CAACc,KAAK;IACpBI,WAAW,EAAElB,OAAO,CAACkB,WAAW,CAACC,GAAG,CAAEsB,CAAC,IAAKA,CAAC,CAACzC,OAAO;EACvD,CAAC;AACH,CAAC;AAAC7B,OAAA,CAAAyE,MAAA,GAAAA,MAAA"}
@@ -13,7 +13,11 @@ const verifyDisclosure = async (_ref, claims) => {
13
13
  } = _ref;
14
14
  let hash = await (0, _ioReactNativeJwt.sha256ToBase64)(encoded);
15
15
  if (!claims.includes(hash)) {
16
- throw new _errors.ValidationFailed("Validation of disclosure failed", `${decoded}`, "Disclosure hash not found in claims");
16
+ throw new _errors.ValidationFailed({
17
+ message: "Validation of disclosure failed",
18
+ claim: `${decoded}`,
19
+ reason: "Disclosure hash not found in claims"
20
+ });
17
21
  }
18
22
  };
19
23
  exports.verifyDisclosure = verifyDisclosure;