@pagopa/io-react-native-wallet 1.7.0 → 2.0.0-next.0

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 (438) 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/{entity/trust → trust}/chain.js +49 -55
  77. package/lib/commonjs/trust/chain.js.map +1 -0
  78. package/lib/commonjs/trust/errors.js +110 -0
  79. package/lib/commonjs/trust/errors.js.map +1 -0
  80. package/lib/commonjs/trust/index.js +282 -0
  81. package/lib/commonjs/trust/index.js.map +1 -0
  82. package/lib/commonjs/{entity/trust → trust}/types.js +27 -47
  83. package/lib/commonjs/trust/types.js.map +1 -0
  84. package/lib/commonjs/trust/utils.js +41 -0
  85. package/lib/commonjs/trust/utils.js.map +1 -0
  86. package/lib/commonjs/utils/crypto.js +5 -112
  87. package/lib/commonjs/utils/crypto.js.map +1 -1
  88. package/lib/commonjs/utils/decoder.js +2 -0
  89. package/lib/commonjs/utils/decoder.js.map +1 -1
  90. package/lib/commonjs/utils/error-codes.js +22 -2
  91. package/lib/commonjs/utils/error-codes.js.map +1 -1
  92. package/lib/commonjs/utils/errors.js +72 -4
  93. package/lib/commonjs/utils/errors.js.map +1 -1
  94. package/lib/commonjs/utils/logging.js +68 -0
  95. package/lib/commonjs/utils/logging.js.map +1 -0
  96. package/lib/commonjs/utils/misc.js +2 -0
  97. package/lib/commonjs/utils/misc.js.map +1 -1
  98. package/lib/commonjs/utils/par.js +17 -10
  99. package/lib/commonjs/utils/par.js.map +1 -1
  100. package/lib/commonjs/utils/string.js +1 -12
  101. package/lib/commonjs/utils/string.js.map +1 -1
  102. package/lib/commonjs/wallet-instance/index.js +14 -0
  103. package/lib/commonjs/wallet-instance/index.js.map +1 -1
  104. package/lib/commonjs/wallet-instance-attestation/README.md +8 -3
  105. package/lib/commonjs/wallet-instance-attestation/issuing.js +15 -8
  106. package/lib/commonjs/wallet-instance-attestation/issuing.js.map +1 -1
  107. package/lib/commonjs/wallet-instance-attestation/types.js +16 -20
  108. package/lib/commonjs/wallet-instance-attestation/types.js.map +1 -1
  109. package/lib/module/client/generated/wallet-provider.js +40 -15
  110. package/lib/module/client/generated/wallet-provider.js.map +1 -1
  111. package/lib/module/credential/index.js +3 -1
  112. package/lib/module/credential/index.js.map +1 -1
  113. package/lib/module/credential/issuance/02-evaluate-issuer-trust.js +20 -0
  114. package/lib/module/credential/issuance/02-evaluate-issuer-trust.js.map +1 -0
  115. package/lib/module/credential/issuance/03-start-user-authorization.js +25 -16
  116. package/lib/module/credential/issuance/03-start-user-authorization.js.map +1 -1
  117. package/lib/module/credential/issuance/04-complete-user-authorization.js +30 -18
  118. package/lib/module/credential/issuance/04-complete-user-authorization.js.map +1 -1
  119. package/lib/module/credential/issuance/05-authorize-access.js +17 -11
  120. package/lib/module/credential/issuance/05-authorize-access.js.map +1 -1
  121. package/lib/module/credential/issuance/06-obtain-credential.js +36 -28
  122. package/lib/module/credential/issuance/06-obtain-credential.js.map +1 -1
  123. package/lib/module/credential/issuance/07-verify-and-parse-credential.js +27 -205
  124. package/lib/module/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
  125. package/lib/module/credential/issuance/README.md +23 -20
  126. package/lib/module/credential/issuance/const.js +1 -1
  127. package/lib/module/credential/issuance/const.js.map +1 -1
  128. package/lib/module/credential/issuance/index.js +2 -2
  129. package/lib/module/credential/issuance/index.js.map +1 -1
  130. package/lib/module/credential/presentation/01-start-flow.js +14 -15
  131. package/lib/module/credential/presentation/01-start-flow.js.map +1 -1
  132. package/lib/module/credential/presentation/02-evaluate-rp-trust.js +5 -3
  133. package/lib/module/credential/presentation/02-evaluate-rp-trust.js.map +1 -1
  134. package/lib/module/credential/presentation/03-get-request-object.js +34 -7
  135. package/lib/module/credential/presentation/03-get-request-object.js.map +1 -1
  136. package/lib/module/credential/presentation/04-retrieve-rp-jwks.js +2 -124
  137. package/lib/module/credential/presentation/04-retrieve-rp-jwks.js.map +1 -1
  138. package/lib/module/credential/presentation/05-verify-request-object.js +78 -23
  139. package/lib/module/credential/presentation/05-verify-request-object.js.map +1 -1
  140. package/lib/module/credential/presentation/06-fetch-presentation-definition.js +6 -30
  141. package/lib/module/credential/presentation/06-fetch-presentation-definition.js.map +1 -1
  142. package/lib/module/credential/presentation/07-evaluate-dcql-query.js +97 -118
  143. package/lib/module/credential/presentation/07-evaluate-dcql-query.js.map +1 -1
  144. package/lib/module/credential/presentation/07-evaluate-input-descriptor.js +83 -186
  145. package/lib/module/credential/presentation/07-evaluate-input-descriptor.js.map +1 -1
  146. package/lib/module/credential/presentation/08-send-authorization-response.js +107 -170
  147. package/lib/module/credential/presentation/08-send-authorization-response.js.map +1 -1
  148. package/lib/module/credential/presentation/README.md +74 -79
  149. package/lib/module/credential/presentation/errors.js +30 -17
  150. package/lib/module/credential/presentation/errors.js.map +1 -1
  151. package/lib/module/credential/presentation/index.js +6 -6
  152. package/lib/module/credential/presentation/index.js.map +1 -1
  153. package/lib/module/credential/presentation/types.js +49 -27
  154. package/lib/module/credential/presentation/types.js.map +1 -1
  155. package/lib/module/credential/status/01-start-flow.js +2 -0
  156. package/lib/module/credential/status/01-start-flow.js.map +1 -0
  157. package/lib/module/credential/status/02-status-attestation.js +66 -0
  158. package/lib/module/credential/status/02-status-attestation.js.map +1 -0
  159. package/lib/module/credential/status/03-verify-and-parse-status-attestation.js +49 -0
  160. package/lib/module/credential/status/03-verify-and-parse-status-attestation.js.map +1 -0
  161. package/lib/module/credential/status/README.md +67 -0
  162. package/lib/module/credential/status/index.js +5 -0
  163. package/lib/module/credential/status/index.js.map +1 -0
  164. package/lib/module/credential/status/types.js +40 -0
  165. package/lib/module/credential/status/types.js.map +1 -0
  166. package/lib/module/credential/trustmark/README.md +62 -0
  167. package/lib/module/credential/trustmark/get-credential-trustmark.js +77 -0
  168. package/lib/module/credential/trustmark/get-credential-trustmark.js.map +1 -0
  169. package/lib/module/credential/trustmark/index.js +3 -0
  170. package/lib/module/credential/trustmark/index.js.map +1 -0
  171. package/lib/module/index.js +3 -1
  172. package/lib/module/index.js.map +1 -1
  173. package/lib/module/pid/sd-jwt/types.js +16 -1
  174. package/lib/module/pid/sd-jwt/types.js.map +1 -1
  175. package/lib/module/sd-jwt/__test__/index.test.js +22 -34
  176. package/lib/module/sd-jwt/__test__/index.test.js.map +1 -1
  177. package/lib/module/sd-jwt/__test__/types.test.js +11 -23
  178. package/lib/module/sd-jwt/__test__/types.test.js.map +1 -1
  179. package/lib/module/sd-jwt/index.js +1 -7
  180. package/lib/module/sd-jwt/index.js.map +1 -1
  181. package/lib/module/sd-jwt/types.js +4 -19
  182. package/lib/module/sd-jwt/types.js.map +1 -1
  183. package/lib/module/trust/chain.js +108 -0
  184. package/lib/module/trust/chain.js.map +1 -0
  185. package/lib/module/trust/errors.js +94 -0
  186. package/lib/module/trust/errors.js.map +1 -0
  187. package/lib/module/trust/index.js +263 -0
  188. package/lib/module/trust/index.js.map +1 -0
  189. package/lib/module/{entity/trust → trust}/types.js +25 -46
  190. package/lib/module/trust/types.js.map +1 -0
  191. package/lib/module/trust/utils.js +33 -0
  192. package/lib/module/trust/utils.js.map +1 -0
  193. package/lib/module/utils/crypto.js +4 -107
  194. package/lib/module/utils/crypto.js.map +1 -1
  195. package/lib/module/utils/decoder.js +3 -0
  196. package/lib/module/utils/decoder.js.map +1 -1
  197. package/lib/module/utils/error-codes.js +20 -1
  198. package/lib/module/utils/error-codes.js.map +1 -1
  199. package/lib/module/utils/errors.js +61 -4
  200. package/lib/module/utils/errors.js.map +1 -1
  201. package/lib/module/utils/logging.js +62 -0
  202. package/lib/module/utils/logging.js.map +1 -0
  203. package/lib/module/utils/misc.js +2 -0
  204. package/lib/module/utils/misc.js.map +1 -1
  205. package/lib/module/utils/par.js +17 -9
  206. package/lib/module/utils/par.js.map +1 -1
  207. package/lib/module/utils/string.js +0 -10
  208. package/lib/module/utils/string.js.map +1 -1
  209. package/lib/module/wallet-instance/index.js +13 -0
  210. package/lib/module/wallet-instance/index.js.map +1 -1
  211. package/lib/module/wallet-instance-attestation/README.md +8 -3
  212. package/lib/module/wallet-instance-attestation/index.js +2 -2
  213. package/lib/module/wallet-instance-attestation/index.js.map +1 -1
  214. package/lib/module/wallet-instance-attestation/issuing.js +16 -9
  215. package/lib/module/wallet-instance-attestation/issuing.js.map +1 -1
  216. package/lib/module/wallet-instance-attestation/types.js +14 -18
  217. package/lib/module/wallet-instance-attestation/types.js.map +1 -1
  218. package/lib/typescript/client/generated/wallet-provider.d.ts +206 -51
  219. package/lib/typescript/client/generated/wallet-provider.d.ts.map +1 -1
  220. package/lib/typescript/credential/index.d.ts +3 -1
  221. package/lib/typescript/credential/index.d.ts.map +1 -1
  222. package/lib/typescript/credential/issuance/01-start-flow.d.ts +1 -1
  223. package/lib/typescript/credential/issuance/02-evaluate-issuer-trust.d.ts +19 -0
  224. package/lib/typescript/credential/issuance/02-evaluate-issuer-trust.d.ts.map +1 -0
  225. package/lib/typescript/credential/issuance/03-start-user-authorization.d.ts +3 -3
  226. package/lib/typescript/credential/issuance/03-start-user-authorization.d.ts.map +1 -1
  227. package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts +9 -9
  228. package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts.map +1 -1
  229. package/lib/typescript/credential/issuance/05-authorize-access.d.ts +3 -3
  230. package/lib/typescript/credential/issuance/05-authorize-access.d.ts.map +1 -1
  231. package/lib/typescript/credential/issuance/06-obtain-credential.d.ts +4 -4
  232. package/lib/typescript/credential/issuance/06-obtain-credential.d.ts.map +1 -1
  233. package/lib/typescript/credential/issuance/07-verify-and-parse-credential.d.ts +3 -15
  234. package/lib/typescript/credential/issuance/07-verify-and-parse-credential.d.ts.map +1 -1
  235. package/lib/typescript/credential/issuance/const.d.ts +1 -1
  236. package/lib/typescript/credential/issuance/const.d.ts.map +1 -1
  237. package/lib/typescript/credential/issuance/index.d.ts +3 -3
  238. package/lib/typescript/credential/issuance/index.d.ts.map +1 -1
  239. package/lib/typescript/credential/issuance/types.d.ts +8 -3
  240. package/lib/typescript/credential/issuance/types.d.ts.map +1 -1
  241. package/lib/typescript/credential/presentation/01-start-flow.d.ts +28 -9
  242. package/lib/typescript/credential/presentation/01-start-flow.d.ts.map +1 -1
  243. package/lib/typescript/credential/presentation/02-evaluate-rp-trust.d.ts +2 -1
  244. package/lib/typescript/credential/presentation/02-evaluate-rp-trust.d.ts.map +1 -1
  245. package/lib/typescript/credential/presentation/03-get-request-object.d.ts +7 -5
  246. package/lib/typescript/credential/presentation/03-get-request-object.d.ts.map +1 -1
  247. package/lib/typescript/credential/presentation/04-retrieve-rp-jwks.d.ts +4 -30
  248. package/lib/typescript/credential/presentation/04-retrieve-rp-jwks.d.ts.map +1 -1
  249. package/lib/typescript/credential/presentation/05-verify-request-object.d.ts +17 -4
  250. package/lib/typescript/credential/presentation/05-verify-request-object.d.ts.map +1 -1
  251. package/lib/typescript/credential/presentation/06-fetch-presentation-definition.d.ts +4 -9
  252. package/lib/typescript/credential/presentation/06-fetch-presentation-definition.d.ts.map +1 -1
  253. package/lib/typescript/credential/presentation/07-evaluate-dcql-query.d.ts +13 -12
  254. package/lib/typescript/credential/presentation/07-evaluate-dcql-query.d.ts.map +1 -1
  255. package/lib/typescript/credential/presentation/07-evaluate-input-descriptor.d.ts +40 -42
  256. package/lib/typescript/credential/presentation/07-evaluate-input-descriptor.d.ts.map +1 -1
  257. package/lib/typescript/credential/presentation/08-send-authorization-response.d.ts +30 -43
  258. package/lib/typescript/credential/presentation/08-send-authorization-response.d.ts.map +1 -1
  259. package/lib/typescript/credential/presentation/errors.d.ts +25 -10
  260. package/lib/typescript/credential/presentation/errors.d.ts.map +1 -1
  261. package/lib/typescript/credential/presentation/index.d.ts +7 -8
  262. package/lib/typescript/credential/presentation/index.d.ts.map +1 -1
  263. package/lib/typescript/credential/presentation/types.d.ts +137 -307
  264. package/lib/typescript/credential/presentation/types.d.ts.map +1 -1
  265. package/lib/typescript/credential/status/01-start-flow.d.ts +10 -0
  266. package/lib/typescript/credential/status/01-start-flow.d.ts.map +1 -0
  267. package/lib/typescript/credential/status/02-status-attestation.d.ts +19 -0
  268. package/lib/typescript/credential/status/02-status-attestation.d.ts.map +1 -0
  269. package/lib/typescript/credential/status/03-verify-and-parse-status-attestation.d.ts +24 -0
  270. package/lib/typescript/credential/status/03-verify-and-parse-status-attestation.d.ts.map +1 -0
  271. package/lib/typescript/credential/status/index.d.ts +7 -0
  272. package/lib/typescript/credential/status/index.d.ts.map +1 -0
  273. package/lib/typescript/credential/status/types.d.ts +305 -0
  274. package/lib/typescript/credential/status/types.d.ts.map +1 -0
  275. package/lib/typescript/credential/trustmark/get-credential-trustmark.d.ts +52 -0
  276. package/lib/typescript/credential/trustmark/get-credential-trustmark.d.ts.map +1 -0
  277. package/lib/typescript/credential/trustmark/index.d.ts +4 -0
  278. package/lib/typescript/credential/trustmark/index.d.ts.map +1 -0
  279. package/lib/typescript/index.d.ts +3 -1
  280. package/lib/typescript/index.d.ts.map +1 -1
  281. package/lib/typescript/pid/sd-jwt/types.d.ts +103 -25
  282. package/lib/typescript/pid/sd-jwt/types.d.ts.map +1 -1
  283. package/lib/typescript/sd-jwt/index.d.ts +30 -82
  284. package/lib/typescript/sd-jwt/index.d.ts.map +1 -1
  285. package/lib/typescript/sd-jwt/types.d.ts +29 -134
  286. package/lib/typescript/sd-jwt/types.d.ts.map +1 -1
  287. package/lib/typescript/{entity/trust → trust}/chain.d.ts +5 -10
  288. package/lib/typescript/trust/chain.d.ts.map +1 -0
  289. package/lib/typescript/trust/errors.d.ts +80 -0
  290. package/lib/typescript/trust/errors.d.ts.map +1 -0
  291. package/lib/typescript/{entity/trust → trust}/index.d.ts +211 -186
  292. package/lib/typescript/trust/index.d.ts.map +1 -0
  293. package/lib/typescript/{entity/trust → trust}/types.d.ts +1533 -1120
  294. package/lib/typescript/{entity/trust → trust}/types.d.ts.map +1 -1
  295. package/lib/typescript/trust/utils.d.ts +12 -0
  296. package/lib/typescript/trust/utils.d.ts.map +1 -0
  297. package/lib/typescript/utils/crypto.d.ts +0 -32
  298. package/lib/typescript/utils/crypto.d.ts.map +1 -1
  299. package/lib/typescript/utils/decoder.d.ts.map +1 -1
  300. package/lib/typescript/utils/error-codes.d.ts +20 -0
  301. package/lib/typescript/utils/error-codes.d.ts.map +1 -1
  302. package/lib/typescript/utils/errors.d.ts +55 -10
  303. package/lib/typescript/utils/errors.d.ts.map +1 -1
  304. package/lib/typescript/utils/logging.d.ts +35 -0
  305. package/lib/typescript/utils/logging.d.ts.map +1 -0
  306. package/lib/typescript/utils/misc.d.ts.map +1 -1
  307. package/lib/typescript/utils/par.d.ts +8 -1
  308. package/lib/typescript/utils/par.d.ts.map +1 -1
  309. package/lib/typescript/utils/string.d.ts +0 -7
  310. package/lib/typescript/utils/string.d.ts.map +1 -1
  311. package/lib/typescript/wallet-instance/index.d.ts +8 -0
  312. package/lib/typescript/wallet-instance/index.d.ts.map +1 -1
  313. package/lib/typescript/wallet-instance-attestation/index.d.ts +1 -2
  314. package/lib/typescript/wallet-instance-attestation/index.d.ts.map +1 -1
  315. package/lib/typescript/wallet-instance-attestation/issuing.d.ts +4 -2
  316. package/lib/typescript/wallet-instance-attestation/issuing.d.ts.map +1 -1
  317. package/lib/typescript/wallet-instance-attestation/types.d.ts +78 -120
  318. package/lib/typescript/wallet-instance-attestation/types.d.ts.map +1 -1
  319. package/package.json +8 -9
  320. package/src/client/generated/wallet-provider.ts +52 -17
  321. package/src/credential/index.ts +4 -1
  322. package/src/credential/issuance/01-start-flow.ts +1 -1
  323. package/src/credential/issuance/02-evaluate-issuer-trust.ts +32 -0
  324. package/src/credential/issuance/03-start-user-authorization.ts +48 -22
  325. package/src/credential/issuance/04-complete-user-authorization.ts +74 -18
  326. package/src/credential/issuance/05-authorize-access.ts +29 -11
  327. package/src/credential/issuance/06-obtain-credential.ts +61 -36
  328. package/src/credential/issuance/07-verify-and-parse-credential.ts +37 -264
  329. package/src/credential/issuance/README.md +23 -20
  330. package/src/credential/issuance/const.ts +1 -1
  331. package/src/credential/issuance/index.ts +6 -3
  332. package/src/credential/presentation/01-start-flow.ts +19 -22
  333. package/src/credential/presentation/02-evaluate-rp-trust.ts +5 -4
  334. package/src/credential/presentation/03-get-request-object.ts +36 -8
  335. package/src/credential/presentation/04-retrieve-rp-jwks.ts +6 -148
  336. package/src/credential/presentation/05-verify-request-object.ts +115 -30
  337. package/src/credential/presentation/06-fetch-presentation-definition.ts +5 -35
  338. package/src/credential/presentation/07-evaluate-dcql-query.ts +132 -161
  339. package/src/credential/presentation/07-evaluate-input-descriptor.ts +136 -254
  340. package/src/credential/presentation/08-send-authorization-response.ts +178 -260
  341. package/src/credential/presentation/README.md +74 -79
  342. package/src/credential/presentation/errors.ts +38 -15
  343. package/src/credential/presentation/index.ts +18 -19
  344. package/src/credential/presentation/types.ts +67 -64
  345. package/src/credential/status/01-start-flow.ts +9 -0
  346. package/src/credential/status/02-status-attestation.ts +105 -0
  347. package/src/credential/status/03-verify-and-parse-status-attestation.ts +70 -0
  348. package/src/credential/status/README.md +67 -0
  349. package/src/credential/status/index.ts +22 -0
  350. package/src/credential/status/types.ts +43 -0
  351. package/src/credential/trustmark/README.md +62 -0
  352. package/src/credential/trustmark/get-credential-trustmark.ts +139 -0
  353. package/src/credential/trustmark/index.ts +8 -0
  354. package/src/index.ts +4 -0
  355. package/src/pid/sd-jwt/types.ts +18 -1
  356. package/src/sd-jwt/__test__/index.test.ts +36 -55
  357. package/src/sd-jwt/__test__/types.test.ts +16 -29
  358. package/src/sd-jwt/index.ts +1 -5
  359. package/src/sd-jwt/types.ts +2 -19
  360. package/src/trust/chain.ts +151 -0
  361. package/src/trust/errors.ts +105 -0
  362. package/src/{entity/trust → trust}/index.ts +198 -23
  363. package/src/{entity/trust → trust}/types.ts +24 -37
  364. package/src/trust/utils.ts +35 -0
  365. package/src/utils/crypto.ts +4 -106
  366. package/src/utils/decoder.ts +6 -1
  367. package/src/utils/error-codes.ts +23 -0
  368. package/src/utils/errors.ts +119 -15
  369. package/src/utils/logging.ts +68 -0
  370. package/src/utils/misc.ts +5 -0
  371. package/src/utils/par.ts +19 -6
  372. package/src/utils/string.ts +0 -10
  373. package/src/wallet-instance/index.ts +30 -1
  374. package/src/wallet-instance-attestation/README.md +8 -3
  375. package/src/wallet-instance-attestation/index.ts +2 -2
  376. package/src/wallet-instance-attestation/issuing.ts +33 -12
  377. package/src/wallet-instance-attestation/types.ts +18 -22
  378. package/lib/commonjs/credential/issuance/02-get-issuer-config.js +0 -48
  379. package/lib/commonjs/credential/issuance/02-get-issuer-config.js.map +0 -1
  380. package/lib/commonjs/entity/openid-connect/issuer/index.js +0 -25
  381. package/lib/commonjs/entity/openid-connect/issuer/index.js.map +0 -1
  382. package/lib/commonjs/entity/openid-connect/issuer/types.js +0 -64
  383. package/lib/commonjs/entity/openid-connect/issuer/types.js.map +0 -1
  384. package/lib/commonjs/entity/trust/chain.js.map +0 -1
  385. package/lib/commonjs/entity/trust/index.js +0 -148
  386. package/lib/commonjs/entity/trust/index.js.map +0 -1
  387. package/lib/commonjs/entity/trust/types.js.map +0 -1
  388. package/lib/commonjs/mdoc/converters.js +0 -26
  389. package/lib/commonjs/mdoc/converters.js.map +0 -1
  390. package/lib/commonjs/mdoc/index.js +0 -68
  391. package/lib/commonjs/mdoc/index.js.map +0 -1
  392. package/lib/commonjs/utils/credential/issuance/07-verify-and-parse-credentials-inputs.js +0 -469
  393. package/lib/commonjs/utils/credential/issuance/07-verify-and-parse-credentials-inputs.js.map +0 -1
  394. package/lib/commonjs/utils/credential/issuance/07-verify-and-parse-credentials-utils.js +0 -90
  395. package/lib/commonjs/utils/credential/issuance/07-verify-and-parse-credentials-utils.js.map +0 -1
  396. package/lib/module/credential/issuance/02-get-issuer-config.js +0 -42
  397. package/lib/module/credential/issuance/02-get-issuer-config.js.map +0 -1
  398. package/lib/module/entity/openid-connect/issuer/index.js +0 -20
  399. package/lib/module/entity/openid-connect/issuer/index.js.map +0 -1
  400. package/lib/module/entity/openid-connect/issuer/types.js +0 -48
  401. package/lib/module/entity/openid-connect/issuer/types.js.map +0 -1
  402. package/lib/module/entity/trust/chain.js +0 -113
  403. package/lib/module/entity/trust/chain.js.map +0 -1
  404. package/lib/module/entity/trust/index.js +0 -131
  405. package/lib/module/entity/trust/index.js.map +0 -1
  406. package/lib/module/entity/trust/types.js.map +0 -1
  407. package/lib/module/mdoc/converters.js +0 -20
  408. package/lib/module/mdoc/converters.js.map +0 -1
  409. package/lib/module/mdoc/index.js +0 -60
  410. package/lib/module/mdoc/index.js.map +0 -1
  411. package/lib/module/utils/credential/issuance/07-verify-and-parse-credentials-inputs.js +0 -462
  412. package/lib/module/utils/credential/issuance/07-verify-and-parse-credentials-inputs.js.map +0 -1
  413. package/lib/module/utils/credential/issuance/07-verify-and-parse-credentials-utils.js +0 -83
  414. package/lib/module/utils/credential/issuance/07-verify-and-parse-credentials-utils.js.map +0 -1
  415. package/lib/typescript/credential/issuance/02-get-issuer-config.d.ts +0 -32
  416. package/lib/typescript/credential/issuance/02-get-issuer-config.d.ts.map +0 -1
  417. package/lib/typescript/entity/openid-connect/issuer/index.d.ts +0 -12
  418. package/lib/typescript/entity/openid-connect/issuer/index.d.ts.map +0 -1
  419. package/lib/typescript/entity/openid-connect/issuer/types.d.ts +0 -777
  420. package/lib/typescript/entity/openid-connect/issuer/types.d.ts.map +0 -1
  421. package/lib/typescript/entity/trust/chain.d.ts.map +0 -1
  422. package/lib/typescript/entity/trust/index.d.ts.map +0 -1
  423. package/lib/typescript/mdoc/converters.d.ts +0 -8
  424. package/lib/typescript/mdoc/converters.d.ts.map +0 -1
  425. package/lib/typescript/mdoc/index.d.ts +0 -10
  426. package/lib/typescript/mdoc/index.d.ts.map +0 -1
  427. package/lib/typescript/utils/credential/issuance/07-verify-and-parse-credentials-inputs.d.ts +0 -3
  428. package/lib/typescript/utils/credential/issuance/07-verify-and-parse-credentials-inputs.d.ts.map +0 -1
  429. package/lib/typescript/utils/credential/issuance/07-verify-and-parse-credentials-utils.d.ts +0 -42
  430. package/lib/typescript/utils/credential/issuance/07-verify-and-parse-credentials-utils.d.ts.map +0 -1
  431. package/src/credential/issuance/02-get-issuer-config.ts +0 -67
  432. package/src/entity/openid-connect/issuer/index.ts +0 -27
  433. package/src/entity/openid-connect/issuer/types.ts +0 -76
  434. package/src/entity/trust/chain.ts +0 -154
  435. package/src/mdoc/converters.ts +0 -26
  436. package/src/mdoc/index.ts +0 -95
  437. package/src/utils/credential/issuance/07-verify-and-parse-credentials-inputs.ts +0 -615
  438. package/src/utils/credential/issuance/07-verify-and-parse-credentials-utils.ts +0 -171
