@pagopa/io-react-native-wallet 1.7.1 → 2.0.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (443) hide show
  1. package/README.md +47 -1
  2. package/lib/commonjs/client/generated/wallet-provider.js +49 -20
  3. package/lib/commonjs/client/generated/wallet-provider.js.map +1 -1
  4. package/lib/commonjs/credential/index.js +5 -1
  5. package/lib/commonjs/credential/index.js.map +1 -1
  6. package/lib/commonjs/credential/issuance/02-evaluate-issuer-trust.js +27 -0
  7. package/lib/commonjs/credential/issuance/02-evaluate-issuer-trust.js.map +1 -0
  8. package/lib/commonjs/credential/issuance/03-start-user-authorization.js +25 -16
  9. package/lib/commonjs/credential/issuance/03-start-user-authorization.js.map +1 -1
  10. package/lib/commonjs/credential/issuance/04-complete-user-authorization.js +30 -18
  11. package/lib/commonjs/credential/issuance/04-complete-user-authorization.js.map +1 -1
  12. package/lib/commonjs/credential/issuance/05-authorize-access.js +17 -12
  13. package/lib/commonjs/credential/issuance/05-authorize-access.js.map +1 -1
  14. package/lib/commonjs/credential/issuance/06-obtain-credential.js +36 -29
  15. package/lib/commonjs/credential/issuance/06-obtain-credential.js.map +1 -1
  16. package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js +27 -207
  17. package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
  18. package/lib/commonjs/credential/issuance/README.md +23 -20
  19. package/lib/commonjs/credential/issuance/const.js +1 -1
  20. package/lib/commonjs/credential/issuance/const.js.map +1 -1
  21. package/lib/commonjs/credential/issuance/index.js +3 -3
  22. package/lib/commonjs/credential/issuance/index.js.map +1 -1
  23. package/lib/commonjs/credential/presentation/01-start-flow.js +14 -15
  24. package/lib/commonjs/credential/presentation/01-start-flow.js.map +1 -1
  25. package/lib/commonjs/credential/presentation/02-evaluate-rp-trust.js +6 -4
  26. package/lib/commonjs/credential/presentation/02-evaluate-rp-trust.js.map +1 -1
  27. package/lib/commonjs/credential/presentation/03-get-request-object.js +34 -7
  28. package/lib/commonjs/credential/presentation/03-get-request-object.js.map +1 -1
  29. package/lib/commonjs/credential/presentation/04-retrieve-rp-jwks.js +4 -126
  30. package/lib/commonjs/credential/presentation/04-retrieve-rp-jwks.js.map +1 -1
  31. package/lib/commonjs/credential/presentation/05-verify-request-object.js +80 -25
  32. package/lib/commonjs/credential/presentation/05-verify-request-object.js.map +1 -1
  33. package/lib/commonjs/credential/presentation/06-fetch-presentation-definition.js +6 -30
  34. package/lib/commonjs/credential/presentation/06-fetch-presentation-definition.js.map +1 -1
  35. package/lib/commonjs/credential/presentation/07-evaluate-dcql-query.js +97 -117
  36. package/lib/commonjs/credential/presentation/07-evaluate-dcql-query.js.map +1 -1
  37. package/lib/commonjs/credential/presentation/07-evaluate-input-descriptor.js +86 -191
  38. package/lib/commonjs/credential/presentation/07-evaluate-input-descriptor.js.map +1 -1
  39. package/lib/commonjs/credential/presentation/08-send-authorization-response.js +112 -176
  40. package/lib/commonjs/credential/presentation/08-send-authorization-response.js.map +1 -1
  41. package/lib/commonjs/credential/presentation/README.md +74 -79
  42. package/lib/commonjs/credential/presentation/errors.js +42 -21
  43. package/lib/commonjs/credential/presentation/errors.js.map +1 -1
  44. package/lib/commonjs/credential/presentation/index.js +13 -13
  45. package/lib/commonjs/credential/presentation/index.js.map +1 -1
  46. package/lib/commonjs/credential/presentation/types.js +53 -29
  47. package/lib/commonjs/credential/presentation/types.js.map +1 -1
  48. package/lib/commonjs/credential/status/01-start-flow.js +2 -0
  49. package/lib/commonjs/credential/status/01-start-flow.js.map +1 -0
  50. package/lib/commonjs/credential/status/02-status-attestation.js +73 -0
  51. package/lib/commonjs/credential/status/02-status-attestation.js.map +1 -0
  52. package/lib/commonjs/credential/status/03-verify-and-parse-status-attestation.js +55 -0
  53. package/lib/commonjs/credential/status/03-verify-and-parse-status-attestation.js.map +1 -0
  54. package/lib/commonjs/credential/status/README.md +67 -0
  55. package/lib/commonjs/credential/status/index.js +27 -0
  56. package/lib/commonjs/credential/status/index.js.map +1 -0
  57. package/lib/commonjs/credential/status/types.js +48 -0
  58. package/lib/commonjs/credential/status/types.js.map +1 -0
  59. package/lib/commonjs/credential/trustmark/README.md +62 -0
  60. package/lib/commonjs/credential/trustmark/get-credential-trustmark.js +86 -0
  61. package/lib/commonjs/credential/trustmark/get-credential-trustmark.js.map +1 -0
  62. package/lib/commonjs/credential/trustmark/index.js +13 -0
  63. package/lib/commonjs/credential/trustmark/index.js.map +1 -0
  64. package/lib/commonjs/index.js +5 -1
  65. package/lib/commonjs/index.js.map +1 -1
  66. package/lib/commonjs/pid/sd-jwt/types.js +18 -2
  67. package/lib/commonjs/pid/sd-jwt/types.js.map +1 -1
  68. package/lib/commonjs/sd-jwt/__test__/index.test.js +22 -34
  69. package/lib/commonjs/sd-jwt/__test__/index.test.js.map +1 -1
  70. package/lib/commonjs/sd-jwt/__test__/types.test.js +11 -23
  71. package/lib/commonjs/sd-jwt/__test__/types.test.js.map +1 -1
  72. package/lib/commonjs/sd-jwt/index.js +1 -7
  73. package/lib/commonjs/sd-jwt/index.js.map +1 -1
  74. package/lib/commonjs/sd-jwt/types.js +5 -21
  75. package/lib/commonjs/sd-jwt/types.js.map +1 -1
  76. package/lib/commonjs/trust/README.md +147 -0
  77. package/lib/commonjs/trust/chain.js +153 -0
  78. package/lib/commonjs/trust/chain.js.map +1 -0
  79. package/lib/commonjs/trust/errors.js +133 -0
  80. package/lib/commonjs/trust/errors.js.map +1 -0
  81. package/lib/commonjs/trust/index.js +288 -0
  82. package/lib/commonjs/trust/index.js.map +1 -0
  83. package/lib/commonjs/{entity/trust → trust}/types.js +27 -47
  84. package/lib/commonjs/trust/types.js.map +1 -0
  85. package/lib/commonjs/trust/utils.js +70 -0
  86. package/lib/commonjs/trust/utils.js.map +1 -0
  87. package/lib/commonjs/utils/crypto.js +5 -112
  88. package/lib/commonjs/utils/crypto.js.map +1 -1
  89. package/lib/commonjs/utils/decoder.js +2 -0
  90. package/lib/commonjs/utils/decoder.js.map +1 -1
  91. package/lib/commonjs/utils/error-codes.js +22 -2
  92. package/lib/commonjs/utils/error-codes.js.map +1 -1
  93. package/lib/commonjs/utils/errors.js +72 -4
  94. package/lib/commonjs/utils/errors.js.map +1 -1
  95. package/lib/commonjs/utils/logging.js +68 -0
  96. package/lib/commonjs/utils/logging.js.map +1 -0
  97. package/lib/commonjs/utils/misc.js +2 -0
  98. package/lib/commonjs/utils/misc.js.map +1 -1
  99. package/lib/commonjs/utils/par.js +17 -10
  100. package/lib/commonjs/utils/par.js.map +1 -1
  101. package/lib/commonjs/utils/string.js +1 -12
  102. package/lib/commonjs/utils/string.js.map +1 -1
  103. package/lib/commonjs/wallet-instance/index.js +14 -0
  104. package/lib/commonjs/wallet-instance/index.js.map +1 -1
  105. package/lib/commonjs/wallet-instance-attestation/README.md +8 -3
  106. package/lib/commonjs/wallet-instance-attestation/issuing.js +15 -8
  107. package/lib/commonjs/wallet-instance-attestation/issuing.js.map +1 -1
  108. package/lib/commonjs/wallet-instance-attestation/types.js +16 -20
  109. package/lib/commonjs/wallet-instance-attestation/types.js.map +1 -1
  110. package/lib/module/client/generated/wallet-provider.js +40 -15
  111. package/lib/module/client/generated/wallet-provider.js.map +1 -1
  112. package/lib/module/credential/index.js +3 -1
  113. package/lib/module/credential/index.js.map +1 -1
  114. package/lib/module/credential/issuance/02-evaluate-issuer-trust.js +20 -0
  115. package/lib/module/credential/issuance/02-evaluate-issuer-trust.js.map +1 -0
  116. package/lib/module/credential/issuance/03-start-user-authorization.js +25 -16
  117. package/lib/module/credential/issuance/03-start-user-authorization.js.map +1 -1
  118. package/lib/module/credential/issuance/04-complete-user-authorization.js +30 -18
  119. package/lib/module/credential/issuance/04-complete-user-authorization.js.map +1 -1
  120. package/lib/module/credential/issuance/05-authorize-access.js +17 -11
  121. package/lib/module/credential/issuance/05-authorize-access.js.map +1 -1
  122. package/lib/module/credential/issuance/06-obtain-credential.js +36 -28
  123. package/lib/module/credential/issuance/06-obtain-credential.js.map +1 -1
  124. package/lib/module/credential/issuance/07-verify-and-parse-credential.js +27 -205
  125. package/lib/module/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
  126. package/lib/module/credential/issuance/README.md +23 -20
  127. package/lib/module/credential/issuance/const.js +1 -1
  128. package/lib/module/credential/issuance/const.js.map +1 -1
  129. package/lib/module/credential/issuance/index.js +2 -2
  130. package/lib/module/credential/issuance/index.js.map +1 -1
  131. package/lib/module/credential/presentation/01-start-flow.js +14 -15
  132. package/lib/module/credential/presentation/01-start-flow.js.map +1 -1
  133. package/lib/module/credential/presentation/02-evaluate-rp-trust.js +5 -3
  134. package/lib/module/credential/presentation/02-evaluate-rp-trust.js.map +1 -1
  135. package/lib/module/credential/presentation/03-get-request-object.js +34 -7
  136. package/lib/module/credential/presentation/03-get-request-object.js.map +1 -1
  137. package/lib/module/credential/presentation/04-retrieve-rp-jwks.js +2 -124
  138. package/lib/module/credential/presentation/04-retrieve-rp-jwks.js.map +1 -1
  139. package/lib/module/credential/presentation/05-verify-request-object.js +78 -23
  140. package/lib/module/credential/presentation/05-verify-request-object.js.map +1 -1
  141. package/lib/module/credential/presentation/06-fetch-presentation-definition.js +6 -30
  142. package/lib/module/credential/presentation/06-fetch-presentation-definition.js.map +1 -1
  143. package/lib/module/credential/presentation/07-evaluate-dcql-query.js +97 -118
  144. package/lib/module/credential/presentation/07-evaluate-dcql-query.js.map +1 -1
  145. package/lib/module/credential/presentation/07-evaluate-input-descriptor.js +83 -186
  146. package/lib/module/credential/presentation/07-evaluate-input-descriptor.js.map +1 -1
  147. package/lib/module/credential/presentation/08-send-authorization-response.js +107 -170
  148. package/lib/module/credential/presentation/08-send-authorization-response.js.map +1 -1
  149. package/lib/module/credential/presentation/README.md +74 -79
  150. package/lib/module/credential/presentation/errors.js +30 -17
  151. package/lib/module/credential/presentation/errors.js.map +1 -1
  152. package/lib/module/credential/presentation/index.js +6 -6
  153. package/lib/module/credential/presentation/index.js.map +1 -1
  154. package/lib/module/credential/presentation/types.js +49 -27
  155. package/lib/module/credential/presentation/types.js.map +1 -1
  156. package/lib/module/credential/status/01-start-flow.js +2 -0
  157. package/lib/module/credential/status/01-start-flow.js.map +1 -0
  158. package/lib/module/credential/status/02-status-attestation.js +66 -0
  159. package/lib/module/credential/status/02-status-attestation.js.map +1 -0
  160. package/lib/module/credential/status/03-verify-and-parse-status-attestation.js +49 -0
  161. package/lib/module/credential/status/03-verify-and-parse-status-attestation.js.map +1 -0
  162. package/lib/module/credential/status/README.md +67 -0
  163. package/lib/module/credential/status/index.js +5 -0
  164. package/lib/module/credential/status/index.js.map +1 -0
  165. package/lib/module/credential/status/types.js +40 -0
  166. package/lib/module/credential/status/types.js.map +1 -0
  167. package/lib/module/credential/trustmark/README.md +62 -0
  168. package/lib/module/credential/trustmark/get-credential-trustmark.js +77 -0
  169. package/lib/module/credential/trustmark/get-credential-trustmark.js.map +1 -0
  170. package/lib/module/credential/trustmark/index.js +3 -0
  171. package/lib/module/credential/trustmark/index.js.map +1 -0
  172. package/lib/module/index.js +3 -1
  173. package/lib/module/index.js.map +1 -1
  174. package/lib/module/pid/sd-jwt/types.js +16 -1
  175. package/lib/module/pid/sd-jwt/types.js.map +1 -1
  176. package/lib/module/sd-jwt/__test__/index.test.js +22 -34
  177. package/lib/module/sd-jwt/__test__/index.test.js.map +1 -1
  178. package/lib/module/sd-jwt/__test__/types.test.js +11 -23
  179. package/lib/module/sd-jwt/__test__/types.test.js.map +1 -1
  180. package/lib/module/sd-jwt/index.js +1 -7
  181. package/lib/module/sd-jwt/index.js.map +1 -1
  182. package/lib/module/sd-jwt/types.js +4 -19
  183. package/lib/module/sd-jwt/types.js.map +1 -1
  184. package/lib/module/trust/README.md +147 -0
  185. package/lib/module/trust/chain.js +145 -0
  186. package/lib/module/trust/chain.js.map +1 -0
  187. package/lib/module/trust/errors.js +115 -0
  188. package/lib/module/trust/errors.js.map +1 -0
  189. package/lib/module/trust/index.js +269 -0
  190. package/lib/module/trust/index.js.map +1 -0
  191. package/lib/module/{entity/trust → trust}/types.js +25 -46
  192. package/lib/module/trust/types.js.map +1 -0
  193. package/lib/module/trust/utils.js +60 -0
  194. package/lib/module/trust/utils.js.map +1 -0
  195. package/lib/module/utils/crypto.js +4 -107
  196. package/lib/module/utils/crypto.js.map +1 -1
  197. package/lib/module/utils/decoder.js +3 -0
  198. package/lib/module/utils/decoder.js.map +1 -1
  199. package/lib/module/utils/error-codes.js +20 -1
  200. package/lib/module/utils/error-codes.js.map +1 -1
  201. package/lib/module/utils/errors.js +61 -4
  202. package/lib/module/utils/errors.js.map +1 -1
  203. package/lib/module/utils/logging.js +62 -0
  204. package/lib/module/utils/logging.js.map +1 -0
  205. package/lib/module/utils/misc.js +2 -0
  206. package/lib/module/utils/misc.js.map +1 -1
  207. package/lib/module/utils/par.js +17 -9
  208. package/lib/module/utils/par.js.map +1 -1
  209. package/lib/module/utils/string.js +0 -10
  210. package/lib/module/utils/string.js.map +1 -1
  211. package/lib/module/wallet-instance/index.js +13 -0
  212. package/lib/module/wallet-instance/index.js.map +1 -1
  213. package/lib/module/wallet-instance-attestation/README.md +8 -3
  214. package/lib/module/wallet-instance-attestation/index.js +2 -2
  215. package/lib/module/wallet-instance-attestation/index.js.map +1 -1
  216. package/lib/module/wallet-instance-attestation/issuing.js +16 -9
  217. package/lib/module/wallet-instance-attestation/issuing.js.map +1 -1
  218. package/lib/module/wallet-instance-attestation/types.js +14 -18
  219. package/lib/module/wallet-instance-attestation/types.js.map +1 -1
  220. package/lib/typescript/client/generated/wallet-provider.d.ts +206 -51
  221. package/lib/typescript/client/generated/wallet-provider.d.ts.map +1 -1
  222. package/lib/typescript/credential/index.d.ts +3 -1
  223. package/lib/typescript/credential/index.d.ts.map +1 -1
  224. package/lib/typescript/credential/issuance/01-start-flow.d.ts +1 -1
  225. package/lib/typescript/credential/issuance/02-evaluate-issuer-trust.d.ts +19 -0
  226. package/lib/typescript/credential/issuance/02-evaluate-issuer-trust.d.ts.map +1 -0
  227. package/lib/typescript/credential/issuance/03-start-user-authorization.d.ts +3 -3
  228. package/lib/typescript/credential/issuance/03-start-user-authorization.d.ts.map +1 -1
  229. package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts +9 -9
  230. package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts.map +1 -1
  231. package/lib/typescript/credential/issuance/05-authorize-access.d.ts +3 -3
  232. package/lib/typescript/credential/issuance/05-authorize-access.d.ts.map +1 -1
  233. package/lib/typescript/credential/issuance/06-obtain-credential.d.ts +4 -4
  234. package/lib/typescript/credential/issuance/06-obtain-credential.d.ts.map +1 -1
  235. package/lib/typescript/credential/issuance/07-verify-and-parse-credential.d.ts +3 -15
  236. package/lib/typescript/credential/issuance/07-verify-and-parse-credential.d.ts.map +1 -1
  237. package/lib/typescript/credential/issuance/const.d.ts +1 -1
  238. package/lib/typescript/credential/issuance/const.d.ts.map +1 -1
  239. package/lib/typescript/credential/issuance/index.d.ts +3 -3
  240. package/lib/typescript/credential/issuance/index.d.ts.map +1 -1
  241. package/lib/typescript/credential/issuance/types.d.ts +8 -3
  242. package/lib/typescript/credential/issuance/types.d.ts.map +1 -1
  243. package/lib/typescript/credential/presentation/01-start-flow.d.ts +28 -9
  244. package/lib/typescript/credential/presentation/01-start-flow.d.ts.map +1 -1
  245. package/lib/typescript/credential/presentation/02-evaluate-rp-trust.d.ts +2 -1
  246. package/lib/typescript/credential/presentation/02-evaluate-rp-trust.d.ts.map +1 -1
  247. package/lib/typescript/credential/presentation/03-get-request-object.d.ts +7 -5
  248. package/lib/typescript/credential/presentation/03-get-request-object.d.ts.map +1 -1
  249. package/lib/typescript/credential/presentation/04-retrieve-rp-jwks.d.ts +4 -30
  250. package/lib/typescript/credential/presentation/04-retrieve-rp-jwks.d.ts.map +1 -1
  251. package/lib/typescript/credential/presentation/05-verify-request-object.d.ts +17 -4
  252. package/lib/typescript/credential/presentation/05-verify-request-object.d.ts.map +1 -1
  253. package/lib/typescript/credential/presentation/06-fetch-presentation-definition.d.ts +4 -9
  254. package/lib/typescript/credential/presentation/06-fetch-presentation-definition.d.ts.map +1 -1
  255. package/lib/typescript/credential/presentation/07-evaluate-dcql-query.d.ts +13 -12
  256. package/lib/typescript/credential/presentation/07-evaluate-dcql-query.d.ts.map +1 -1
  257. package/lib/typescript/credential/presentation/07-evaluate-input-descriptor.d.ts +40 -42
  258. package/lib/typescript/credential/presentation/07-evaluate-input-descriptor.d.ts.map +1 -1
  259. package/lib/typescript/credential/presentation/08-send-authorization-response.d.ts +30 -43
  260. package/lib/typescript/credential/presentation/08-send-authorization-response.d.ts.map +1 -1
  261. package/lib/typescript/credential/presentation/errors.d.ts +25 -10
  262. package/lib/typescript/credential/presentation/errors.d.ts.map +1 -1
  263. package/lib/typescript/credential/presentation/index.d.ts +7 -8
  264. package/lib/typescript/credential/presentation/index.d.ts.map +1 -1
  265. package/lib/typescript/credential/presentation/types.d.ts +137 -307
  266. package/lib/typescript/credential/presentation/types.d.ts.map +1 -1
  267. package/lib/typescript/credential/status/01-start-flow.d.ts +10 -0
  268. package/lib/typescript/credential/status/01-start-flow.d.ts.map +1 -0
  269. package/lib/typescript/credential/status/02-status-attestation.d.ts +19 -0
  270. package/lib/typescript/credential/status/02-status-attestation.d.ts.map +1 -0
  271. package/lib/typescript/credential/status/03-verify-and-parse-status-attestation.d.ts +24 -0
  272. package/lib/typescript/credential/status/03-verify-and-parse-status-attestation.d.ts.map +1 -0
  273. package/lib/typescript/credential/status/index.d.ts +7 -0
  274. package/lib/typescript/credential/status/index.d.ts.map +1 -0
  275. package/lib/typescript/credential/status/types.d.ts +305 -0
  276. package/lib/typescript/credential/status/types.d.ts.map +1 -0
  277. package/lib/typescript/credential/trustmark/get-credential-trustmark.d.ts +52 -0
  278. package/lib/typescript/credential/trustmark/get-credential-trustmark.d.ts.map +1 -0
  279. package/lib/typescript/credential/trustmark/index.d.ts +4 -0
  280. package/lib/typescript/credential/trustmark/index.d.ts.map +1 -0
  281. package/lib/typescript/index.d.ts +3 -1
  282. package/lib/typescript/index.d.ts.map +1 -1
  283. package/lib/typescript/pid/sd-jwt/types.d.ts +103 -25
  284. package/lib/typescript/pid/sd-jwt/types.d.ts.map +1 -1
  285. package/lib/typescript/sd-jwt/index.d.ts +20 -72
  286. package/lib/typescript/sd-jwt/index.d.ts.map +1 -1
  287. package/lib/typescript/sd-jwt/types.d.ts +24 -129
  288. package/lib/typescript/sd-jwt/types.d.ts.map +1 -1
  289. package/lib/typescript/trust/chain.d.ts +23 -0
  290. package/lib/typescript/trust/chain.d.ts.map +1 -0
  291. package/lib/typescript/trust/errors.d.ts +102 -0
  292. package/lib/typescript/trust/errors.d.ts.map +1 -0
  293. package/lib/typescript/{entity/trust → trust}/index.d.ts +308 -281
  294. package/lib/typescript/trust/index.d.ts.map +1 -0
  295. package/lib/typescript/{entity/trust → trust}/types.d.ts +1714 -1301
  296. package/lib/typescript/{entity/trust → trust}/types.d.ts.map +1 -1
  297. package/lib/typescript/trust/utils.d.ts +22 -0
  298. package/lib/typescript/trust/utils.d.ts.map +1 -0
  299. package/lib/typescript/utils/crypto.d.ts +0 -32
  300. package/lib/typescript/utils/crypto.d.ts.map +1 -1
  301. package/lib/typescript/utils/decoder.d.ts.map +1 -1
  302. package/lib/typescript/utils/error-codes.d.ts +20 -0
  303. package/lib/typescript/utils/error-codes.d.ts.map +1 -1
  304. package/lib/typescript/utils/errors.d.ts +55 -10
  305. package/lib/typescript/utils/errors.d.ts.map +1 -1
  306. package/lib/typescript/utils/logging.d.ts +35 -0
  307. package/lib/typescript/utils/logging.d.ts.map +1 -0
  308. package/lib/typescript/utils/misc.d.ts.map +1 -1
  309. package/lib/typescript/utils/par.d.ts +8 -1
  310. package/lib/typescript/utils/par.d.ts.map +1 -1
  311. package/lib/typescript/utils/string.d.ts +0 -7
  312. package/lib/typescript/utils/string.d.ts.map +1 -1
  313. package/lib/typescript/wallet-instance/index.d.ts +8 -0
  314. package/lib/typescript/wallet-instance/index.d.ts.map +1 -1
  315. package/lib/typescript/wallet-instance-attestation/index.d.ts +1 -2
  316. package/lib/typescript/wallet-instance-attestation/index.d.ts.map +1 -1
  317. package/lib/typescript/wallet-instance-attestation/issuing.d.ts +4 -2
  318. package/lib/typescript/wallet-instance-attestation/issuing.d.ts.map +1 -1
  319. package/lib/typescript/wallet-instance-attestation/types.d.ts +60 -102
  320. package/lib/typescript/wallet-instance-attestation/types.d.ts.map +1 -1
  321. package/package.json +9 -10
  322. package/src/client/generated/wallet-provider.ts +52 -17
  323. package/src/credential/index.ts +4 -1
  324. package/src/credential/issuance/01-start-flow.ts +1 -1
  325. package/src/credential/issuance/02-evaluate-issuer-trust.ts +32 -0
  326. package/src/credential/issuance/03-start-user-authorization.ts +48 -22
  327. package/src/credential/issuance/04-complete-user-authorization.ts +74 -18
  328. package/src/credential/issuance/05-authorize-access.ts +29 -11
  329. package/src/credential/issuance/06-obtain-credential.ts +61 -36
  330. package/src/credential/issuance/07-verify-and-parse-credential.ts +37 -264
  331. package/src/credential/issuance/README.md +23 -20
  332. package/src/credential/issuance/const.ts +1 -1
  333. package/src/credential/issuance/index.ts +6 -3
  334. package/src/credential/presentation/01-start-flow.ts +19 -22
  335. package/src/credential/presentation/02-evaluate-rp-trust.ts +5 -4
  336. package/src/credential/presentation/03-get-request-object.ts +36 -8
  337. package/src/credential/presentation/04-retrieve-rp-jwks.ts +6 -148
  338. package/src/credential/presentation/05-verify-request-object.ts +115 -30
  339. package/src/credential/presentation/06-fetch-presentation-definition.ts +5 -35
  340. package/src/credential/presentation/07-evaluate-dcql-query.ts +132 -161
  341. package/src/credential/presentation/07-evaluate-input-descriptor.ts +136 -254
  342. package/src/credential/presentation/08-send-authorization-response.ts +178 -260
  343. package/src/credential/presentation/README.md +74 -79
  344. package/src/credential/presentation/errors.ts +38 -15
  345. package/src/credential/presentation/index.ts +18 -19
  346. package/src/credential/presentation/types.ts +67 -64
  347. package/src/credential/status/01-start-flow.ts +9 -0
  348. package/src/credential/status/02-status-attestation.ts +105 -0
  349. package/src/credential/status/03-verify-and-parse-status-attestation.ts +70 -0
  350. package/src/credential/status/README.md +67 -0
  351. package/src/credential/status/index.ts +22 -0
  352. package/src/credential/status/types.ts +43 -0
  353. package/src/credential/trustmark/README.md +62 -0
  354. package/src/credential/trustmark/get-credential-trustmark.ts +139 -0
  355. package/src/credential/trustmark/index.ts +8 -0
  356. package/src/index.ts +4 -0
  357. package/src/pid/sd-jwt/types.ts +18 -1
  358. package/src/sd-jwt/__test__/index.test.ts +36 -55
  359. package/src/sd-jwt/__test__/types.test.ts +16 -29
  360. package/src/sd-jwt/index.ts +1 -5
  361. package/src/sd-jwt/types.ts +2 -19
  362. package/src/trust/README.md +147 -0
  363. package/src/trust/chain.ts +227 -0
  364. package/src/trust/errors.ts +136 -0
  365. package/src/{entity/trust → trust}/index.ts +207 -25
  366. package/src/{entity/trust → trust}/types.ts +24 -37
  367. package/src/trust/utils.ts +70 -0
  368. package/src/utils/crypto.ts +4 -106
  369. package/src/utils/decoder.ts +6 -1
  370. package/src/utils/error-codes.ts +23 -0
  371. package/src/utils/errors.ts +119 -15
  372. package/src/utils/logging.ts +68 -0
  373. package/src/utils/misc.ts +5 -0
  374. package/src/utils/par.ts +19 -6
  375. package/src/utils/string.ts +0 -10
  376. package/src/wallet-instance/index.ts +30 -1
  377. package/src/wallet-instance-attestation/README.md +8 -3
  378. package/src/wallet-instance-attestation/index.ts +2 -2
  379. package/src/wallet-instance-attestation/issuing.ts +33 -12
  380. package/src/wallet-instance-attestation/types.ts +18 -22
  381. package/lib/commonjs/credential/issuance/02-get-issuer-config.js +0 -48
  382. package/lib/commonjs/credential/issuance/02-get-issuer-config.js.map +0 -1
  383. package/lib/commonjs/entity/openid-connect/issuer/index.js +0 -25
  384. package/lib/commonjs/entity/openid-connect/issuer/index.js.map +0 -1
  385. package/lib/commonjs/entity/openid-connect/issuer/types.js +0 -64
  386. package/lib/commonjs/entity/openid-connect/issuer/types.js.map +0 -1
  387. package/lib/commonjs/entity/trust/chain.js +0 -122
  388. package/lib/commonjs/entity/trust/chain.js.map +0 -1
  389. package/lib/commonjs/entity/trust/index.js +0 -148
  390. package/lib/commonjs/entity/trust/index.js.map +0 -1
  391. package/lib/commonjs/entity/trust/types.js.map +0 -1
  392. package/lib/commonjs/mdoc/converters.js +0 -26
  393. package/lib/commonjs/mdoc/converters.js.map +0 -1
  394. package/lib/commonjs/mdoc/index.js +0 -68
  395. package/lib/commonjs/mdoc/index.js.map +0 -1
  396. package/lib/commonjs/utils/credential/issuance/07-verify-and-parse-credentials-inputs.js +0 -469
  397. package/lib/commonjs/utils/credential/issuance/07-verify-and-parse-credentials-inputs.js.map +0 -1
  398. package/lib/commonjs/utils/credential/issuance/07-verify-and-parse-credentials-utils.js +0 -90
  399. package/lib/commonjs/utils/credential/issuance/07-verify-and-parse-credentials-utils.js.map +0 -1
  400. package/lib/module/credential/issuance/02-get-issuer-config.js +0 -42
  401. package/lib/module/credential/issuance/02-get-issuer-config.js.map +0 -1
  402. package/lib/module/entity/openid-connect/issuer/index.js +0 -20
  403. package/lib/module/entity/openid-connect/issuer/index.js.map +0 -1
  404. package/lib/module/entity/openid-connect/issuer/types.js +0 -48
  405. package/lib/module/entity/openid-connect/issuer/types.js.map +0 -1
  406. package/lib/module/entity/trust/chain.js +0 -113
  407. package/lib/module/entity/trust/chain.js.map +0 -1
  408. package/lib/module/entity/trust/index.js +0 -131
  409. package/lib/module/entity/trust/index.js.map +0 -1
  410. package/lib/module/entity/trust/types.js.map +0 -1
  411. package/lib/module/mdoc/converters.js +0 -20
  412. package/lib/module/mdoc/converters.js.map +0 -1
  413. package/lib/module/mdoc/index.js +0 -60
  414. package/lib/module/mdoc/index.js.map +0 -1
  415. package/lib/module/utils/credential/issuance/07-verify-and-parse-credentials-inputs.js +0 -462
  416. package/lib/module/utils/credential/issuance/07-verify-and-parse-credentials-inputs.js.map +0 -1
  417. package/lib/module/utils/credential/issuance/07-verify-and-parse-credentials-utils.js +0 -83
  418. package/lib/module/utils/credential/issuance/07-verify-and-parse-credentials-utils.js.map +0 -1
  419. package/lib/typescript/credential/issuance/02-get-issuer-config.d.ts +0 -32
  420. package/lib/typescript/credential/issuance/02-get-issuer-config.d.ts.map +0 -1
  421. package/lib/typescript/entity/openid-connect/issuer/index.d.ts +0 -12
  422. package/lib/typescript/entity/openid-connect/issuer/index.d.ts.map +0 -1
  423. package/lib/typescript/entity/openid-connect/issuer/types.d.ts +0 -777
  424. package/lib/typescript/entity/openid-connect/issuer/types.d.ts.map +0 -1
  425. package/lib/typescript/entity/trust/chain.d.ts +0 -26
  426. package/lib/typescript/entity/trust/chain.d.ts.map +0 -1
  427. package/lib/typescript/entity/trust/index.d.ts.map +0 -1
  428. package/lib/typescript/mdoc/converters.d.ts +0 -8
  429. package/lib/typescript/mdoc/converters.d.ts.map +0 -1
  430. package/lib/typescript/mdoc/index.d.ts +0 -10
  431. package/lib/typescript/mdoc/index.d.ts.map +0 -1
  432. package/lib/typescript/utils/credential/issuance/07-verify-and-parse-credentials-inputs.d.ts +0 -3
  433. package/lib/typescript/utils/credential/issuance/07-verify-and-parse-credentials-inputs.d.ts.map +0 -1
  434. package/lib/typescript/utils/credential/issuance/07-verify-and-parse-credentials-utils.d.ts +0 -42
  435. package/lib/typescript/utils/credential/issuance/07-verify-and-parse-credentials-utils.d.ts.map +0 -1
  436. package/src/credential/issuance/02-get-issuer-config.ts +0 -67
  437. package/src/entity/openid-connect/issuer/index.ts +0 -27
  438. package/src/entity/openid-connect/issuer/types.ts +0 -76
  439. package/src/entity/trust/chain.ts +0 -154
  440. package/src/mdoc/converters.ts +0 -26
  441. package/src/mdoc/index.ts +0 -95
  442. package/src/utils/credential/issuance/07-verify-and-parse-credentials-inputs.ts +0 -615
  443. package/src/utils/credential/issuance/07-verify-and-parse-credentials-utils.ts +0 -171
