@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
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.X509ValidationError = exports.TrustChainTokenMissingError = exports.TrustChainRenewalError = exports.TrustChainEmptyError = exports.TrustAnchorKidMissingError = exports.RelyingPartyNotAuthorizedError = exports.MissingX509CertsError = exports.MissingFederationFetchEndpointError = exports.FederationListParseError = exports.FederationError = exports.BuildTrustChainError = void 0;
7
+ var _errors = require("../utils/errors");
8
+ // Ensure this path is correct
9
+
10
+ /**
11
+ * Base class for all federation-specific errors.
12
+ */
13
+ class FederationError extends _errors.IoWalletError {
14
+ constructor(message, details) {
15
+ super(details ? (0, _errors.serializeAttrs)({
16
+ message,
17
+ ...details
18
+ }) : message);
19
+ this.name = this.constructor.name;
20
+ }
21
+ }
22
+
23
+ /**
24
+ * Error thrown when a trust chain is unexpectedly empty.
25
+ */
26
+ exports.FederationError = FederationError;
27
+ class TrustChainEmptyError extends FederationError {
28
+ code = "ERR_FED_TRUST_CHAIN_EMPTY";
29
+ constructor() {
30
+ let message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "Trust chain cannot be empty.";
31
+ super(message, undefined);
32
+ }
33
+ }
34
+
35
+ /**
36
+ * Error thrown when a token is unexpectedly missing from a trust chain during processing.
37
+ */
38
+ exports.TrustChainEmptyError = TrustChainEmptyError;
39
+ class TrustChainTokenMissingError extends FederationError {
40
+ code = "ERR_FED_TRUST_CHAIN_TOKEN_MISSING";
41
+ constructor(message, details) {
42
+ super(message, details);
43
+ }
44
+ }
45
+
46
+ /**
47
+ * Error thrown when renewing a trust chain fails.
48
+ * This class itself might be used or could be considered a more general renewal error.
49
+ */
50
+ exports.TrustChainTokenMissingError = TrustChainTokenMissingError;
51
+ class TrustChainRenewalError extends FederationError {
52
+ code = "ERR_FED_TRUST_CHAIN_RENEWAL_FAILED";
53
+ constructor(message, details) {
54
+ super(message, details);
55
+ }
56
+ }
57
+ exports.TrustChainRenewalError = TrustChainRenewalError;
58
+ class FederationListParseError extends FederationError {
59
+ code = "ERR_FED_FEDERATION_LIST_PARSE_FAILED";
60
+ constructor(message, details) {
61
+ super(message, details);
62
+ }
63
+ }
64
+
65
+ /**
66
+ * General error thrown during the trust chain building process.
67
+ */
68
+ exports.FederationListParseError = FederationListParseError;
69
+ class BuildTrustChainError extends FederationError {
70
+ code = "ERR_FED_BUILD_TRUST_CHAIN_FAILED";
71
+ constructor(message, details) {
72
+ super(message, details);
73
+ }
74
+ }
75
+
76
+ /**
77
+ * Error thrown when the Trust Anchor's key is missing a 'kid'.
78
+ */
79
+ exports.BuildTrustChainError = BuildTrustChainError;
80
+ class TrustAnchorKidMissingError extends FederationError {
81
+ code = "ERR_FED_TRUST_ANCHOR_KID_MISSING";
82
+ constructor() {
83
+ let message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "Missing 'kid' in provided Trust Anchor key.";
84
+ super(message, undefined);
85
+ }
86
+ }
87
+
88
+ /**
89
+ * Error thrown if the Relying Party is not found in the Trust Anchor's federation list.
90
+ */
91
+ exports.TrustAnchorKidMissingError = TrustAnchorKidMissingError;
92
+ class RelyingPartyNotAuthorizedError extends FederationError {
93
+ code = "ERR_FED_RELYING_PARTY_NOT_AUTHORIZED";
94
+ constructor(message, details) {
95
+ super(message, details);
96
+ }
97
+ }
98
+
99
+ /**
100
+ * Error thrown when a 'federation_fetch_endpoint' is missing in an entity's configuration.
101
+ */
102
+ exports.RelyingPartyNotAuthorizedError = RelyingPartyNotAuthorizedError;
103
+ class MissingFederationFetchEndpointError extends FederationError {
104
+ code = "ERR_FED_MISSING_FEDERATION_FETCH_ENDPOINT";
105
+ constructor(message, details) {
106
+ super(message, details);
107
+ }
108
+ }
109
+
110
+ /**
111
+ * Error thrown when the X.509 certificate chain is missing in an entity's configuration.
112
+ */
113
+ exports.MissingFederationFetchEndpointError = MissingFederationFetchEndpointError;
114
+ class MissingX509CertsError extends FederationError {
115
+ code = "ERR_FED_MISSING_X509_CERTS";
116
+ constructor(message) {
117
+ super(message, undefined);
118
+ }
119
+ }
120
+
121
+ /**
122
+ * Error thrown when an X.509 certificate validation fails.
123
+ * This is used to indicate issues with the certificate chain or signature verification.
124
+ */
125
+ exports.MissingX509CertsError = MissingX509CertsError;
126
+ class X509ValidationError extends FederationError {
127
+ code = "ERR_FED_X509_VALIDATION_FAILED";
128
+ constructor(message, details) {
129
+ super(message, details);
130
+ }
131
+ }
132
+ exports.X509ValidationError = X509ValidationError;
133
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_errors","require","FederationError","IoWalletError","constructor","message","details","serializeAttrs","name","exports","TrustChainEmptyError","code","arguments","length","undefined","TrustChainTokenMissingError","TrustChainRenewalError","FederationListParseError","BuildTrustChainError","TrustAnchorKidMissingError","RelyingPartyNotAuthorizedError","MissingFederationFetchEndpointError","MissingX509CertsError","X509ValidationError"],"sourceRoot":"../../../src","sources":["trust/errors.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACmF;;AAEnF;AACA;AACA;AACO,MAAMC,eAAe,SAASC,qBAAa,CAAC;EACjDC,WAAWA,CAACC,OAAe,EAAEC,OAAiC,EAAE;IAC9D,KAAK,CAACA,OAAO,GAAG,IAAAC,sBAAc,EAAC;MAAEF,OAAO;MAAE,GAAGC;IAAQ,CAAC,CAAC,GAAGD,OAAO,CAAC;IAClE,IAAI,CAACG,IAAI,GAAG,IAAI,CAACJ,WAAW,CAACI,IAAI;EACnC;AACF;;AAEA;AACA;AACA;AAFAC,OAAA,CAAAP,eAAA,GAAAA,eAAA;AAGO,MAAMQ,oBAAoB,SAASR,eAAe,CAAC;EACxDS,IAAI,GAAG,2BAA2B;EAClCP,WAAWA,CAAA,EAA2C;IAAA,IAA1CC,OAAO,GAAAO,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,8BAA8B;IAClD,KAAK,CAACP,OAAO,EAAES,SAAS,CAAC;EAC3B;AACF;;AAEA;AACA;AACA;AAFAL,OAAA,CAAAC,oBAAA,GAAAA,oBAAA;AAGO,MAAMK,2BAA2B,SAASb,eAAe,CAAC;EAC/DS,IAAI,GAAG,mCAAmC;E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OAAe,EACfC,OAAqE,EACrE;IACA,KAAK,CAACD,OAAO,EAAEC,OAAO,CAAC;EACzB;AACF;;AAEA;AACA;AACA;AAFAG,OAAA,CAAAW,8BAAA,GAAAA,8BAAA;AAGO,MAAMC,mCAAmC,SAASnB,eAAe,CAAC;EACvES,IAAI,GAAG,2CAA2C;EAClDP,WAAWA,CACTC,OAAe,EACfC,OAA8D,EAC9D;IACA,KAAK,CAACD,OAAO,EAAEC,OAAO,CAAC;EACzB;AACF;;AAEA;AACA;AACA;AAFAG,OAAA,CAAAY,mCAAA,GAAAA,mCAAA;AAGO,MAAMC,qBAAqB,SAASpB,eAAe,CAAC;EACzDS,IAAI,GAAG,4BAA4B;EACnCP,WAAWA,CAACC,OAAe,EAAE;IAC3B,KAAK,CAACA,OAAO,EAAES,SAAS,CAAC;EAC3B;AACF;;AAEA;AACA;AACA;AACA;AAHAL,OAAA,CAAAa,qBAAA,GAAAA,qBAAA;AAIO,MAAMC,mBAAmB,SAASrB,eAAe,CAAC;EACvDS,IAAI,GAAG,gCAAgC;EACvCP,WAAWA,CACTC,OAAe,EACfC,OAMC,EACD;IACA,KAAK,CAACD,OAAO,EAAEC,OAAO,CAAC;EACzB;AACF;AAACG,OAAA,CAAAc,mBAAA,GAAAA,mBAAA"}
@@ -0,0 +1,288 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.buildTrustChain = buildTrustChain;
7
+ exports.getEntityConfiguration = exports.getCredentialIssuerEntityConfiguration = void 0;
8
+ exports.getEntityStatement = getEntityStatement;
9
+ exports.getFederationList = getFederationList;
10
+ exports.getRelyingPartyEntityConfiguration = void 0;
11
+ exports.getSignedEntityConfiguration = getSignedEntityConfiguration;
12
+ exports.getSignedEntityStatement = getSignedEntityStatement;
13
+ exports.getWalletProviderEntityConfiguration = exports.getTrustAnchorEntityConfiguration = void 0;
14
+ exports.verifyTrustChain = verifyTrustChain;
15
+ var _utils = require("./utils");
16
+ var _ioReactNativeJwt = require("@pagopa/io-react-native-jwt");
17
+ var _types = require("./types");
18
+ var _chain = require("./chain");
19
+ var _misc = require("../utils/misc");
20
+ var _errors = require("./errors");
21
+ /**
22
+ * Verify a given trust chain is actually valid.
23
+ * It can handle fast chain renewal, which means we try to fetch a fresh version of each statement.
24
+ *
25
+ * @param trustAnchorEntity The entity configuration of the known trust anchor
26
+ * @param chain The chain of statements to be validated
27
+ * @param x509Options Options for the verification process
28
+ * @param appFetch (optional) fetch api implementation
29
+ * @param renewOnFail Whether to attempt to renew the trust chain if the initial validation fails
30
+ * @returns The result of the chain validation
31
+ * @throws {FederationError} If the chain is not valid
32
+ */
33
+ async function verifyTrustChain(trustAnchorEntity, chain) {
34
+ let x509Options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
35
+ connectTimeout: 10000,
36
+ readTimeout: 10000,
37
+ requireCrl: true
38
+ };
39
+ let {
40
+ appFetch = fetch,
41
+ renewOnFail = true
42
+ } = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
43
+ try {
44
+ return (0, _chain.validateTrustChain)(trustAnchorEntity, chain, x509Options);
45
+ } catch (error) {
46
+ if (renewOnFail) {
47
+ const renewedChain = await (0, _chain.renewTrustChain)(chain, appFetch);
48
+ return (0, _chain.validateTrustChain)(trustAnchorEntity, renewedChain, x509Options);
49
+ } else {
50
+ throw error;
51
+ }
52
+ }
53
+ }
54
+
55
+ /**
56
+ * Fetch the signed entity configuration token for an entity
57
+ *
58
+ * @param entityBaseUrl The url of the entity to fetch
59
+ * @param appFetch (optional) fetch api implementation
60
+ * @returns The signed Entity Configuration token
61
+ */
62
+ async function getSignedEntityConfiguration(entityBaseUrl) {
63
+ let {
64
+ appFetch = fetch
65
+ } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
66
+ const wellKnownUrl = `${entityBaseUrl}/.well-known/openid-federation`;
67
+ return await appFetch(wellKnownUrl, {
68
+ method: "GET"
69
+ }).then((0, _misc.hasStatusOrThrow)(200)).then(res => res.text());
70
+ }
71
+
72
+ /**
73
+ * Fetch and parse the entity configuration document for a given federation entity.
74
+ * This is an inner method to serve public interfaces.
75
+ *
76
+ * To add another entity configuration type (example: Foo entity type):
77
+ * - create its zod schema and type by inherit from the base type (example: FooEntityConfiguration = BaseEntityConfiguration.and(...))
78
+ * - add such type to EntityConfiguration union
79
+ * - add an overload to this function
80
+ * - create a public function which use such type (example: getFooEntityConfiguration = (url, options) => Promise<FooEntityConfiguration>)
81
+ *
82
+ * @param entityBaseUrl The base url of the entity.
83
+ * @param schema The expected schema of the entity configuration, according to the kind of entity we are fetching from.
84
+ * @param options An optional object with additional options.
85
+ * @param options.appFetch An optional instance of the http client to be used.
86
+ * @returns The parsed entity configuration object
87
+ * @throws {IoWalletError} If the http request fails
88
+ * @throws Parse error if the document is not in the expected shape.
89
+ */
90
+
91
+ async function fetchAndParseEntityConfiguration(entityBaseUrl, schema) {
92
+ let {
93
+ appFetch = fetch
94
+ } = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
95
+ const responseText = await getSignedEntityConfiguration(entityBaseUrl, {
96
+ appFetch
97
+ });
98
+ const responseJwt = (0, _ioReactNativeJwt.decode)(responseText);
99
+ return schema.parse({
100
+ header: responseJwt.protectedHeader,
101
+ payload: responseJwt.payload
102
+ });
103
+ }
104
+ const getWalletProviderEntityConfiguration = (entityBaseUrl, options) => fetchAndParseEntityConfiguration(entityBaseUrl, _types.WalletProviderEntityConfiguration, options);
105
+ exports.getWalletProviderEntityConfiguration = getWalletProviderEntityConfiguration;
106
+ const getCredentialIssuerEntityConfiguration = (entityBaseUrl, options) => fetchAndParseEntityConfiguration(entityBaseUrl, _types.CredentialIssuerEntityConfiguration, options);
107
+ exports.getCredentialIssuerEntityConfiguration = getCredentialIssuerEntityConfiguration;
108
+ const getTrustAnchorEntityConfiguration = (entityBaseUrl, options) => fetchAndParseEntityConfiguration(entityBaseUrl, _types.TrustAnchorEntityConfiguration, options);
109
+ exports.getTrustAnchorEntityConfiguration = getTrustAnchorEntityConfiguration;
110
+ const getRelyingPartyEntityConfiguration = (entityBaseUrl, options) => fetchAndParseEntityConfiguration(entityBaseUrl, _types.RelyingPartyEntityConfiguration, options);
111
+ exports.getRelyingPartyEntityConfiguration = getRelyingPartyEntityConfiguration;
112
+ const getEntityConfiguration = (entityBaseUrl, options) => fetchAndParseEntityConfiguration(entityBaseUrl, _types.EntityConfiguration, options);
113
+
114
+ /**
115
+ * Fetch and parse the entity statement document for a given federation entity.
116
+ *
117
+ * @param accreditationBodyBaseUrl The base url of the accreditation body which holds and signs the required entity statement
118
+ * @param subordinatedEntityBaseUrl The url that identifies the subordinate entity
119
+ * @param appFetch An optional instance of the http client to be used.
120
+ * @returns The parsed entity configuration object
121
+ * @throws {IoWalletError} If the http request fails
122
+ */
123
+ exports.getEntityConfiguration = getEntityConfiguration;
124
+ async function getEntityStatement(accreditationBodyBaseUrl, subordinatedEntityBaseUrl) {
125
+ let {
126
+ appFetch = fetch
127
+ } = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
128
+ const responseText = await getSignedEntityStatement(accreditationBodyBaseUrl, subordinatedEntityBaseUrl, {
129
+ appFetch
130
+ });
131
+ const responseJwt = (0, _ioReactNativeJwt.decode)(responseText);
132
+ return _types.EntityStatement.parse({
133
+ header: responseJwt.protectedHeader,
134
+ payload: responseJwt.payload
135
+ });
136
+ }
137
+
138
+ /**
139
+ * Fetch the entity statement document for a given federation entity.
140
+ *
141
+ * @param federationFetchEndpoint The exact endpoint provided by the parent EC's metadata.
142
+ * @param subordinatedEntityBaseUrl The url that identifies the subordinate entity.
143
+ * @param appFetch An optional instance of the http client to be used.
144
+ * @returns The signed entity statement token.
145
+ * @throws {IoWalletError} If the http request fails.
146
+ */
147
+ async function getSignedEntityStatement(federationFetchEndpoint, subordinatedEntityBaseUrl) {
148
+ let {
149
+ appFetch = fetch
150
+ } = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
151
+ const url = new URL(federationFetchEndpoint);
152
+ url.searchParams.set("sub", subordinatedEntityBaseUrl);
153
+ return await appFetch(url.toString(), {
154
+ method: "GET"
155
+ }).then((0, _misc.hasStatusOrThrow)(200)).then(res => res.text());
156
+ }
157
+
158
+ /**
159
+ * Fetch the federation list document from a given endpoint.
160
+ *
161
+ * @param federationListEndpoint The URL of the federation list endpoint.
162
+ * @param appFetch An optional instance of the http client to be used.
163
+ * @returns The federation list as an array of strings.
164
+ * @throws {IoWalletError} If the HTTP request fails.
165
+ * @throws {FederationError} If the result is not in the expected format.
166
+ */
167
+ async function getFederationList(federationListEndpoint) {
168
+ let {
169
+ appFetch = fetch
170
+ } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
171
+ return await appFetch(federationListEndpoint, {
172
+ method: "GET"
173
+ }).then((0, _misc.hasStatusOrThrow)(200)).then(res => res.json()).then(json => {
174
+ const result = _types.FederationListResponse.safeParse(json);
175
+ if (!result.success) {
176
+ throw new _errors.FederationListParseError(`Invalid federation list format received from ${federationListEndpoint}. Error: ${result.error.message}`, {
177
+ url: federationListEndpoint,
178
+ parseError: result.error.toString()
179
+ });
180
+ }
181
+ return result.data;
182
+ });
183
+ }
184
+
185
+ /**
186
+ * Build a not-verified trust chain for a given Relying Party (RP) entity.
187
+ *
188
+ * @param relyingPartyEntityBaseUrl The base URL of the RP entity
189
+ * @param trustAnchorKey The public key of the Trust Anchor (TA) entity
190
+ * @param appFetch An optional instance of the http client to be used.
191
+ * @returns A list of signed tokens that represent the trust chain, in the order of the chain (from the RP to the Trust Anchor)
192
+ * @throws {FederationError} When an element of the chain fails to parse or other build steps fail.
193
+ */
194
+ async function buildTrustChain(relyingPartyEntityBaseUrl, trustAnchorKey) {
195
+ let appFetch = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : fetch;
196
+ // 1: Recursively gather the trust chain from the RP up to the Trust Anchor
197
+ const trustChain = await gatherTrustChain(relyingPartyEntityBaseUrl, appFetch);
198
+
199
+ // 2: Trust Anchor signature verification
200
+ const trustAnchorJwt = trustChain[trustChain.length - 1];
201
+ if (!trustAnchorJwt) {
202
+ throw new _errors.BuildTrustChainError("Cannot verify trust anchor: missing entity configuration in gathered chain.", {
203
+ relyingPartyUrl: relyingPartyEntityBaseUrl
204
+ });
205
+ }
206
+ if (!trustAnchorKey.kid) {
207
+ throw new _errors.TrustAnchorKidMissingError();
208
+ }
209
+ await (0, _utils.verify)(trustAnchorJwt, trustAnchorKey.kid, [trustAnchorKey]);
210
+
211
+ // 3: Check the federation list
212
+ const trustAnchorConfig = _types.EntityConfiguration.parse((0, _utils.decode)(trustAnchorJwt));
213
+ const federationListEndpoint = trustAnchorConfig.payload.metadata.federation_entity.federation_list_endpoint;
214
+ if (federationListEndpoint) {
215
+ const federationList = await getFederationList(federationListEndpoint, {
216
+ appFetch
217
+ });
218
+ if (!federationList.includes(relyingPartyEntityBaseUrl)) {
219
+ throw new _errors.RelyingPartyNotAuthorizedError("Relying Party entity base URL is not authorized by the Trust Anchor's federation list.", {
220
+ relyingPartyUrl: relyingPartyEntityBaseUrl,
221
+ federationListEndpoint
222
+ });
223
+ }
224
+ }
225
+ return trustChain;
226
+ }
227
+
228
+ /**
229
+ * Recursively gather the trust chain for an entity and all its superiors.
230
+ * @param entityBaseUrl The base URL of the entity for which to gather the chain.
231
+ * @param appFetch An optional instance of the http client to be used.
232
+ * @param isLeaf Whether the current entity is the leaf of the chain.
233
+ * @returns A full ordered list of JWTs (ECs and ESs) forming the trust chain.
234
+ * @throws {FederationError} If any of the fetched documents fail to parse or other errors occur during the gathering process.
235
+ */
236
+ async function gatherTrustChain(entityBaseUrl, appFetch) {
237
+ let isLeaf = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
238
+ const chain = [];
239
+
240
+ // Fetch self-signed EC (only needed for the leaf)
241
+ const entityECJwt = await getSignedEntityConfiguration(entityBaseUrl, {
242
+ appFetch
243
+ });
244
+ const entityEC = _types.EntityConfiguration.parse((0, _utils.decode)(entityECJwt));
245
+ if (isLeaf) {
246
+ // Only push EC for the leaf
247
+ chain.push(entityECJwt);
248
+ }
249
+
250
+ // Find authority_hints (parent, if any)
251
+ const authorityHints = entityEC.payload.authority_hints ?? [];
252
+ if (authorityHints.length === 0) {
253
+ // This is the Trust Anchor (no parent)
254
+ if (!isLeaf) {
255
+ chain.push(entityECJwt);
256
+ }
257
+ return chain;
258
+ }
259
+ const parentEntityBaseUrl = authorityHints[0];
260
+
261
+ // Fetch parent EC
262
+ const parentECJwt = await getSignedEntityConfiguration(parentEntityBaseUrl, {
263
+ appFetch
264
+ });
265
+ const parentEC = _types.EntityConfiguration.parse((0, _utils.decode)(parentECJwt));
266
+
267
+ // Fetch ES
268
+ const federationFetchEndpoint = parentEC.payload.metadata.federation_entity.federation_fetch_endpoint;
269
+ if (!federationFetchEndpoint) {
270
+ throw new _errors.MissingFederationFetchEndpointError(`Missing federation_fetch_endpoint in parent's (${parentEntityBaseUrl}) configuration when gathering chain for ${entityBaseUrl}.`, {
271
+ entityBaseUrl,
272
+ missingInEntityUrl: parentEntityBaseUrl
273
+ });
274
+ }
275
+ const entityStatementJwt = await getSignedEntityStatement(federationFetchEndpoint, entityBaseUrl, {
276
+ appFetch
277
+ });
278
+ // Validate the ES
279
+ _types.EntityStatement.parse((0, _utils.decode)(entityStatementJwt));
280
+
281
+ // Push this ES into the chain
282
+ chain.push(entityStatementJwt);
283
+
284
+ // Recurse into the parent
285
+ const parentChain = await gatherTrustChain(parentEntityBaseUrl, appFetch, false);
286
+ return chain.concat(parentChain);
287
+ }
288
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_utils","require","_ioReactNativeJwt","_types","_chain","_misc","_errors","verifyTrustChain","trustAnchorEntity","chain","x509Options","arguments","length","undefined","connectTimeout","readTimeout","requireCrl","appFetch","fetch","renewOnFail","validateTrustChain","error","renewedChain","renewTrustChain","getSignedEntityConfiguration","entityBaseUrl","wellKnownUrl","method","then","hasStatusOrThrow","res","text","fetchAndParseEntityConfiguration","schema","responseText","responseJwt","decodeJwt","parse","header","protectedHeader","payload","getWalletProviderEntityConfiguration","options","WalletProviderEntityConfiguration","exports","getCredentialIssuerEntityConfiguration","CredentialIssuerEntityConfiguration","getTrustAnchorEntityConfiguration","TrustAnchorEntityConfiguration","getRelyingPartyEntityConfiguration","RelyingPartyEntityConfiguration","getEntityConfiguration","EntityConfiguration","getEntityStatement","accreditationBodyBaseUrl","subordinatedEntityBaseUrl","getSignedEntityStatement","EntityStatement","federationFetchEndpoint","url","URL","searchParams","set","toString","getFederationList","federationListEndpoint","json","result","FederationListResponse","safeParse","success","FederationListParseError","message","parseError","data","buildTrustChain","relyingPartyEntityBaseUrl","trustAnchorKey","trustChain","gatherTrustChain","trustAnchorJwt","BuildTrustChainError","relyingPartyUrl","kid","TrustAnchorKidMissingError","verify","trustAnchorConfig","decode","metadata","federation_entity","federation_list_endpoint","federationList","includes","RelyingPartyNotAuthorizedError","isLeaf","entityECJwt","entityEC","push","authorityHints","authority_hints","parentEntityBaseUrl","parentECJwt","parentEC","federation_fetch_endpoint","MissingFederationFetchEndpointError","missingInEntityUrl","entityStatementJwt","parentChain","concat"],"sourceRoot":"../../../src","sources":["trust/index.ts"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AASA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAEA,IAAAK,OAAA,GAAAL,OAAA;AAkBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAeM,gBAAgBA,CACpCC,iBAAiD,EACjDC,KAAe,EAUiC;EAAA,IAThDC,WAAmC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG;IACpCG,cAAc,EAAE,KAAK;IACrBC,WAAW,EAAE,KAAK;IAClBC,U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e,IAAI,EAAE;EAC7D,IAAID,cAAc,CAACtF,MAAM,KAAK,CAAC,EAAE;IAC/B;IACA,IAAI,CAACkF,MAAM,EAAE;MACXrF,KAAK,CAACwF,IAAI,CAACF,WAAW,CAAC;IACzB;IACA,OAAOtF,KAAK;EACd;EAEA,MAAM2F,mBAAmB,GAAGF,cAAc,CAAC,CAAC,CAAE;;EAE9C;EACA,MAAMG,WAAW,GAAG,MAAM7E,4BAA4B,CAAC4E,mBAAmB,EAAE;IAC1EnF;EACF,CAAC,CAAC;EACF,MAAMqF,QAAQ,GAAGlD,0BAAmB,CAACf,KAAK,CAAC,IAAAkD,aAAM,EAACc,WAAW,CAAC,CAAC;;EAE/D;EACA,MAAM3C,uBAAuB,GAC3B4C,QAAQ,CAAC9D,OAAO,CAACgD,QAAQ,CAACC,iBAAiB,CAACc,yBAAyB;EACvE,IAAI,CAAC7C,uBAAuB,EAAE;IAC5B,MAAM,IAAI8C,2CAAmC,CAC1C,kDAAiDJ,mBAAoB,4CAA2C3E,aAAc,GAAE,EACjI;MAAEA,aAAa;MAAEgF,kBAAkB,EAAEL;IAAoB,CAC3D,CAAC;EACH;EAEA,MAAMM,kBAAkB,GAAG,MAAMlD,wBAAwB,CACvDE,uBAAuB,EACvBjC,aAAa,EACb;IAAER;EAAS,CACb,CAAC;EACD;EACAwC,sBAAe,CAACpB,KAAK,CAAC,IAAAkD,aAAM,EAACmB,kBAAkB,CAAC,CAAC;;EAEjD;EACAjG,KAAK,CAACwF,IAAI,CAACS,kBAAkB,CAAC;;EAE9B;EACA,MAAMC,WAAW,GAAG,MAAM5B,gBAAgB,CACxCqB,mBAAmB,EACnBnF,QAAQ,EACR,KACF,CAAC;EAED,OAAOR,KAAK,CAACmG,MAAM,CAACD,WAAW,CAAC;AAClC"}
@@ -3,11 +3,11 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.WalletProviderEntityConfiguration = exports.TrustMark = exports.TrustAnchorEntityConfiguration = exports.RelyingPartyEntityConfiguration = exports.EntityStatement = exports.EntityConfigurationHeader = exports.EntityConfiguration = exports.CredentialIssuerEntityConfiguration = void 0;
7
- var _types = require("../../sd-jwt/types");
8
- var _jwk = require("../../utils/jwk");
6
+ exports.WalletProviderEntityConfiguration = exports.TrustMark = exports.TrustAnchorEntityConfiguration = exports.RelyingPartyEntityConfiguration = exports.FederationListResponse = exports.EntityStatement = exports.EntityConfigurationHeader = exports.EntityConfiguration = exports.CredentialIssuerEntityConfiguration = void 0;
7
+ var _types = require("../sd-jwt/types");
8
+ var _jwk = require("../utils/jwk");
9
9
  var z = _interopRequireWildcard(require("zod"));