package/src/utils/par.ts CHANGED
@@ -3,16 +3,18 @@ import {
3
3
  type CryptoContext,
4
4
  SignJWT,
5
5
  } from "@pagopa/io-react-native-jwt";
6
- import uuid from "react-native-uuid";
6
+ import { v4 as uuidv4 } from "uuid";
7
7
  import * as z from "zod";
8
8
  import * as WalletInstanceAttestation from "../wallet-instance-attestation";
9
9
  import { generateRandomAlphaNumericString, hasStatusOrThrow } from "./misc";
10
10
  import { createPopToken } from "./pop";
11
11
  import { IssuerResponseError } from "./errors";
12
+ import { LogLevel, Logger } from "./logging";
12
13
 
13
14
  export type AuthorizationDetail = z.infer<typeof AuthorizationDetail>;
14
15
  export const AuthorizationDetail = z.object({
15
16
  credential_configuration_id: z.string(),
17
+ format: z.union([z.literal("vc+sd-jwt"), z.literal("vc+mdoc-cbor")]),
16
18
  type: z.literal("openid_credential"),
17
19
  });
18
20
 
@@ -37,7 +39,8 @@ export const makeParRequest =
37
39
  responseMode: string,
38
40
  parEndpoint: string,
39
41
  walletInstanceAttestation: string,