package/README.md CHANGED
@@ -1,7 +1,10 @@
1
1
  # 🪪 @pagopa/io-react-native-wallet
2
2
 
3
+ > [!WARNING]
4
+ > The work to align the library to IT-Wallet v1.0.0 is still ongoing. After implementing the updated specs, the library will be published as v2. For IT-Wallet v0.7.1 please use v0.3.0.
5
+
3
6
  Library which provides a high level abstraction to interact with the IT-Wallet ecosystem via a predefined flows, a set of utilities and helpers.
4
- Follows the [eudi-wallet-it-docs](https://github.com/italia/eudi-wallet-it-docs) specifications, currently aligned with version [0.7.1](https://github.com/italia/eudi-wallet-it-docs/releases/tag/0.7.1).
7
+ Follows the [eudi-wallet-it-docs](https://github.com/italia/eudi-wallet-it-docs) specifications, currently aligned with version [1.0.0](https://github.com/italia/eudi-wallet-it-docs/releases/tag/1.0.0).
5
8
 
6
9
  ## Dependencies
7
10
 
@@ -96,6 +99,45 @@ The suggested library to manage integrity is [io-react-native-integrity](https:/
96
99
 
97
100
  </details>
98
101
 
102
+ <details>
103
+ <summary>LoggingContext (logging)</summary>
104
+
105
+ In order to log useful information while implementing the flows, the library supports custom logging logic by providing a `loggingContext` to the static `Logger` class:
106
+
107
+ ```ts
108
+ export interface LoggingContext {
109
+ logDebug: (msg: string) => void;
110
+ logInfo: (msg: string) => void;
111
+ logWarn: (msg: string) => void;
112
+ logError: (msg: string) => void;
113
+ }
114
+ ```
115
+
116
+ An example of a custom logging context:
117
+
118
+ ```ts
119
+ import { Logging } from "@pagopa/io-react-native-wallet";
120
+
121
+ const loggingContext: Logging.LoggingContext = {
122
+ logDebug(msg: string) {
123
+ console.log("debug", msg);
124
+ },
125
+ logInfo(msg: string) {
126
+ console.log("info", msg);
127
+ },
128
+ logWarn(msg: string) {
129
+ console.log("warn", msg);
130
+ },
131
+ logError(msg: string) {
132
+ console.log("error", msg);
133
+ },
134
+ };
135
+
136
+ Logging.Logger.getInstance().initLogging(loggingContext);
137
+ ```
138
+
139
+ </details>
140
+
99
141
  <details>
100
142
  <summary>appFetch (making HTTP requests)</summary>
101
143
 
@@ -120,6 +162,10 @@ Different flows are provided to perform common operations. Each flow is a set of
120
162
 
121
163
  An example app is provided in [example](./example) folder which demostrates how to implemente these flows. To run it, follow the instructions in the [README](./example/README.md).
122
164
 
165
+ ### Debug logging server
166
+
167
+ A debug logging server can be used with the example app to receive logs from the app. To run it, follow the instructions in the [README](./debug-logging-server/README.md).
168
+
123
169
  ### Ecosystem
124
170
 
125
171
  `io-react-native-wallet` is designed to be used in [io-app](https://github.com/pagopa/io-app) and its ecosystem. There are a few libraries that can be used to implement the context required to implement the flows defined by this package.
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.WalletInstanceData = exports.WalletAttestationView = exports.SetWalletInstanceStatusBody = exports.RevocationReason = exports.ProblemDetail = exports.NonceDetailView = exports.EndpointByMethod = exports.CreateWalletInstanceBody = exports.CreateWalletAttestationBody = exports.ApiClient = void 0;
6
+ exports.WalletInstanceData = exports.WalletAttestationsView = exports.WalletAttestationView = exports.SetWalletInstanceStatusBody = exports.RevocationReason = exports.ProblemDetail = exports.NonceDetailView = exports.EndpointByMethod = exports.CreateWalletInstanceBody = exports.CreateWalletAttestationV2Body = exports.CreateWalletAttestationBody = exports.ApiClient = void 0;
7
7
  exports.createApiClient = createApiClient;
8
- exports.put_SetWalletInstanceStatus = exports.post_CreateWalletInstance = exports.post_CreateWalletAttestation = exports.get_GetWalletInstanceStatus = exports.get_GetNonce = void 0;
8
+ exports.put_SetWalletInstanceStatus = exports.post_CreateWalletInstance = exports.post_CreateWalletAttestationV2 = exports.post_CreateWalletAttestation = exports.get_GetWalletInstanceStatus = exports.get_GetNonce = exports.get_GetCurrentWalletInstanceStatus = void 0;
9
9
  var _zod = _interopRequireDefault(require("zod"));
10
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
11
  const NonceDetailView = _zod.default.object({
@@ -16,6 +16,13 @@ const WalletAttestationView = _zod.default.object({
16
16
  wallet_attestation: _zod.default.string()
17
17
  });
18
18
  exports.WalletAttestationView = WalletAttestationView;
19
+ const WalletAttestationsView = _zod.default.object({
20
+ wallet_attestations: _zod.default.array(_zod.default.object({
21
+ format: _zod.default.union([_zod.default.literal("jwt"), _zod.default.literal("dc+sd-jwt")]),
22
+ wallet_attestation: _zod.default.string()
23
+ }))
24
+ });
25
+ exports.WalletAttestationsView = WalletAttestationsView;
19
26
  const CreateWalletInstanceBody = _zod.default.object({
20
27
  challenge: _zod.default.string(),
21
28
  key_attestation: _zod.default.string(),
@@ -27,14 +34,10 @@ const CreateWalletAttestationBody = _zod.default.object({
27
34
  assertion: _zod.default.string()
28
35
  });
29
36
  exports.CreateWalletAttestationBody = CreateWalletAttestationBody;
30
- const ProblemDetail = _zod.default.object({
31
- type: _zod.default.string().optional(),
32
- title: _zod.default.string().optional(),
33
- status: _zod.default.number().optional(),
34
- detail: _zod.default.string().optional(),
35
- instance: _zod.default.string().optional()
37
+ const CreateWalletAttestationV2Body = _zod.default.object({
38
+ assertion: _zod.default.string()
36
39
  });
37
- exports.ProblemDetail = ProblemDetail;
40
+ exports.CreateWalletAttestationV2Body = CreateWalletAttestationV2Body;
38
41
  const SetWalletInstanceStatusBody = _zod.default.object({
39
42
  status: _zod.default.literal("REVOKED")
40
43
  });
@@ -47,6 +50,14 @@ const WalletInstanceData = _zod.default.object({
47
50
  revocation_reason: _zod.default.union([RevocationReason, _zod.default.undefined()]).optional()
48
51
  });
49
52
  exports.WalletInstanceData = WalletInstanceData;
53
+ const ProblemDetail = _zod.default.object({
54
+ type: _zod.default.string().optional(),
55
+ title: _zod.default.string().optional(),
56
+ status: _zod.default.number().optional(),
57
+ detail: _zod.default.string().optional(),
58
+ instance: _zod.default.string().optional()
59
+ });
60
+ exports.ProblemDetail = ProblemDetail;
50
61
  const get_GetNonce = {
51
62
  method: _zod.default.literal("GET"),
52
63
  path: _zod.default.literal("/nonce"),
@@ -63,6 +74,31 @@ const post_CreateWalletInstance = {
63
74
  response: _zod.default.unknown()
64
75
  };
65
76
  exports.post_CreateWalletInstance = post_CreateWalletInstance;
77
+ const post_CreateWalletAttestation = {
78
+ method: _zod.default.literal("POST"),
79
+ path: _zod.default.literal("/token"),
80
+ parameters: _zod.default.object({
81
+ body: CreateWalletAttestationBody
82
+ }),
83
+ response: WalletAttestationView
84
+ };
85
+ exports.post_CreateWalletAttestation = post_CreateWalletAttestation;
86
+ const post_CreateWalletAttestationV2 = {
87
+ method: _zod.default.literal("POST"),
88
+ path: _zod.default.literal("/wallet-attestations"),
89
+ parameters: _zod.default.object({
90
+ body: CreateWalletAttestationV2Body
91
+ }),
92
+ response: WalletAttestationsView
93
+ };
94
+ exports.post_CreateWalletAttestationV2 = post_CreateWalletAttestationV2;
95
+ const get_GetCurrentWalletInstanceStatus = {
96
+ method: _zod.default.literal("GET"),
97
+ path: _zod.default.literal("/wallet-instances/current/status"),
98
+ parameters: _zod.default.never(),
99
+ response: WalletInstanceData
100
+ };
101
+ exports.get_GetCurrentWalletInstanceStatus = get_GetCurrentWalletInstanceStatus;
66
102
  const get_GetWalletInstanceStatus = {
67
103
  method: _zod.default.literal("GET"),
68
104
  path: _zod.default.literal("/wallet-instances/{id}/status"),
@@ -85,26 +121,19 @@ const put_SetWalletInstanceStatus = {
85
121
  }),
86
122
  response: _zod.default.unknown()
87
123
  };
88
- exports.put_SetWalletInstanceStatus = put_SetWalletInstanceStatus;
89
- const post_CreateWalletAttestation = {
90
- method: _zod.default.literal("POST"),
91
- path: _zod.default.literal("/token"),
92
- parameters: _zod.default.object({
93
- body: CreateWalletAttestationBody
94
- }),
95
- response: WalletAttestationView
96
- };
97
124
 
98
125
  // <EndpointByMethod>
99
- exports.post_CreateWalletAttestation = post_CreateWalletAttestation;
126
+ exports.put_SetWalletInstanceStatus = put_SetWalletInstanceStatus;
100
127
  const EndpointByMethod = {
101
128
  get: {
102
129
  "/nonce": get_GetNonce,
130
+ "/wallet-instances/current/status": get_GetCurrentWalletInstanceStatus,
103
131
  "/wallet-instances/{id}/status": get_GetWalletInstanceStatus
104
132
  },
105
133
  post: {
106
134
  "/wallet-instances": post_CreateWalletInstance,
107
- "/token": post_CreateWalletAttestation
135
+ "/token": post_CreateWalletAttestation,
136
+ "/wallet-attestations": post_CreateWalletAttestationV2
108
137
  },
109
138
  put: {
110
139
  "/wallet-instances/{id}/status": put_SetWalletInstanceStatus
@@ -1 +1 @@
1
- {"version":3,"names":["_zod","_interopRequireDefault","require","obj","__esModule","default","NonceDetailView","z","object","nonce","string","exports","WalletAttestationView","wallet_attestation","CreateWalletInstanceBody","challenge","key_attestation","hardware_key_tag","CreateWalletAttestationBody","grant_type","literal","assertion","ProblemDetail","type","optional","title","status","number","detail","instance","SetWalletInstanceStatusBody","RevocationReason","union","WalletInstanceData","id","is_revoked","boolean","revocation_reason","undefined","get_GetNonce","method","path","parameters","never","response","post_CreateWalletInstance","body","unknown","get_GetWalletInstanceStatus","put_SetWalletInstanceStatus","post_CreateWalletAttestation","EndpointByMethod","get","post","put","ApiClient","baseUrl","constructor","fetcher","setBaseUrl","arguments","length","createApiClient"],"sourceRoot":"../../../../src","sources":["client/generated/wallet-provider.ts"],"mappings":";;;;;;;;AAAA,IAAAA,IAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAoB,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAGb,MAAMG,eAAe,GAAGC,YAAC,CAACC,MAAM,CAAC;EACtCC,KAAK,EAAEF,YAAC,CAACG,MAAM,CAAC;AAClB,CAAC,CAAC;AAACC,OAAA,CAAAL,eAAA,GAAAA,eAAA;AAGI,MAAMM,qBAAqB,GAAGL,YAAC,CAACC,MAAM,CAAC;EAC5CK,kBAAkB,EAAEN,YAAC,CAACG,MAAM,CAAC;AAC/B,CAAC,CAAC;AAACC,OAAA,CAAAC,qBAAA,GAAAA,qBAAA;AAGI,MAAME,wBAAwB,GAAGP,YAAC,CAACC,MAAM,CAAC;EAC/CO,SAAS,EAAER,YAAC,CAACG,MAAM,CAAC,CAAC;EACrBM,eAAe,EAAET,YAAC,CAACG,MAAM,CAAC,CAAC;EAC3BO,gBAAgB,EAAEV,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EAEpBC,WAAWA,CAAQC,OAAgB,EAAE;IAAA,KAAlBA,OAAgB,GAAhBA,OAAgB;EAAG;EAEtCC,UAAUA,CAACH,OAAe,EAAE;IAC1B,IAAI,CAACA,OAAO,GAAGA,OAAO;IACtB,OAAO,IAAI;EACb;;EAEA;EACAJ,GAAGA,CACDX,IAAU,EAE+B;IACzC,OAAO,IAAI,CAACiB,OAAO,CAAC,KAAK,EAAE,IAAI,CAACF,OAAO,GAAGf,IAAI,EAAAmB,SAAA,CAAAC,MAAA,QAAAvB,SAAA,GAAAsB,SAAA,GAAW,CAAC;EAC5D;EACA;;EAEA;EACAP,IAAIA,CACFZ,IAAU,EAE+B;IACzC,OAAO,IAAI,CAACiB,OAAO,CAAC,MAAM,EAAE,IAAI,CAACF,OAAO,GAAGf,IAAI,EAAAmB,SAAA,CAAAC,MAAA,QAAAvB,SAAA,GAAAsB,SAAA,GAAW,CAAC;EAC7D;EACA;;EAEA;EACAN,GAAGA,CACDb,IAAU,EAE+B;IACzC,OAAO,IAAI,CAACiB,OAAO,CAAC,KAAK,EAAE,IAAI,CAACF,OAAO,GAAGf,IAAI,EAAAmB,SAAA,CAAAC,MAAA,QAAAvB,SAAA,GAAAsB,SAAA,GAAW,CAAC;EAC5D;EACA;AACF;AAACjD,OAAA,CAAA4C,SAAA,GAAAA,SAAA;AAEM,SAASO,eAAeA,CAACJ,OAAgB,EAAEF,OAAgB,EAAE;EAClE,OAAO,IAAID,SAAS,CAACG,OAAO,CAAC,CAACC,UAAU,CAACH,OAAO,IAAI,EAAE,CAAC;AACzD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA"}
1
+ {"version":3,"names":["_zod","_interopRequireDefault","require","obj","__esModule","default","NonceDetailView","z","object","nonce","string","exports","WalletAttestationView","wallet_attestation","WalletAttestationsView","wallet_attestations","array","format","union","literal","CreateWalletInstanceBody","challenge","key_attestation","hardware_key_tag","CreateWalletAttestationBody","grant_type","assertion","CreateWalletAttestationV2Body","SetWalletInstanceStatusBody","status","RevocationReason","WalletInstanceData","id","is_revoked","boolean","revocation_reason","undefined","optional","ProblemDetail","type","title","number","detail","instance","get_GetNonce","method","path","parameters","never","response","post_CreateWalletInstance","body","unknown","post_CreateWalletAttestation","post_CreateWalletAttestationV2","get_GetCurrentWalletInstanceStatus","get_GetWalletInstanceStatus","put_SetWalletInstanceStatus","EndpointByMethod","get","post","put","ApiClient","baseUrl","constructor","fetcher","setBaseUrl","arguments","length","createApiClient"],"sourceRoot":"../../../../src","sources":["client/generated/wallet-provider.ts"],"mappings":";;;;;;;;AAAA,IAAAA,IAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAoB,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAGb,MAAMG,eAAe,GAAGC,YAAC,CAACC,MAAM,CAAC;EACtCC,KAAK,EAAEF,YAAC,CAACG,MAAM,CAAC;AAClB,CAAC,CAAC;AAACC,OAAA,CAAAL,eAAA,GAAAA,eAAA;AAGI,MAAMM,qBAAqB,GAAGL,YAAC,CAACC,MAAM,CAAC;EAC5CK,kBAAkB,EAAEN,YAAC,CAACG,MAAM,CAAC;AAC/B,CAAC,CAAC;AAACC,OAAA,CAAAC,qBAAA,GAAAA,qBAAA;AAGI,MAAME,sBAAsB,GAAGP,YAAC,CAACC,MAAM,CAAC;EAC7CO,mBAAmB,EAAER,YAAC,CAACS,KAAK,CAC1BT,YAAC,CAACC,MAAM,CAAC;IACPS,MAAM,EAAEV,YAAC,CAACW,KAAK,CAAC,CAACX,YAAC,CAACY,OAAO,CAAC,KAAK,CAAC,EAAEZ,YAAC,CAACY,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;IAC3DN,kBAAkB,EAAEN,YAAC,CAACG,MAAM,CAAC;EAC/B,CAAC,CACH;AACF,CAAC,CAAC;AAACC,OAAA,CAAAG,sBAAA,GAAAA,sBAAA;AAGI,MAAM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C,OAAO,IAAI,CAACmB,OAAO,CAAC,KAAK,EAAE,IAAI,CAACF,OAAO,GAAGjB,IAAI,EAAAqB,SAAA,CAAAC,MAAA,QAAAhC,SAAA,GAAA+B,SAAA,GAAW,CAAC;EAC5D;EACA;;EAEA;EACAP,IAAIA,CACFd,IAAU,EAE+B;IACzC,OAAO,IAAI,CAACmB,OAAO,CAAC,MAAM,EAAE,IAAI,CAACF,OAAO,GAAGjB,IAAI,EAAAqB,SAAA,CAAAC,MAAA,QAAAhC,SAAA,GAAA+B,SAAA,GAAW,CAAC;EAC7D;EACA;;EAEA;EACAN,GAAGA,CACDf,IAAU,EAE+B;IACzC,OAAO,IAAI,CAACmB,OAAO,CAAC,KAAK,EAAE,IAAI,CAACF,OAAO,GAAGjB,IAAI,EAAAqB,SAAA,CAAAC,MAAA,QAAAhC,SAAA,GAAA+B,SAAA,GAAW,CAAC;EAC5D;EACA;AACF;AAACxD,OAAA,CAAAmD,SAAA,GAAAA,SAAA;AAEM,SAASO,eAAeA,CAACJ,OAAgB,EAAEF,OAAgB,EAAE;EAClE,OAAO,IAAID,SAAS,CAACG,OAAO,CAAC,CAACC,UAAU,CAACH,OAAO,IAAI,EAAE,CAAC;AACzD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA"}
@@ -3,11 +3,15 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.Presentation = exports.Issuance = void 0;
6
+ exports.Trustmark = exports.Status = exports.Presentation = exports.Issuance = void 0;
7
7
  var Issuance = _interopRequireWildcard(require("./issuance"));
8
8
  exports.Issuance = Issuance;
9
9
  var Presentation = _interopRequireWildcard(require("./presentation"));
10
10
  exports.Presentation = Presentation;
11
+ var Status = _interopRequireWildcard(require("./status"));
12
+ exports.Status = Status;
13
+ var Trustmark = _interopRequireWildcard(require("./trustmark"));
14
+ exports.Trustmark = Trustmark;
11
15
  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); }
12
16
  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; }
13
17
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Issuance","_interopRequireWildcard","require","exports","Presentation","_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/index.ts"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAuCC,OAAA,CAAAH,QAAA,GAAAA,QAAA;AACvC,IAAAI,YAAA,GAAAH,uBAAA,CAAAC,OAAA;AAA+CC,OAAA,CAAAC,YAAA,GAAAA,YAAA;AAAA,SAAAC,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,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA"}
1
+ {"version":3,"names":["Issuance","_interopRequireWildcard","require","exports","Presentation","Status","Trustmark","_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/index.ts"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAuCC,OAAA,CAAAH,QAAA,GAAAA,QAAA;AACvC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AAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.evaluateIssuerTrust = void 0;
7
+ var _trust = require("../../trust");
8
+ /**
9
+ * WARNING: This function must be called after {@link startFlow}. The next function to be called is {@link startUserAuthorization}.
10
+ * The Issuer trust evaluation phase.
11
+ * Fetch the Issuer's configuration and verify trust.
12
+ *
13
+ * @param issuerUrl The base url of the Issuer returned by {@link startFlow}
14
+ * @param context.appFetch (optional) fetch api implementation. Default: built-in fetch
15
+ * @returns The Issuer's configuration
16
+ */
17
+ const evaluateIssuerTrust = async function (issuerUrl) {
18
+ let context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
19
+ const issuerConf = await (0, _trust.getCredentialIssuerEntityConfiguration)(issuerUrl, {
20
+ appFetch: context.appFetch
21
+ }).then(_ => _.payload.metadata);
22
+ return {
23
+ issuerConf
24
+ };
25
+ };
26
+ exports.evaluateIssuerTrust = evaluateIssuerTrust;
27
+ //# sourceMappingURL=02-evaluate-issuer-trust.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_trust","require","evaluateIssuerTrust","issuerUrl","context","arguments","length","undefined","issuerConf","getCredentialIssuerEntityConfiguration","appFetch","then","_","payload","metadata","exports"],"sourceRoot":"../../../../src","sources":["credential/issuance/02-evaluate-issuer-trust.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,mBAAwC,GAAG,eAAAA,CACtDC,SAAS,EAEN;EAAA,IADHC,OAAO,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAEZ,MAAMG,UAAU,GAAG,MAAM,IAAAC,6CAAsC,EAACN,SAAS,EAAE;IACzEO,QAAQ,EAAEN,OAAO,CAACM;EACpB,CAAC,CAAC,CAACC,IAAI,CAAEC,CAAC,IAAKA,CAAC,CAACC,OAAO,CAACC,QAAQ,CAAC;EAClC,OAAO;IAAEN;EAAW,CAAC;AACvB,CAAC;AAACO,OAAA,CAAAb,mBAAA,GAAAA,mBAAA"}
@@ -6,10 +6,12 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.startUserAuthorization = void 0;
7
7
  var _misc = require("../../utils/misc");
8
8
  var _par = require("../../utils/par");
9
+ var _const = require("./const");
10
+ var _logging = require("../../utils/logging");
9
11
  /**
10
12
  * Ensures that the credential type requested is supported by the issuer and contained in the
11
13
  * issuer configuration.
12
- * @param issuerConf The issuer configuration returned by {@link getIssuerConfig}
14
+ * @param issuerConf The issuer configuration returned by {@link evaluateIssuerTrust}
13
15
  * @param credentialType The type of the credential to be requested returned by {@link startFlow}
14
16
  * @param context.wiaCryptoContext The Wallet Instance's crypto context
15
17
  * @param context.walletInstanceAttestation The Wallet Instance's attestation
@@ -18,16 +20,16 @@ var _par = require("../../utils/par");
18
20
  * @returns The credential definition to be used in the request which includes the format and the type and its type
19
21
  */
20
22
  const selectCredentialDefinition = (issuerConf, credentialType) => {
21
- const credential_configurations_supported = issuerConf.credential_configurations_supported;
22
- const credential = credential_configurations_supported[credentialType];
23
- if (!credential) {
24
- throw new Error(`No credential support the type '${credentialType}'`);
25
- }
26
- const result = {
23
+ const credential_configurations_supported = issuerConf.openid_credential_issuer.credential_configurations_supported;
24
+ const [result] = Object.keys(credential_configurations_supported).filter(e => e.includes(credentialType)).map(e => ({
27
25
  credential_configuration_id: credentialType,
28
- format: credential.format,
26
+ format: credential_configurations_supported[e].format,
29
27
  type: "openid_credential"
30
- };
28
+ }));
29
+ if (!result) {
30
+ _logging.Logger.log(_logging.LogLevel.ERROR, `Requested credential type ${credentialType} is not supported by the issuer according to its configuration ${JSON.stringify(credential_configurations_supported)}`);
31
+ throw new Error(`No credential support the type '${credentialType}'`);
32
+ }
31
33
  return result;
32
34
  };
33
35
 
@@ -35,15 +37,21 @@ const selectCredentialDefinition = (issuerConf, credentialType) => {
35
37
  * Ensures that the response mode requested is supported by the issuer and contained in the issuer configuration.
36
38
  * @param issuerConf The issuer configuration
37
39
  * @param credentialType The type of the credential to be requested
38
- * @returns The response mode to be used in the request, "query" for urn:eu.europa.ec.eudi:pid:1 and "form_post.jwt" for all other types.
40
+ * @returns The response mode to be used in the request, "query" for PersonIdentificationData and "form_post.jwt" for all other types.
39
41
  */
40
- const selectResponseMode = credentialType => {
41
- const responseMode = credentialType === "urn:eu.europa.ec.eudi:pid:1" ? "query" : "form_post.jwt";
42
+ const selectResponseMode = (issuerConf, credentialType) => {
43
+ const responseModeSupported = issuerConf.oauth_authorization_server.response_modes_supported;
44
+ const responseMode = credentialType === "PersonIdentificationData" ? "query" : "form_post.jwt";
45
+ _logging.Logger.log(_logging.LogLevel.DEBUG, `Selected response mode ${responseMode} for credential type ${credentialType}`);
46
+ if (!responseModeSupported.includes(responseMode)) {
47
+ _logging.Logger.log(_logging.LogLevel.ERROR, `Requested response mode ${responseMode} is not supported by the issuer according to its configuration ${JSON.stringify(responseModeSupported)}`);
48
+ throw new Error(`No response mode support the type '${credentialType}'`);
49
+ }
42
50
  return responseMode;
43
51
  };
44
52
 
45
53
  /**
46
- * WARNING: This function must be called after {@link getIssuerConfig} and {@link startFlow}. The next steam is {@link compeUserAuthorizationWithQueryMode} or {@link compeUserAuthorizationWithFormPostJwtMode}
54
+ * WARNING: This function must be called after {@link evaluateIssuerTrust} and {@link startFlow}. The next steam is {@link compeUserAuthorizationWithQueryMode} or {@link compeUserAuthorizationWithFormPostJwtMode}
47
55
  * Creates and sends a PAR request to the /as/par endpoint of the authorization server.
48
56
  * This starts the authentication flow to obtain an access token.
49
57
  * This token enables the Wallet Instance to request a digital credential from the Credential Endpoint of the Credential Issuer.
@@ -69,17 +77,18 @@ const startUserAuthorization = async (issuerConf, credentialType, ctx) => {
69
77
  } = ctx;
70
78
  const clientId = await wiaCryptoContext.getPublicKey().then(_ => _.kid);
71
79
  if (!clientId) {
80
+ _logging.Logger.log(_logging.LogLevel.ERROR, `Public key associated with kid ${clientId} not found in the device`);
72
81
  throw new Error("No public key found");
73
82
  }
74
83
  const codeVerifier = (0, _misc.generateRandomAlphaNumericString)(64);
75
- const parEndpoint = issuerConf.pushed_authorization_request_endpoint;
84
+ const parEndpoint = issuerConf.oauth_authorization_server.pushed_authorization_request_endpoint;
76
85
  const credentialDefinition = selectCredentialDefinition(issuerConf, credentialType);
77
- const responseMode = selectResponseMode(credentialType);
86
+ const responseMode = selectResponseMode(issuerConf, credentialType);
78
87
  const getPar = (0, _par.makeParRequest)({
79
88
  wiaCryptoContext,
80
89
  appFetch
81
90
  });
82
- const issuerRequestUri = await getPar(clientId, codeVerifier, redirectUri, responseMode, parEndpoint, walletInstanceAttestation, [credentialDefinition]);
91
+ const issuerRequestUri = await getPar(clientId, codeVerifier, redirectUri, responseMode, parEndpoint, walletInstanceAttestation, [credentialDefinition], _const.ASSERTION_TYPE);
83
92
  return {
84
93
  issuerRequestUri,
85
94
  clientId,
@@ -1 +1 @@
1
- {"version":3,"names":["_misc","require","_par","selectCredentialDefinition","issuerConf","credentialType","credential_configurations_supported","credential","Error","result","credential_configuration_id","format","type","selectResponseMode","responseMode","startUserAuthorization","ctx","wiaCryptoContext","walletInstanceAttestation","redirectUri","appFetch","fetch","clientId","getPublicKey","then","_","kid","codeVerifier","generateRandomAlphaNumericString","parEndpoint","pushed_authorization_request_endpoint","credentialDefinition","getPar","makeParRequest","issuerRequestUri","exports"],"sourceRoot":"../../../../src","sources":["credential/issuance/03-start-user-authorization.ts"],"mappings":";;;;;;AAEA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,IAAA,GAAAD,OAAA;AAmBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAA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AMS,YAAY,GAAGD,kBAAkB,CAACR,cAAc,CAAC;EAEvD,MAAM2B,MAAM,GAAG,IAAAC,mBAAc,EAAC;IAAEhB,gBAAgB;IAAEG;EAAS,CAAC,CAAC;EAC7D,MAAMc,gBAAgB,GAAG,MAAMF,MAAM,CACnCV,QAAQ,EACRK,YAAY,EACZR,WAAW,EACXL,YAAY,EACZe,WAAW,EACXX,yBAAyB,EACzB,CAACa,oBAAoB,CACvB,CAAC;EAED,OAAO;IAAEG,gBAAgB;IAAEZ,QAAQ;IAAEK,YAAY;IAAEI;EAAqB,CAAC;AAC3E,CAAC;AAACI,OAAA,CAAApB,sBAAA,GAAAA,sBAAA"}
1
+ {"version":3,"names":["_misc","require","_par","_const","_logging","selectCredentialDefinition","issuerConf","credentialType","credential_configurations_supported","openid_credential_issuer","result","Object","keys","filter","e","includes","map","credential_configuration_id","format","type","Logger","log","LogLevel","ERROR","JSON","stringify","Error","selectResponseMode","responseModeSupported","oauth_authorization_server","response_modes_supported","responseMode","DEBUG","startUserAuthorization","ctx","wiaCryptoContext","walletInstanceAttestation","redirectUri","appFetch","fetch","clientId","getPublicKey","then","_","kid","codeVerifier","generateRandomAlphaNumericString","parEndpoint","pushed_authorization_request_endpoint","credentialDefinition","getPar","makeParRequest","issuerRequestUri","ASSERTION_TYPE","exports"],"sourceRoot":"../../../../src","sources":["credential/issuance/03-start-user-authorization.ts"],"mappings":";;;;;;AAEA,IAAAA,KAAA,GAAAC,OAAA;AAGA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAkBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMI,0BAA0B,GAAGA,CACjCC,UAAkD,EAClDC,cAAgD,KACxB;EACxB,MAAMC,mCAAmC,GACvCF,UAAU,CAACG,wBAAwB,CAACD,mCAAmC;EAEzE,MAAM,CAACE,MAAM,CAAC,GAAGC,MAAM,C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;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAME,sBAA8C,GAAG,MAAAA,CAC5D3B,UAAU,EACVC,cAAc,EACd2B,GAAG,KACA;EACH,MAAM;IACJC,gBAAgB;IAChBC,yBAAyB;IACzBC,WAAW;IACXC,QAAQ,GAAGC;EACb,CAAC,GAAGL,GAAG;EAEP,MAAMM,QAAQ,GAAG,MAAML,gBAAgB,CAACM,YAAY,CAAC,CAAC,CAACC,IAAI,CAAEC,CAAC,IAAKA,CAAC,CAACC,GAAG,CAAC;EACzE,IAAI,CAACJ,QAAQ,EAAE;IACbpB,eAAM,CAACC,GAAG,CACRC,iBAAQ,CAACC,KAAK,EACb,kCAAiCiB,QAAS,0BAC7C,CAAC;IACD,MAAM,IAAId,KAAK,CAAC,qBAAqB,CAAC;EACxC;EACA,MAAMmB,YAAY,GAAG,IAAAC,sCAAgC,EAAC,EAAE,CAAC;EACzD,MAAMC,WAAW,GACfzC,UAAU,CAACuB,0BAA0B,CAACmB,qCAAqC;EAC7E,MAAMC,oBAAoB,GAAG5C,0BAA0B,CACrDC,UAAU,EACVC,cACF,CAAC;EACD,MAAMwB,YAAY,GAAGJ,kBAAkB,CAACrB,UAAU,EAAEC,cAAc,CAAC;EAEnE,MAAM2C,MAAM,GAAG,IAAAC,mBAAc,EAAC;IAAEhB,gBAAgB;IAAEG;EAAS,CAAC,CAAC;EAC7D,MAAMc,gBAAgB,GAAG,MAAMF,MAAM,CACnCV,QAAQ,EACRK,YAAY,EACZR,WAAW,EACXN,YAAY,EACZgB,WAAW,EACXX,yBAAyB,EACzB,CAACa,oBAAoB,CAAC,EACtBI,qBACF,CAAC;EAED,OAAO;IAAED,gBAAgB;IAAEZ,QAAQ;IAAEK,YAAY;IAAEI;EAAqB,CAAC;AAC3E,CAAC;AAACK,OAAA,CAAArB,sBAAA,GAAAA,sBAAA"}
@@ -10,13 +10,14 @@ var _parseUrl = _interopRequireDefault(require("parse-url"));
10
10
  var _errors = require("../../utils/errors");
11
11
  var _ioReactNativeJwt = require("@pagopa/io-react-native-jwt");
12
12
  var _types = require("../presentation/types");
13
- var _reactNativeUuid = _interopRequireDefault(require("react-native-uuid"));
13
+ var _uuid = require("uuid");
14
14
  var _types2 = require("./types");
15
15
  var _decoder = require("../../utils/decoder");
16
16
  var _errors2 = require("./errors");
17
+ var _logging = require("../../utils/logging");
17
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
19
  /**
19
- * The interface of the phase to complete User authorization via strong identification when the response mode is "query" and the request credential is a urn:eu.europa.ec.eudi:pid:1.
20
+ * The interface of the phase to complete User authorization via strong identification when the response mode is "query" and the request credential is a PersonIdentificationData.
20
21
  */
21
22
 
22
23
  /**
@@ -24,19 +25,19 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
24
25
  * Builds the authorization URL to which the end user should be redirected to continue the authentication flow.
25
26
  * @param issuerRequestUri the URI of the issuer where the request is sent
26
27
  * @param clientId Identifies the current client across all the requests of the issuing flow returned by {@link startUserAuthorization}
27
- * @param issuerConf The issuer configuration returned by {@link getIssuerConfig}
28
- * @param idpHint Unique identifier of the IDP selected by the user
28
+ * @param issuerConf The issuer configuration returned by {@link evaluateIssuerTrust}
29
+ * @param idpHint Unique identifier of the IDP selected by the user (optional)
29
30
  * @returns An object containing the authorization URL
30
31
  */
31
32
  const buildAuthorizationUrl = async (issuerRequestUri, clientId, issuerConf, idpHint) => {
32
- const authzRequestEndpoint = issuerConf.authorization_endpoint;
33
+ const authzRequestEndpoint = issuerConf.oauth_authorization_server.authorization_endpoint;
33
34
  const params = new URLSearchParams({
34
35
  client_id: clientId,
35
- request_uri: issuerRequestUri,
36
- ...(idpHint && {
37
- idphint: idpHint
38
- })
36
+ request_uri: issuerRequestUri
39
37
  });
38
+ if (idpHint) {
39
+ params.append("idphint", idpHint);
40
+ }
40
41
  const authUrl = `${authzRequestEndpoint}?${params}`;
41
42
  return {
42
43
  authUrl
@@ -45,13 +46,14 @@ const buildAuthorizationUrl = async (issuerRequestUri, clientId, issuerConf, idp
45
46
 
46
47
  /**
47
48
  * WARNING: This function must be called after obtaining the authorization redirect URL from the webviews (SPID and CIE L3) or browser for CIEID.
48
- * Complete User authorization via strong identification when the response mode is "query" and the request credential is a urn:eu.europa.ec.eudi:pid:1.
49
+ * Complete User authorization via strong identification when the response mode is "query" and the request credential is a PersonIdentificationData.
49
50
  * This function parses the authorization redirect URL to extract the authorization response.
50
51
  * @param authRedirectUrl The URL to which the end user should be redirected to start the authentication flow
51
52
  * @returns the authorization response which contains code, state and iss
52
53
  */
53
54
  exports.buildAuthorizationUrl = buildAuthorizationUrl;
54
55
  const completeUserAuthorizationWithQueryMode = async authRedirectUrl => {
56
+ _logging.Logger.log(_logging.LogLevel.DEBUG, `The requeste credential is a PersonIdentificationData, completing the user authorization with query mode`);
55
57
  const query = (0, _parseUrl.default)(authRedirectUrl).query;
56
58
  return parseAuthorizationResponse(query);
57
59
  };
@@ -63,7 +65,7 @@ const completeUserAuthorizationWithQueryMode = async authRedirectUrl => {
63
65
  * The information is obtained by performing a GET request to the authorization endpoint with request_uri and client_id parameters.
64
66
  * @param issuerRequestUri the URI of the issuer where the request is sent
65
67
  * @param clientId Identifies the current client across all the requests of the issuing flow returned by {@link startUserAuthorization}
66
- * @param issuerConf The issuer configuration returned by {@link getIssuerConfig}
68
+ * @param issuerConf The issuer configuration returned by {@link evaluateIssuerTrust}
67
69
  * @param appFetch (optional) fetch api implementation. Default: built-in fetch
68
70
  * @throws {ValidationFailed} if an error while validating the response
69
71
  * @returns the request object which contains the credential to be presented in order to obtain the requested credential
@@ -71,15 +73,18 @@ const completeUserAuthorizationWithQueryMode = async authRedirectUrl => {
71
73
  exports.completeUserAuthorizationWithQueryMode = completeUserAuthorizationWithQueryMode;
72
74
  const getRequestedCredentialToBePresented = async function (issuerRequestUri, clientId, issuerConf) {
73
75
  let appFetch = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : fetch;
74
- const authzRequestEndpoint = issuerConf.authorization_endpoint;
76
+ _logging.Logger.log(_logging.LogLevel.DEBUG, `The requeste credential is not a PersonIdentificationData, requesting the credential to be presented`);
77
+ const authzRequestEndpoint = issuerConf.oauth_authorization_server.authorization_endpoint;
75
78
  const params = new URLSearchParams({
76
79
  client_id: clientId,
77
80
  request_uri: issuerRequestUri
78
81
  });
82
+ _logging.Logger.log(_logging.LogLevel.DEBUG, `Requesting the request object to ${authzRequestEndpoint}?${params.toString()}`);
79
83
  const requestObject = await appFetch(`${authzRequestEndpoint}?${params.toString()}`, {
80
84
  method: "GET"
81
85
  }).then((0, _misc.hasStatusOrThrow)(200, _errors.IssuerResponseError)).then(res => res.text()).then(jws => (0, _ioReactNativeJwt.decode)(jws)).then(reqObj => _types.RequestObject.safeParse(reqObj.payload));
82
86
  if (!requestObject.success) {
87
+ _logging.Logger.log(_logging.LogLevel.ERROR, `Error while validating the response object: ${requestObject.error.message}`);
83
88
  throw new _errors.ValidationFailed({
84
89
  message: "Request Object validation failed",
85
90
  reason: requestObject.error.message
@@ -95,7 +100,7 @@ const getRequestedCredentialToBePresented = async function (issuerRequestUri, cl
95
100
  * The information is obtained by performing a GET request to the authorization endpoint with request_uri and client_id parameters.
96
101
  * @param issuerRequestUri the URI of the issuer where the request is sent
97
102
  * @param clientId Identifies the current client across all the requests of the issuing flow returned by {@link startUserAuthorization}
98
- * @param issuerConf The issuer configuration returned by {@link getIssuerConfig}
103
+ * @param issuerConf The issuer configuration returned by {@link evaluateIssuerTrust}
99
104
  * @param context.walletInstanceAccestation the Wallet Instance's attestation to be presented
100
105
  * @param context.pid the PID to be presented
101
106
  * @param context.wiaCryptoContext The Wallet Instance's crypto context associated with the walletInstanceAttestation parameter
@@ -106,6 +111,7 @@ const getRequestedCredentialToBePresented = async function (issuerRequestUri, cl
106
111
  */
107
112
  exports.getRequestedCredentialToBePresented = getRequestedCredentialToBePresented;
108
113
  const completeUserAuthorizationWithFormPostJwtMode = async (requestObject, ctx) => {
114
+ _logging.Logger.log(_logging.LogLevel.DEBUG, `The requeste credential is not a PersonIdentificationData, completing the user authorization with form_post.jwt mode`);
109
115
  const {
110
116
  wiaCryptoContext,
111
117
  pidCryptoContext,
@@ -118,7 +124,7 @@ const completeUserAuthorizationWithFormPostJwtMode = async (requestObject, ctx)
118
124
  typ: "JWT"
119
125
  }).setPayload({
120
126
  vp: walletInstanceAttestation,
121
- jti: _reactNativeUuid.default.v4().toString(),
127
+ jti: (0, _uuid.v4)().toString(),
122
128
  nonce: requestObject.nonce
123
129
  }).setIssuedAt().setExpirationTime("5m").setAudience(requestObject.response_uri).sign();
124
130
  const pidWpToken = await new _ioReactNativeJwt.SignJWT(pidCryptoContext).setProtectedHeader({
@@ -126,18 +132,19 @@ const completeUserAuthorizationWithFormPostJwtMode = async (requestObject, ctx)
126
132
  typ: "JWT"
127
133
  }).setPayload({
128
134
  vp: pid,
129
- jti: _reactNativeUuid.default.v4().toString(),
135
+ jti: (0, _uuid.v4)().toString(),
130
136
  nonce: requestObject.nonce
131
137
  }).setIssuedAt().setExpirationTime("5m").setAudience(requestObject.response_uri).sign();
138
+ _logging.Logger.log(_logging.LogLevel.DEBUG, `Wallet instance attestation JWT token: ${wiaWpToken}`);
132
139
 
133
140
  /* The path parameter refers to the vp_token variable of the authzResponsePayload and must point to the plain credential which
134
141
  * is cointaned in the `vp` property of the signed jwt token payload
135
142
  */
136
143
  const presentationSubmission = {
137
- definition_id: `${_reactNativeUuid.default.v4()}`,
138
- id: `${_reactNativeUuid.default.v4()}`,
144
+ definition_id: `${(0, _uuid.v4)()}`,
145
+ id: `${(0, _uuid.v4)()}`,
139
146
  descriptor_map: [{
140
- id: "urn:eu.europa.ec.eudi:pid:1",
147
+ id: "PersonIdentificationData",
141
148
  path: "$.vp_token[0].vp",
142
149
  format: "vc+sd-jwt"
143
150
  }, {
@@ -146,11 +153,13 @@ const completeUserAuthorizationWithFormPostJwtMode = async (requestObject, ctx)
146
153
  format: "jwt"
147
154
  }]
148
155
  };
156
+ _logging.Logger.log(_logging.LogLevel.DEBUG, `Presentation submission: ${JSON.stringify(presentationSubmission)}`);
149
157
  const authzResponsePayload = (0, _ioReactNativeJwt.encodeBase64)(JSON.stringify({
150
158
  state: requestObject.state,
151
159
  presentation_submission: presentationSubmission,
152
160
  vp_token: [pidWpToken, wiaWpToken]
153
161
  }));
162
+ _logging.Logger.log(_logging.LogLevel.DEBUG, `Authz response payload: ${authzResponsePayload}`);
154
163
 
155
164
  // Note: according to the spec, the response should be encrypted with the public key of the RP however this is not implemented yet
156
165
  // https://openid.net/specs/openid-4-verifiable-presentations-1_0.html#name-signed-and-encrypted-response
@@ -173,6 +182,7 @@ const completeUserAuthorizationWithFormPostJwtMode = async (requestObject, ctx)
173
182
  }).then((0, _misc.hasStatusOrThrow)(200, _errors.IssuerResponseError)).then(reqUri => reqUri.json());
174
183
  const responseUri = _types2.ResponseUriResultShape.safeParse(resUriRes);
175
184
  if (!responseUri.success) {
185
+ _logging.Logger.log(_logging.LogLevel.ERROR, `Error while validating the response uri: ${responseUri.error.message}`);
176
186
  throw new _errors.ValidationFailed({
177
187
  message: "Response Uri validation failed",
178
188
  reason: responseUri.error.message
@@ -194,9 +204,11 @@ const parseAuthorizationResponse = authRes => {
194
204
  if (!authResParsed.success) {
195
205
  const authErr = _auth.AuthorizationErrorShape.safeParse(authRes);
196
206
  if (!authErr.success) {
207
+ _logging.Logger.log(_logging.LogLevel.ERROR, `Error while parsing the authorization response: ${authResParsed.error.message}`);
197
208
  throw new _errors2.AuthorizationError(authResParsed.error.message); // an error occured while parsing the result and the error
198
209
  }
199
210
 
211
+ _logging.Logger.log(_logging.LogLevel.ERROR, `Error while authorizating with the idp: ${JSON.stringify(authErr)}`);
200
212
  throw new _errors2.AuthorizationIdpError(authErr.data.error, authErr.data.error_description);
201
213
  }
202
214
  return authResParsed.data;
@@ -1 +1 @@
1
- {"version":3,"names":["_auth","require","_misc","_parseUrl","_interopRequireDefault","_errors","_ioReactNativeJwt","_types","_reactNativeUuid","_types2","_decoder","_errors2","obj","__esModule","default","buildAuthorizationUrl","issuerRequestUri","clientId","issuerConf","idpHint","authzRequestEndpoint","authorization_endpoint","params","URLSearchParams","client_id","request_uri","idphint","authUrl","exports","completeUserAuthorizationWithQueryMode","authRedirectUrl","query","parseUrl","parseAuthorizationResponse","getRequestedCredentialToBePresented","appFetch","arguments","length","undefined","fetch","requestObject","toString","method","then","hasStatusOrThrow","IssuerResponseError","res","text","jws","decode","reqObj","RequestObject","safeParse","payload","success","ValidationFailed","message","reason","error","data","completeUserAuthorizationWithFormPostJwtMode","ctx","wiaCryptoContext","pidCryptoContext","pid","walletInstanceAttestation","wiaWpToken","SignJWT","setProtectedHeader","alg","typ","setPayload","vp","jti","uuid","v4","nonce","setIssuedAt","setExpirationTime","setAudience","response_uri","sign","pidWpToken","presentationSubmission","definition_id","id","descriptor_map","path","format","authzResponsePayload","encodeBase64","JSON","stringify","state","presentation_submission","vp_token","body","response","resUriRes","headers","reqUri","json","responseUri","ResponseUriResultShape","redirect_uri","getJwtFromFormPost","cbRes","decodedJwt","authRes","authResParsed","AuthorizationResultShape","authErr","AuthorizationErrorShape","AuthorizationError","AuthorizationIdpError","error_description"],"sourceRoot":"../../../../src","sources":["credential/issuance/04-complete-user-authorization.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,SAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAEA,IAAAK,iBAAA,GAAAL,OAAA;AAMA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,gBAAA,GAAAJ,sBAAA,CAAAH,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AACA,IAAAU,QAAA,GAAAV,OAAA;AAAqE,SAAAG,uBAAAQ,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OA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C,aAAa,GAAGC,8BAAwB,CAAC1D,SAAS,CAACwD,OAAO,CAAC;EACjE,IAAI,CAACC,aAAa,CAACvD,OAAO,EAAE;IAC1B,MAAMyD,OAAO,GAAGC,6BAAuB,CAAC5D,SAAS,CAACwD,OAAO,CAAC;IAC1D,IAAI,CAACG,OAAO,CAACzD,OAAO,EAAE;MACpB,MAAM,IAAI2D,2BAAkB,CAACJ,aAAa,CAACnD,KAAK,CAACF,OAAO,CAAC,CAAC,CAAC;IAC7D;;IACA,MAAM,IAAI0D,8BAAqB,CAC7BH,OAAO,CAACpD,IAAI,CAACD,KAAK,EAClBqD,OAAO,CAACpD,IAAI,CAACwD,iBACf,CAAC;EACH;EACA,OAAON,aAAa,CAAClD,IAAI;AAC3B,CAAC;AAAC/B,OAAA,CAAAK,0BAAA,GAAAA,0BAAA"}
1
+ {"version":3,"names":["_auth","require","_misc","_parseUrl","_interopRequireDefault","_errors","_ioReactNativeJwt","_types","_uuid","_types2","_decoder","_errors2","_logging","obj","__esModule","default","buildAuthorizationUrl","issuerRequestUri","clientId","issuerConf","idpHint","authzRequestEndpoint","oauth_authorization_server","authorization_endpoint","params","URLSearchParams","client_id","request_uri","append","authUrl","exports","completeUserAuthorizationWithQueryMode","authRedirectUrl","Logger","log","LogLevel","DEBUG","query","parseUrl","parseAuthorizationResponse","getRequestedCredentialToBePresented","appFetch","arguments","length","undefined","fetch","toString","requestObject","method","then","hasStatusOrThrow","IssuerResponseError","res","text","jws","decode","reqObj","RequestObject","safeParse","payload","success","ERROR","error","message","ValidationFailed","reason","data","completeUserAuthorizationWithFormPostJwtMode","ctx","wiaCryptoContext","pidCryptoContext","pid","walletInstanceAttestation","wiaWpToken","SignJWT","setProtectedHeader","alg","typ","setPayload","vp","jti","uuidv4","nonce","setIssuedAt","setExpirationTime","setAudience","response_uri","sign","pidWpToken","presentationSubmission","definition_id","id","descriptor_map","path","format","JSON","stringify","authzResponsePayload","encodeBase64","state","presentation_submission","vp_token","body","response","resUriRes","headers","reqUri","json","responseUri","ResponseUriResultShape","redirect_uri","getJwtFromFormPost","cbRes","decodedJwt","authRes","authResParsed","AuthorizationResultShape","authErr","AuthorizationErrorShape","AuthorizationError","AuthorizationIdpError","error_description"],"sourceRoot":"../../../../src","sources":["credential/issuance/04-complete-user-authorization.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,SAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAEA,IAAAK,iBAAA,GAAAL,OAAA;AAMA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AACA,IAAAU,QAAA,GAAAV,OAAA;AACA,IAAAW,QAAA,GAAAX,OAAA;AAAuD,SAAAG,uBAAAS,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEvD;AACA;AACA;;AAgCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,qBAA4C,GAAG,MAAAA,CAC1DC,gBAAgB,EAChBC,QAAQ,EACRC,UAAU,EACVC,OAAO,KACJ;EACH,MAAMC,oBAAoB,GACxBF,UAAU,CAACG,0BAA0B,CAACC,sBAAsB;EAE9D,MAAMC,MAAM,GAAG,IAAIC,eAAe,CAAC;IACjCC,SAAS,EAAER,QAAQ;IACnBS,WAAW,EAAEV;EACf,CAAC,CAAC;EAEF,IAAIG,OAAO,EAAE;IACXI,MAAM,CAACI,MAAM,CAAC,SAAS,EAAER,OAAO,CAAC;EACnC;EAEA,MAAMS,OAAO,GAAI,GAAER,oBAAqB,IAAGG,MAAO,EAAC;EAEnD,OAAO;IAAEK;EAAQ,CAAC;AACpB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA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