10
- var _types2 = require("../../credential/presentation/types");
10
+ var _types2 = require("../credential/presentation/types");
11
11
  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
12
  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
13
  const TrustMark = z.object({
@@ -24,36 +24,25 @@ const RelyingPartyMetadata = z.object({
24
24
  }),
25
25
  contacts: z.array(z.string()).optional(),
26
26
  presentation_definition: _types2.PresentationDefinition.optional(),
27
- presentation_definition_uri: z.string().optional()
27
+ request_uris: z.array(z.string()).optional(),
28
+ authorization_signed_response_alg: z.string().optional(),
29
+ authorization_encrypted_response_alg: z.string().optional(),
30
+ authorization_encrypted_response_enc: z.string().optional()
28
31
  });
29
- //.passthrough();
30
32
 
31
33
  // Display metadata for a credential, used by the issuer to
32
34
  // instruct the Wallet Solution on how to render the credential correctly
33
35
  const CredentialDisplayMetadata = z.object({
34
36
  name: z.string(),
35
- locale: z.string(),
36
- logo: z.object({
37
- url: z.string(),
38
- alt_text: z.string()
39
- }).optional(),
40
- // TODO [SIW-1268]: should not be optional
41
- background_color: z.string().optional(),
42
- // TODO [SIW-1268]: should not be optional
43
- text_color: z.string().optional() // TODO [SIW-1268]: should not be optional
37
+ locale: z.string()
44
38
  });