40
- authorizationDetails: AuthorizationDetails
42
+ authorizationDetails: AuthorizationDetails,
43
+ assertionType: string
41
44
  ): Promise<string> => {
42
45
  const wiaPublicKey = await wiaCryptoContext.getPublicKey();
43
46
 
@@ -49,7 +52,7 @@ export const makeParRequest =
49
52
 
50
53
  const signedWiaPoP = await createPopToken(
51
54
  {
52
- jti: `${uuid.v4()}`,
55
+ jti: `${uuidv4()}`,
53
56
  aud,
54
57
  iss,
55
58
  },
@@ -72,7 +75,7 @@ export const makeParRequest =
72
75
  kid: wiaPublicKey.kid,
73
76
  })
74
77
  .setPayload({
75
- jti: `${uuid.v4()}`,
78
+ jti: `${uuidv4()}`,
76
79
  aud,
77
80
  response_type: "code",
78
81
  response_mode: responseMode,
@@ -83,6 +86,8 @@ export const makeParRequest =
83
86
  code_challenge_method: codeChallengeMethod,
84
87
  authorization_details: authorizationDetails,
85
88
  redirect_uri: redirectUri,
89
+ client_assertion_type: assertionType,
90
+ client_assertion: walletInstanceAttestation + "~" + signedWiaPoP,
86
91
  })