45
39
 
46
40
  // Metadata for displaying issuer information
47
41
 
48
42
  const CredentialIssuerDisplayMetadata = z.object({
49
43
  name: z.string(),
50
- locale: z.string(),
51
- logo: z.object({
52
- url: z.string(),
53
- alt_text: z.string()
54
- }).optional() // TODO [SIW-1268]: should not be optional
44
+ locale: z.string()
55
45
  });
56
-
57
46
  const ClaimsMetadata = z.record(z.object({
58
47
  value_type: z.string(),
59
48
  display: z.array(z.object({
@@ -69,14 +58,13 @@ const IssuanceErrorSupported = z.object({
69
58
  }))
70
59
  });
71
60
 
72
- // Metadata for a credentia which is supported by a Issuer
61
+ // Metadata for a credential which is supported by an Issuer
73
62
 
74
63
  const SupportedCredentialMetadata = z.object({
75
- format: z.union([z.literal("vc+sd-jwt"), z.literal("mso_mdoc")]),
64
+ format: z.union([z.literal("vc+sd-jwt"), z.literal("vc+mdoc-cbor")]),
76
65
  scope: z.string(),
77
66
  display: z.array(CredentialDisplayMetadata),
78
- claims: ClaimsMetadata.optional(),
79
- // TODO [SIW-1268]: should not be optional
67
+ claims: ClaimsMetadata,
80
68
  cryptographic_binding_methods_supported: z.array(z.string()),
81
69
  credential_signing_alg_values_supported: z.array(z.string()),
82
70
  authentic_source: z.string().optional(),
@@ -94,7 +82,7 @@ const EntityStatement = z.object({
94
82
  jwks: z.object({
95
83
  keys: z.array(_jwk.JWK)
96
84
  }),
97
- trust_marks: z.array(TrustMark),
85
+ trust_marks: z.array(TrustMark).optional(),
98
86
  iat: z.number(),
99
87
  exp: z.number()
100
88
  })
@@ -107,7 +95,7 @@ const EntityConfigurationHeader = z.object({
107
95
  });
108
96
 
109
97
  /**
110
- * @see https://openid.net/specs/openid-connect-federation-1_0-29.html#name-federation-entity
98
+ * @see https://openid.net/specs/openid-federation-1_0-41.html
111
99
  */
112
100
  exports.EntityConfigurationHeader = EntityConfigurationHeader;
113
101
  const FederationEntityMetadata = z.object({
@@ -116,6 +104,9 @@ const FederationEntityMetadata = z.object({
116
104
  federation_resolve_endpoint: z.string().optional(),
117
105
  federation_trust_mark_status_endpoint: z.string().optional(),
118
106
  federation_trust_mark_list_endpoint: z.string().optional(),
107
+ federation_trust_mark_endpoint: z.string().optional(),
108
+ federation_historical_keys_endpoint: z.string().optional(),
109
+ endpoint_auth_signing_alg_values_supported: z.string().optional(),
119
110
  organization_name: z.string().optional(),
120
111
  homepage_uri: z.string().optional(),
121
112
  policy_uri: z.string().optional(),
@@ -123,7 +114,7 @@ const FederationEntityMetadata = z.object({
123
114
  contacts: z.array(z.string()).optional()
124
115
  }).passthrough();
125
116
 
126
- // Structuire common to every Entity Configuration document
117
+ // Structure common to every Entity Configuration document
127
118
  const BaseEntityConfiguration = z.object({
128
119
  header: EntityConfigurationHeader,
129
120
  payload: z.object({
@@ -167,15 +158,9 @@ const CredentialIssuerEntityConfiguration = BaseEntityConfiguration.and(z.object
167
158
  oauth_authorization_server: z.object({
168
159
  authorization_endpoint: z.string(),
169
160
  pushed_authorization_request_endpoint: z.string(),
170
- dpop_signing_alg_values_supported: z.array(z.string()).optional(),
171
- // TODO [SIW-1268]: should not be optional
172
161
  token_endpoint: z.string(),
173
- introspection_endpoint: z.string().optional(),
174
- // TODO [SIW-1268]: should not be optional
175
162
  client_registration_types_supported: z.array(z.string()),
176
163
  code_challenge_methods_supported: z.array(z.string()),
177
- authorization_details_types_supported: z.array(z.string()).optional(),
178
- // TODO [SIW-1268]: should not be optional,
179
164
  acr_values_supported: z.array(z.string()),
180
165
  grant_types_supported: z.array(z.string()),
181
166
  issuer: z.string(),
@@ -183,23 +168,16 @@ const CredentialIssuerEntityConfiguration = BaseEntityConfiguration.and(z.object
183
168
  keys: z.array(_jwk.JWK)
184
169
  }),
185
170
  scopes_supported: z.array(z.string()),
186
- request_parameter_supported: z.boolean().optional(),
187
- // TODO [SIW-1268]: should not be optional
188
- request_uri_parameter_supported: z.boolean().optional(),
189
- // TODO [SIW-1268]: should not be optional
190
- response_types_supported: z.array(z.string()).optional(),
191
- // TODO [SIW-1268]: should not be optional
192
171
  response_modes_supported: z.array(z.string()),
193
- subject_types_supported: z.array(z.string()).optional(),
194
- // TODO [SIW-1268]: should not be optional
195
172
  token_endpoint_auth_methods_supported: z.array(z.string()),
196
173
  token_endpoint_auth_signing_alg_values_supported: z.array(z.string()),
197
174
  request_object_signing_alg_values_supported: z.array(z.string())
198
175
  }),
199
- /** Credential Issuers act as Relying Party
200
- when they require the presentation of other credentials.
201
- This does not apply for PID issuance, which requires CIE authz. */
202
- wallet_relying_party: RelyingPartyMetadata.optional()
176
+ /**
177
+ * Credential Issuers act as Relying Party when they require the presentation of other credentials.
178
+ * This does not apply for PID issuance, which requires CIE authz.
179
+ */
180
+ openid_credential_verifier: RelyingPartyMetadata.optional()
203
181
  })
204
182
  })
205
183
  }));
@@ -209,7 +187,7 @@ exports.CredentialIssuerEntityConfiguration = CredentialIssuerEntityConfiguratio
209
187
  const RelyingPartyEntityConfiguration = BaseEntityConfiguration.and(z.object({
210
188
  payload: z.object({
211
189
  metadata: z.object({
212
- wallet_relying_party: RelyingPartyMetadata
190
+ openid_credential_verifier: RelyingPartyMetadata
213
191
  })
214
192
  })
215
193
  }));
@@ -239,4 +217,6 @@ const EntityConfiguration = z.union([WalletProviderEntityConfiguration, Credenti
239
217
  description: "Any kind of Entity Configuration allowed in the ecosystem"
240
218
  });
241
219
  exports.EntityConfiguration = EntityConfiguration;
220
+ const FederationListResponse = z.array(z.string());
221
+ exports.FederationListResponse = FederationListResponse;
242
222
  //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_types","require","_jwk","z","_interopRequireWildcard","_types2","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","TrustMark","object","id","string","trust_mark","exports","RelyingPartyMetadata","application_type","optional","client_id","client_name","jwks","keys","array","JWK","contacts","presentation_definition","PresentationDefinition","request_uris","authorization_signed_response_alg","authorization_encrypted_response_alg","authorization_encrypted_response_enc","CredentialDisplayMetadata","name","locale","CredentialIssuerDisplayMetadata","ClaimsMetadata","record","value_type","display","IssuanceErrorSupported","title","description","SupportedCredentialMetadata","format","union","literal","scope","claims","cryptographic_binding_methods_supported","credential_signing_alg_values_supported","authentic_source","issuance_errors_supported","EntityStatement","header","typ","alg","kid","payload","iss","sub","trust_marks","iat","number","exp","EntityConfigurationHeader","FederationEntityMetadata","federation_fetch_endpoint","federation_list_endpoint","federation_resolve_endpoint","federation_trust_mark_status_endpoint","federation_trust_mark_list_endpoint","federation_trust_mark_endpoint","federation_historical_keys_endpoint","endpoint_auth_signing_alg_values_supported","organization_name","homepage_uri","policy_uri","logo_uri","passthrough","BaseEntityConfiguration","UnixTime","authority_hints","metadata","federation_entity","TrustAnchorEntityConfiguration","CredentialIssuerEntityConfiguration","and","openid_credential_issuer","credential_issuer","credential_endpoint","revocation_endpoint","status_attestation_endpoint","credential_configurations_supported","oauth_authorization_server","authorization_endpoint","pushed_authorization_request_endpoint","token_endpoint","client_registration_types_supported","code_challenge_methods_supported","acr_values_supported","grant_types_supported","issuer","scopes_supported","response_modes_supported","token_endpoint_auth_methods_supported","token_endpoint_auth_signing_alg_values_supported","request_object_signing_alg_values_supported","openid_credential_verifier","RelyingPartyEntityConfiguration","WalletProviderEntityConfiguration","wallet_provider","aal_values_supported","EntityConfiguration","FederationListResponse"],"sourceRoot":"../../../src","sources":["trust/types.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,CAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAA0E,SAAAK,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAH,wBAAAO,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAA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