87
92
  .setIssuedAt() //iat is set to now
88
93
  .setExpirationTime("5min")
@@ -90,16 +95,24 @@ export const makeParRequest =
90
95
 
91
96
  /** The request body for the Pushed Authorization Request */
92
97
  var formBody = new URLSearchParams({
98
+ response_type: "code",
93
99
  client_id: clientId,
100
+ code_challenge: codeChallenge,
101
+ code_challenge_method: "S256",
94
102
  request: signedJwtForPar,
103
+ client_assertion_type: assertionType,
104
+ client_assertion: walletInstanceAttestation + "~" + signedWiaPoP,
95
105
  });
96
106
 
107
+ Logger.log(
108
+ LogLevel.DEBUG,
109
+ `Sending to PAR endpoint ${parEndpoint}: ${formBody}`
110
+ );
111
+
97
112
  return await appFetch(parEndpoint, {
98
113
  method: "POST",
99
114
  headers: {
100
115
  "Content-Type": "application/x-www-form-urlencoded",
101
- "OAuth-Client-Attestation": walletInstanceAttestation,
102
- "OAuth-Client-Attestation-PoP": signedWiaPoP,
103
116
  },
104
117
  body: formBody.toString(),
105
118
  })
@@ -43,13 +43,3 @@ export const obfuscateString = (
43
43
 
44
44
  return chars.join("");
45
45
  };
46
-
47
- /**
48
- * Converts a base64 string to a Base64 URL-encoded string.
49
- *
50
- * @param byteString - The input string in base64 format.
51
- * @returns The Base64 URL-encoded string.
52
- */
53
- export const base64ToBase64Url = (base64: string): string => {
54
- return base64.replace(/\+/g, "-").replace(/\//g, "_").replace(/[=]+$/, "");
55
- };
@@ -6,6 +6,7 @@ import {
6
6
  } from "../utils/errors";
7
7
  import type { WalletInstanceData } from "../client/generated/wallet-provider";
8
8
  import type { IntegrityContext } from "..";
9
+ import { LogLevel, Logger } from "../utils/logging";
9
10
 
10
11
  export async function createWalletInstance(context: {
11
12
  integrityContext: IntegrityContext;
@@ -13,15 +14,25 @@ export async function createWalletInstance(context: {
13
14
  appFetch?: GlobalFetch["fetch"];
14
15
  }) {
15
16
  const { integrityContext } = context;
16
-
17
17
  const api = getWalletProviderClient(context);
18
18
 
19
19
  //1. Obtain nonce
20
20
  const challenge = await api.get("/nonce").then((response) => response.nonce);
21
21
 
22
+ Logger.log(
23
+ LogLevel.DEBUG,
24
+ `Challenge obtained from ${context.walletProviderBaseUrl}: ${challenge}`
25
+ );
26
+
22
27
  const keyAttestation = await integrityContext.getAttestation(challenge);
28
+
23
29
  const hardwareKeyTag = integrityContext.getHardwareKeyTag();
24
30
 
31
+ Logger.log(
32
+ LogLevel.DEBUG,
33
+ `Key attestation: ${keyAttestation}\nAssociated hardware key tag: ${hardwareKeyTag}`
34
+ );
35
+
25
36
  //2. Create Wallet Instance
26
37
  await api
27
38
  .post("/wallet-instances", {
@@ -37,6 +48,11 @@ export async function createWalletInstance(context: {
37
48
  }
38
49
 
39
50
  const handleCreateWalletInstanceError = (e: unknown) => {
51
+ Logger.log(
52
+ LogLevel.ERROR,
53
+ `An error occurred while calling /wallet-instances endpoint: ${e}`
54
+ );
55
+
40
56
  if (!(e instanceof WalletProviderResponseError)) {
41
57
  throw e;
42
58
  }
@@ -87,3 +103,16 @@ export async function getWalletInstanceStatus(context: {
87
103
  path: { id: context.id },
88
104
  });
89
105
  }
106
+
107
+ /**
108
+ * Get the status of the current Wallet Instance.
109
+ * @returns Details on the status of the current Wallet Instance
110
+ */
111
+ export async function getCurrentWalletInstanceStatus(context: {
112
+ walletProviderBaseUrl: string;
113
+ appFetch?: GlobalFetch["fetch"];
114
+ }): Promise<WalletInstanceData> {
115
+ const api = getWalletProviderClient(context);
116
+
117
+ return api.get("/wallet-instances/current/status");
118
+ }
@@ -1,7 +1,11 @@
1
1
  # Wallet Instance Attestation
2
2
 
3
- This flow consists of a single step and is used to obtain a Wallet Instance Attestation. The wallet provider must implement its endpoints based on the OpenAPI specification provided in the [wallet-instance.yaml](../../openapi/wallet-provider.yaml) file.
4
- In order to require a status attestation the consumer application must provide:
3
+ This flow consists of a single step and is used to obtain a Wallet Instance Attestation. The attestation is issued in multiple formats:
4
+ - `jwt`
5
+ - `dc+sd-jwt`
6
+ - `mso_mdoc`
7
+
8
+ The wallet provider must implement its endpoints based on the OpenAPI specification provided in the [wallet-instance.yaml](../../openapi/wallet-provider.yaml) file. In order to require a status attestation the consumer application must provide:
5
9
 
6
10
  - `wiaCryptoContext` object that is used to sign the attestation request. The key must be generated before creating the crypto context;
7
11
  - `integrityContext` object that is used to verify the integrity of the device where the app is running. The key tag must be the same used when creating the Wallet Instance;
@@ -29,10 +33,11 @@ const issuedAttestation = await WalletInstanceAttestation.getAttestation({
29
33
  walletProviderBaseUrl: WALLET_PROVIDER_BASE_URL,
30
34
  appFetch,
31
35
  });
36
+ // [{ "format": "jwt", "wallet_attestation": "ey..." }, { "format": "dc+sd-jwt", "wallet_attestation": "ey..." }]
32
37
  return issuedAttestation;
33
38
  ```
34
39
 
35
- The returned `issuedAttestation` is supposed to be stored and used for any future operation that requires a Wallet Instance Attestation. The wallet attestation has a limited validity and must be regenerated when it expires.
40
+ The returned `issuedAttestation` is supposed to be stored and used for any future operation that requires a Wallet Instance Attestation in one of the available formats. The wallet attestation has a limited validity and must be regenerated when it expires.
36
41
 
37
42
  ## Mapped results
38
43
 
@@ -2,8 +2,8 @@ import { WalletInstanceAttestationJwt } from "./types";
2
2
  import { decode as decodeJwt } from "@pagopa/io-react-native-jwt";
3
3
  import { verify as verifyJwt } from "@pagopa/io-react-native-jwt";
4
4
 
5
- import { getAttestation } from "./issuing";
6
- export { getAttestation };
5
+ export { getAttestation } from "./issuing";
6
+
7
7
  /**
8
8
  * Decode a given JWT to get the parsed Wallet Instance Attestation object they define.
9
9
  * It ensures provided data is in a valid shape.
@@ -5,13 +5,14 @@ import {
5
5
  } from "@pagopa/io-react-native-jwt";
6
6
  import { fixBase64EncodingOnKey, JWK } from "../utils/jwk";
7
7
  import { getWalletProviderClient } from "../client";
8
- import type { IntegrityContext } from "..";
8
+ import type { IntegrityContext } from "../utils/integrity";
9
+ import { LogLevel, Logger } from "../utils/logging";
9
10
  import {
10
11
  ResponseErrorBuilder,
11
12
  WalletProviderResponseError,
12
13
  WalletProviderResponseErrorCodes,
13
14
  } from "../utils/errors";
14
- import { TokenResponse } from "./types";
15
+ import { WalletAttestationResponse } from "./types";
15
16
 
16
17
  /**
17
18
  * Getter for an attestation request. The attestation request is a JWT that will be sent to the Wallet Provider to request a Wallet Instance Attestation.
@@ -47,8 +48,8 @@ export async function getAttestationRequest(
47
48
  return new SignJWT(wiaCryptoContext)
48
49
  .setPayload({
49
50
  iss: keyThumbprint,
50
- sub: walletProviderBaseUrl,
51
- challenge,
51
+ aud: walletProviderBaseUrl,
52
+ nonce: challenge,
52
53
  hardware_signature: signature,
53
54
  integrity_assertion: authenticatorData,
54
55
  hardware_key_tag: hardwareKeyTag,
@@ -58,7 +59,7 @@ export async function getAttestationRequest(
58
59
  })
59
60
  .setProtectedHeader({
60
61
  kid: publicKey.kid,
61
- typ: "war+jwt",
62
+ typ: "wp-war+jwt",
62
63
  })
63
64
  .setIssuedAt()
64
65
  .setExpirationTime("1h")
@@ -67,6 +68,7 @@ export async function getAttestationRequest(
67
68
 
68
69
  /**
69
70
  * Request a Wallet Instance Attestation (WIA) to the Wallet provider
71
+ * @version 1.0.0
70
72
  *
71
73
  * @param params.wiaCryptoContext The key pair associated with the WIA. Will be use to prove the ownership of the attestation.
72
74
  * @param params.appFetch (optional) Http client
@@ -84,7 +86,7 @@ export const getAttestation = async ({
84
86
  integrityContext: IntegrityContext;
85
87
  walletProviderBaseUrl: string;
86
88
  appFetch?: GlobalFetch["fetch"];
87
- }): Promise<string> => {
89
+ }): Promise<WalletAttestationResponse["wallet_attestations"]> => {
88
90
  const api = getWalletProviderClient({
89
91
  walletProviderBaseUrl,
90
92
  appFetch,
@@ -92,6 +94,10 @@ export const getAttestation = async ({
92
94
 
93
95
  // 1. Get nonce from backend
94
96
  const challenge = await api.get("/nonce").then((response) => response.nonce);
97
+ Logger.log(
98
+ LogLevel.DEBUG,
99
+ `Challenge obtained from ${walletProviderBaseUrl}: ${challenge} `
100
+ );
95
101
 
96
102
  // 2. Get a signed attestation request
97
103
  const signedAttestationRequest = await getAttestationRequest(
@@ -100,22 +106,37 @@ export const getAttestation = async ({
100
106
  integrityContext,
101
107
  walletProviderBaseUrl
102
108
  );
109
+ Logger.log(
110
+ LogLevel.DEBUG,
111
+ `Signed attestation request: ${signedAttestationRequest}`
112
+ );
103
113
 
104
- // 3. Request WIA
105
- const tokenResponse = await api
106
- .post("/token", {
114
+ // 3. Request WIA in multiple formats
115
+ const response = await api
116
+ .post("/wallet-attestations", {
107
117
  body: {
108
- grant_type: "urn:ietf:params:oauth:grant-type:jwt-bearer",
109
118
  assertion: signedAttestationRequest,
110
119
  },
111
120
  })
112
- .then((result) => TokenResponse.parse(result))
121
+ .then(WalletAttestationResponse.parse)
113
122
  .catch(handleAttestationCreationError);
114
123
 
115
- return tokenResponse.wallet_attestation;
124
+ for (const attestation of response.wallet_attestations) {
125
+ Logger.log(
126
+ LogLevel.DEBUG,
127
+ `Obtained wallet attestation in ${attestation.format} format: ${attestation.wallet_attestation}`
128
+ );
129
+ }
130
+
131
+ return response.wallet_attestations;
116
132
  };
117
133
 
118
134
  const handleAttestationCreationError = (e: unknown) => {
135
+ Logger.log(
136
+ LogLevel.ERROR,
137
+ `An error occurred while calling /wallet-attestation endpoint: ${e}`
138
+ );
139
+
119
140
  if (!(e instanceof WalletProviderResponseError)) {
120
141
  throw e;
121
142
  }
@@ -33,15 +33,17 @@ export const WalletInstanceAttestationRequestJwt = z.object({
33
33
  header: z.intersection(
34
34
  Jwt.shape.header,
35
35
  z.object({
36
- typ: z.literal("war+jwt"),
36
+ typ: z.literal("wp-war+jwt"),
37
37
  })
38
38
  ),
39
39
  payload: z.intersection(
40
40
  Jwt.shape.payload,
41
41
  z.object({
42
42
  aud: z.string(),
43
- jti: z.string(),
44
43
  nonce: z.string(),
44
+ hardware_signature: z.string(),
45
+ integrity_assertion: z.string(),
46
+ hardware_key_tag: z.string(),
45
47
  })
46
48
  ),
47
49
  });
@@ -53,7 +55,8 @@ export const WalletInstanceAttestationJwt = z.object({
53
55
  header: z.intersection(
54
56
  Jwt.shape.header,
55
57
  z.object({
56
- typ: z.literal("wallet-attestation+jwt"),
58
+ typ: z.literal("oauth-client-attestation+jwt"),
59
+ trust_chain: z.array(z.string()),
57
60
  })
58
61
  ),
59
62
  payload: z.intersection(
@@ -61,27 +64,20 @@ export const WalletInstanceAttestationJwt = z.object({
61
64
  z.object({
62
65
  sub: z.string(),
63
66
  aal: z.string(),
64
- authorization_endpoint: z.string(),
65
- response_types_supported: z.array(z.string()),
66
- vp_formats_supported: z.object({
67
- "vc+sd-jwt": z
68
- .object({
69
- "sd-jwt_alg_values": z.array(z.string()),
70
- })
71
- .optional(),
72
- "vp+sd-jwt": z
73
- .object({
74
- "sd-jwt_alg_values": z.array(z.string()),
75
- })
76
- .optional(),
77
- }),
78
- request_object_signing_alg_values_supported: z.array(z.string()),
79
- presentation_definition_uri_supported: z.boolean(),
67
+ wallet_link: z.string().optional(),
68
+ wallet_name: z.string().optional(),
80
69
  })
81
70
  ),
82
71
  });
83
72
 
84
- export type TokenResponse = z.infer<typeof TokenResponse>;
85
- export const TokenResponse = z.object({
86
- wallet_attestation: z.string(),
73
+ export type WalletAttestationResponse = z.infer<
74
+ typeof WalletAttestationResponse
75
+ >;
76
+ export const WalletAttestationResponse = z.object({
77
+ wallet_attestations: z.array(
78
+ z.object({
79
+ wallet_attestation: z.string(),
80
+ format: z.enum(["jwt", "dc+sd-jwt", "mso_mdoc"]),
81
+ })
82
+ ),
87
83
  });
@@ -1,48 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getIssuerConfig = void 0;
7
- var _issuer = require("../../entity/openid-connect/issuer");
8
- /**
9
- * Common configuration for the issuer.
10
- * This is needed to have a common configuration for the issuer to be used in our flows.
11
- * It allows to support multiple issuers with different configurations, defining a common interface to interact with them.
12
- */
13
-
14
- /**
15
- * WARNING: This function must be called after {@link startFlow}. The next function to be called is {@link startUserAuthorization}.
16
- * Get the Issuer's configuration from the Issuer's metadata.
17
- * Currently it only supports a mixed configuration based on OpenID Connect partial implementation.
18
- * @param issuerUrl The base url of the Issuer returned by {@link startFlow}
19
- * @param context.appFetch (optional) fetch api implementation. Default: built-in fetch
20
- * @returns The Issuer's configuration
21
- */
22
- const getIssuerConfig = async function (issuerUrl) {
23
- let context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
24
- const res = await (0, _issuer.getCredentialIssuerMetadata)(issuerUrl, {
25
- appFetch: context.appFetch
26
- });
27
- return credentialIssuerRationalization(res);
28
- };
29
-
30
- /**
31
- * Rationalize the issuer's metadata to the issuer's configuration which is then used in our flows to interact with the issuer.
32
- * @param issuerMetadata - The issuer's metadata
33
- * @returns the isssuer configuration to be used later in our flows
34
- */
35
- exports.getIssuerConfig = getIssuerConfig;
36
- const credentialIssuerRationalization = issuerMetadata => {
37
- return {
38
- issuerConf: {
39
- credential_configurations_supported: issuerMetadata.credential_configurations_supported,
40
- pushed_authorization_request_endpoint: issuerMetadata.pushed_authorization_request_endpoint,
41
- authorization_endpoint: issuerMetadata.authorization_endpoint,
42
- token_endpoint: issuerMetadata.token_endpoint,
43
- credential_endpoint: issuerMetadata.credential_endpoint,
44
- keys: issuerMetadata.jwks.keys
45
- }
46
- };
47
- };
48
- //# sourceMappingURL=02-get-issuer-config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_issuer","require","getIssuerConfig","issuerUrl","context","arguments","length","undefined","res","getCredentialIssuerMetadata","appFetch","credentialIssuerRationalization","exports","issuerMetadata","issuerConf","credential_configurations_supported","pushed_authorization_request_endpoint","authorization_endpoint","token_endpoint","credential_endpoint","keys","jwks"],"sourceRoot":"../../../../src","sources":["credential/issuance/02-get-issuer-config.ts"],"mappings":";;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAUA;AACA;AACA;AACA;AACA;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,eAAgC,GAAG,eAAAA,CAC9CC,SAAS,EAEuB;EAAA,IADhCC,OAAO,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAEZ,MAAMG,GAAG,GAAG,MAAM,IAAAC,mCAA2B,EAACN,SAAS,EAAE;IACvDO,QAAQ,EAAEN,OAAO,CAACM;EACpB,CAAC,CAAC;EAEF,OAAOC,+BAA+B,CAACH,GAAG,CAAC;AAC7C,CAAC;;AAED;AACA;AACA;AACA;AACA;AAJAI,OAAA,CAAAV,eAAA,GAAAA,eAAA;AAKA,MAAMS,+BAA+B,GACnCE,cAAuE,IAC9B;EACzC,OAAO;IACLC,UAAU,EAAE;MACVC,mCAAmC,EACjCF,cAAc,CAACE,mCAAmC;MACpDC,qCAAqC,EACnCH,cAAc,CAACG,qCAAqC;MACtDC,sBAAsB,EAAEJ,cAAc,CAACI,sBAAsB;MAC7DC,cAAc,EAAEL,cAAc,CAACK,cAAc;MAC7CC,mBAAmB,EAAEN,cAAc,CAACM,mBAAmB;MACvDC,IAAI,EAAEP,cAAc,CAACQ,IAAI,CAACD;IAC5B;EACF,CAAC;AACH,CAAC"}
@@ -1,25 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getCredentialIssuerMetadata = getCredentialIssuerMetadata;
7
- var _misc = require("../../../utils/misc");
8
- var _types = require("./types");
9
- /**
10
- * Fetch the signed entity configuration token for an entity
11
- *
12
- * @param entityBaseUrl The url of the entity to fetch
13
- * @param param.appFetch (optional) fetch api implemention
14
- * @returns The signed Entity Configuration token
15
- */
16
- async function getCredentialIssuerMetadata(entityBaseUrl) {
17
- let {
18
- appFetch = fetch
19
- } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
20
- const wellKnownUrl = `${entityBaseUrl}/.well-known/openid-credential-issuer`;
21
- return await appFetch(wellKnownUrl, {
22
- method: "GET"
23
- }).then((0, _misc.hasStatusOrThrow)(200)).then(res => res.json()).then(_types.CredentialIssuerConfiguration.parse);
24
- }
25
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_misc","require","_types","getCredentialIssuerMetadata","entityBaseUrl","appFetch","fetch","arguments","length","undefined","wellKnownUrl","method","then","hasStatusOrThrow","res","json","CredentialIssuerConfiguration","parse"],"sourceRoot":"../../../../../src","sources":["entity/openid-connect/issuer/index.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAeE,2BAA2BA,CAC/CC,aAAqB,EAMmB;EAAA,IALxC;IACEC,QAAQ,GAAGC;EAGb,CAAC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAEN,MAAMG,YAAY,GAAI,GAAEN,aAAc,uCAAsC;EAE5E,OAAO,MAAMC,QAAQ,CAACK,YAAY,EAAE;IAClCC,MAAM,EAAE;EACV,CAAC,CAAC,CACCC,IAAI,CAAC,IAAAC,sBAAgB,EAAC,GAAG,CAAC,CAAC,CAC3BD,IAAI,CAAEE,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC,CAAC,CAAC,CACzBH,IAAI,CAACI,oCAA6B,CAACC,KAAK,CAAC;AAC9C"}
@@ -1,64 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.CredentialSdJwtClaims = exports.CredentialIssuerKeys = exports.CredentialIssuerConfiguration = exports.CredentialFormat = exports.CredentialDisplay = exports.CredentialConfigurationSupported = exports.CredentialClaimDisplay = exports.CredentialClaim = void 0;
7
- var _jwk = require("../../../utils/jwk");
8
- var z = _interopRequireWildcard(require("zod"));
9
- 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); }
10
- 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; }
11
- // Display metadata for a credential, used by the issuer to
12
- // instruct the Wallet Solution on how to render the credential correctly
13
-
14
- const CredentialDisplay = z.object({
15
- name: z.string(),
16
- locale: z.string(),
17
- logo: z.object({
18
- url: z.string(),
19
- alt_text: z.string()
20
- }).optional(),
21
- background_color: z.string().optional(),
22
- text_color: z.string().optional()
23
- });
24
- exports.CredentialDisplay = CredentialDisplay;
25
- const CredentialClaimDisplay = z.object({
26
- name: z.string(),
27
- locale: z.string()
28
- });
29
- exports.CredentialClaimDisplay = CredentialClaimDisplay;
30
- const CredentialFormat = z.union([z.literal("vc+sd-jwt"), z.literal("mso_mdoc")]);
31
- exports.CredentialFormat = CredentialFormat;
32
- const CredentialClaim = z.object({
33
- mandatory: z.boolean(),
34
- display: z.array(CredentialClaimDisplay)
35
- });
36
- exports.CredentialClaim = CredentialClaim;
37
- const CredentialSdJwtClaims = z.record(CredentialClaim);
38
- exports.CredentialSdJwtClaims = CredentialSdJwtClaims;
39
- const CredentialConfigurationSupported = z.record(z.object({
40
- cryptographic_suites_supported: z.array(z.string()),
41
- vct: z.string().optional(),
42
- scope: z.string().optional(),
43
- cryptographic_binding_methods_supported: z.array(z.string()),
44
- display: z.array(CredentialDisplay),
45
- format: CredentialFormat,
46
- claims: z.union([CredentialSdJwtClaims, z.record(z.string(), CredentialSdJwtClaims)]).optional()
47
- }));
48
- exports.CredentialConfigurationSupported = CredentialConfigurationSupported;
49
- const CredentialIssuerKeys = z.object({
50
- keys: z.array(_jwk.JWK)
51
- });
52
- exports.CredentialIssuerKeys = CredentialIssuerKeys;
53
- const CredentialIssuerConfiguration = z.object({
54
- credential_configurations_supported: CredentialConfigurationSupported,
55
- pushed_authorization_request_endpoint: z.string(),
56
- dpop_signing_alg_values_supported: z.array(z.string()),
57
- jwks: CredentialIssuerKeys,
58
- credential_issuer: z.string(),
59
- authorization_endpoint: z.string(),
60
- token_endpoint: z.string(),
61
- credential_endpoint: z.string()
62
- });
63
- exports.CredentialIssuerConfiguration = CredentialIssuerConfiguration;
64
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_jwk","require","z","_interopRequireWildcard","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","CredentialDisplay","object","name","string","locale","logo","url","alt_text","optional","background_color","text_color","exports","CredentialClaimDisplay","CredentialFormat","union","literal","CredentialClaim","mandatory","boolean","display","array","CredentialSdJwtClaims","record","CredentialConfigurationSupported","cryptographic_suites_supported","vct","scope","cryptographic_binding_methods_supported","format","claims","CredentialIssuerKeys","keys","JWK","CredentialIssuerConfiguration","credential_configurations_supported","pushed_authorization_request_endpoint","dpop_signing_alg_values_supported","jwks","credential_issuer","authorization_endpoint","token_endpoint","credential_endpoint"],"sourceRoot":"../../../../../src","sources":["entity/openid-connect/issuer/types.ts"],"mappings":";;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,CAAA,GAAAC,uBAAA,CAAAF,OAAA;AAAyB,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,SAAAF,wBAAAM,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAA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Wildcard","_","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","verify","token","kid","jwks","jwk","find","k","Error","protectedHeader","header","payload","verifyJwt","decode","decodeJwt","FirstElementShape","EntityConfiguration","MiddleElementShape","EntityStatement","LastElementShape","union","TrustAnchorEntityConfiguration","validateTrustChain","trustAnchorEntity","chain","length","IoWalletError","selectTokenShape","elementIndex","selectKid","currentIndex","shape","parse","selectKeys","keys","nextIndex","nextToken","Promise","all","map","i","args","renewTrustChain","appFetch","arguments","undefined","fetch","e","safeParse","_ref","es","ec","success","getSignedEntityConfiguration","data","iss","getSignedEntityStatement","sub","reject"],"sourceRoot":"../../../../src","sources":["entity/trust/chain.ts"],"mappings":";;;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAIA,IAAAC,MAAA,GAAAD,OAAA;AAMA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,CAAA,GAAAC,uBAAA,CAAAJ,OAAA;AACA,IAAAK,CAAA,GAAAL,OAAA;AAA2E,SAAAM,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,SAAA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