@credo-ts/openid4vc 0.6.1-pr-2091-20241119140918 → 0.6.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 (409) hide show
  1. package/build/OpenId4VcApi.d.mts +24 -0
  2. package/build/OpenId4VcApi.d.mts.map +1 -0
  3. package/build/OpenId4VcApi.mjs +35 -0
  4. package/build/OpenId4VcApi.mjs.map +1 -0
  5. package/build/OpenId4VcModule.d.mts +30 -0
  6. package/build/OpenId4VcModule.d.mts.map +1 -0
  7. package/build/OpenId4VcModule.mjs +42 -0
  8. package/build/OpenId4VcModule.mjs.map +1 -0
  9. package/build/OpenId4VcModuleConfig.d.mts +44 -0
  10. package/build/OpenId4VcModuleConfig.d.mts.map +1 -0
  11. package/build/OpenId4VcModuleConfig.mjs +24 -0
  12. package/build/OpenId4VcModuleConfig.mjs.map +1 -0
  13. package/build/_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs +10 -0
  14. package/build/_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs +7 -0
  15. package/build/_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateParam.mjs +9 -0
  16. package/build/index.d.mts +42 -0
  17. package/build/index.mjs +37 -0
  18. package/build/openid4vc-holder/OpenId4VcHolderApi.d.mts +238 -0
  19. package/build/openid4vc-holder/OpenId4VcHolderApi.d.mts.map +1 -0
  20. package/build/openid4vc-holder/OpenId4VcHolderApi.mjs +174 -0
  21. package/build/openid4vc-holder/OpenId4VcHolderApi.mjs.map +1 -0
  22. package/build/openid4vc-holder/OpenId4VcHolderModule.d.mts +17 -0
  23. package/build/openid4vc-holder/OpenId4VcHolderModule.d.mts.map +1 -0
  24. package/build/openid4vc-holder/OpenId4VcHolderModule.mjs +23 -0
  25. package/build/openid4vc-holder/OpenId4VcHolderModule.mjs.map +1 -0
  26. package/build/openid4vc-holder/OpenId4VciHolderService.d.mts +69 -0
  27. package/build/openid4vc-holder/OpenId4VciHolderService.d.mts.map +1 -0
  28. package/build/openid4vc-holder/OpenId4VciHolderService.mjs +751 -0
  29. package/build/openid4vc-holder/OpenId4VciHolderService.mjs.map +1 -0
  30. package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.d.mts +398 -0
  31. package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.d.mts.map +1 -0
  32. package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.mjs +16 -0
  33. package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.mjs.map +1 -0
  34. package/build/openid4vc-holder/OpenId4vpHolderService.d.mts +130 -0
  35. package/build/openid4vc-holder/OpenId4vpHolderService.d.mts.map +1 -0
  36. package/build/openid4vc-holder/OpenId4vpHolderService.mjs +278 -0
  37. package/build/openid4vc-holder/OpenId4vpHolderService.mjs.map +1 -0
  38. package/build/openid4vc-holder/OpenId4vpHolderServiceOptions.d.mts +112 -0
  39. package/build/openid4vc-holder/OpenId4vpHolderServiceOptions.d.mts.map +1 -0
  40. package/build/openid4vc-holder/index.d.mts +6 -0
  41. package/build/openid4vc-holder/index.mjs +5 -0
  42. package/build/openid4vc-issuer/OpenId4VcIssuanceSessionState.d.mts +16 -0
  43. package/build/openid4vc-issuer/OpenId4VcIssuanceSessionState.d.mts.map +1 -0
  44. package/build/openid4vc-issuer/OpenId4VcIssuanceSessionState.mjs +18 -0
  45. package/build/openid4vc-issuer/OpenId4VcIssuanceSessionState.mjs.map +1 -0
  46. package/build/openid4vc-issuer/OpenId4VcIssuerApi.d.mts +137 -0
  47. package/build/openid4vc-issuer/OpenId4VcIssuerApi.d.mts.map +1 -0
  48. package/build/openid4vc-issuer/OpenId4VcIssuerApi.mjs +108 -0
  49. package/build/openid4vc-issuer/OpenId4VcIssuerApi.mjs.map +1 -0
  50. package/build/openid4vc-issuer/OpenId4VcIssuerEvents.d.mts +19 -0
  51. package/build/openid4vc-issuer/OpenId4VcIssuerEvents.d.mts.map +1 -0
  52. package/build/openid4vc-issuer/OpenId4VcIssuerEvents.mjs +9 -0
  53. package/build/openid4vc-issuer/OpenId4VcIssuerEvents.mjs.map +1 -0
  54. package/build/openid4vc-issuer/OpenId4VcIssuerModule.d.mts +27 -0
  55. package/build/openid4vc-issuer/OpenId4VcIssuerModule.d.mts.map +1 -0
  56. package/build/openid4vc-issuer/OpenId4VcIssuerModule.mjs +150 -0
  57. package/build/openid4vc-issuer/OpenId4VcIssuerModule.mjs.map +1 -0
  58. package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.d.mts +279 -0
  59. package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.d.mts.map +1 -0
  60. package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.mjs +179 -0
  61. package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.mjs.map +1 -0
  62. package/build/openid4vc-issuer/OpenId4VcIssuerService.d.mts +182 -0
  63. package/build/openid4vc-issuer/OpenId4VcIssuerService.d.mts.map +1 -0
  64. package/build/openid4vc-issuer/OpenId4VcIssuerService.mjs +881 -0
  65. package/build/openid4vc-issuer/OpenId4VcIssuerService.mjs.map +1 -0
  66. package/build/openid4vc-issuer/OpenId4VcIssuerServiceOptions.d.mts +340 -0
  67. package/build/openid4vc-issuer/OpenId4VcIssuerServiceOptions.d.mts.map +1 -0
  68. package/build/openid4vc-issuer/OpenId4VcIssuerServiceOptions.mjs +1 -0
  69. package/build/openid4vc-issuer/index.d.mts +11 -0
  70. package/build/openid4vc-issuer/index.mjs +11 -0
  71. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.d.mts +300 -0
  72. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.d.mts.map +1 -0
  73. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.mjs +102 -0
  74. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.mjs.map +1 -0
  75. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRepository.d.mts +10 -0
  76. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRepository.d.mts.map +1 -0
  77. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRepository.mjs +22 -0
  78. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRepository.mjs.map +1 -0
  79. package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.d.mts +84 -0
  80. package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.d.mts.map +1 -0
  81. package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.mjs +89 -0
  82. package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.mjs.map +1 -0
  83. package/build/openid4vc-issuer/repository/OpenId4VcIssuerRepository.d.mts +12 -0
  84. package/build/openid4vc-issuer/repository/OpenId4VcIssuerRepository.d.mts.map +1 -0
  85. package/build/openid4vc-issuer/repository/OpenId4VcIssuerRepository.mjs +28 -0
  86. package/build/openid4vc-issuer/repository/OpenId4VcIssuerRepository.mjs.map +1 -0
  87. package/build/openid4vc-issuer/repository/index.d.mts +4 -0
  88. package/build/openid4vc-issuer/repository/index.mjs +4 -0
  89. package/build/openid4vc-issuer/router/accessTokenEndpoint.mjs +199 -0
  90. package/build/openid4vc-issuer/router/accessTokenEndpoint.mjs.map +1 -0
  91. package/build/openid4vc-issuer/router/authorizationChallengeEndpoint.mjs +241 -0
  92. package/build/openid4vc-issuer/router/authorizationChallengeEndpoint.mjs.map +1 -0
  93. package/build/openid4vc-issuer/router/authorizationEndpoint.mjs +51 -0
  94. package/build/openid4vc-issuer/router/authorizationEndpoint.mjs.map +1 -0
  95. package/build/openid4vc-issuer/router/authorizationServerMetadataEndpoint.mjs +25 -0
  96. package/build/openid4vc-issuer/router/authorizationServerMetadataEndpoint.mjs.map +1 -0
  97. package/build/openid4vc-issuer/router/credentialEndpoint.mjs +142 -0
  98. package/build/openid4vc-issuer/router/credentialEndpoint.mjs.map +1 -0
  99. package/build/openid4vc-issuer/router/credentialOfferEndpoint.mjs +38 -0
  100. package/build/openid4vc-issuer/router/credentialOfferEndpoint.mjs.map +1 -0
  101. package/build/openid4vc-issuer/router/deferredCredentialEndpoint.mjs +84 -0
  102. package/build/openid4vc-issuer/router/deferredCredentialEndpoint.mjs.map +1 -0
  103. package/build/openid4vc-issuer/router/index.mjs +12 -0
  104. package/build/openid4vc-issuer/router/issuerMetadataEndpoint.mjs +43 -0
  105. package/build/openid4vc-issuer/router/issuerMetadataEndpoint.mjs.map +1 -0
  106. package/build/openid4vc-issuer/router/jwksEndpoint.mjs +18 -0
  107. package/build/openid4vc-issuer/router/jwksEndpoint.mjs.map +1 -0
  108. package/build/openid4vc-issuer/router/nonceEndpoint.mjs +29 -0
  109. package/build/openid4vc-issuer/router/nonceEndpoint.mjs.map +1 -0
  110. package/build/openid4vc-issuer/router/pushedAuthorizationRequestEndpoint.mjs +164 -0
  111. package/build/openid4vc-issuer/router/pushedAuthorizationRequestEndpoint.mjs.map +1 -0
  112. package/build/openid4vc-issuer/router/redirectEndpoint.mjs +124 -0
  113. package/build/openid4vc-issuer/router/redirectEndpoint.mjs.map +1 -0
  114. package/build/openid4vc-issuer/util/txCode.mjs +18 -0
  115. package/build/openid4vc-issuer/util/txCode.mjs.map +1 -0
  116. package/build/openid4vc-verifier/OpenId4VcVerificationSessionState.d.mts +10 -0
  117. package/build/openid4vc-verifier/OpenId4VcVerificationSessionState.d.mts.map +1 -0
  118. package/build/openid4vc-verifier/OpenId4VcVerificationSessionState.mjs +12 -0
  119. package/build/openid4vc-verifier/OpenId4VcVerificationSessionState.mjs.map +1 -0
  120. package/build/openid4vc-verifier/OpenId4VcVerifierApi.d.mts +60 -0
  121. package/build/openid4vc-verifier/OpenId4VcVerifierApi.d.mts.map +1 -0
  122. package/build/openid4vc-verifier/OpenId4VcVerifierApi.mjs +83 -0
  123. package/build/openid4vc-verifier/OpenId4VcVerifierApi.mjs.map +1 -0
  124. package/build/openid4vc-verifier/OpenId4VcVerifierEvents.d.mts +19 -0
  125. package/build/openid4vc-verifier/OpenId4VcVerifierEvents.d.mts.map +1 -0
  126. package/build/openid4vc-verifier/OpenId4VcVerifierEvents.mjs +9 -0
  127. package/build/openid4vc-verifier/OpenId4VcVerifierEvents.mjs.map +1 -0
  128. package/build/openid4vc-verifier/OpenId4VcVerifierModule.d.mts +25 -0
  129. package/build/openid4vc-verifier/OpenId4VcVerifierModule.d.mts.map +1 -0
  130. package/build/openid4vc-verifier/OpenId4VcVerifierModule.mjs +91 -0
  131. package/build/openid4vc-verifier/OpenId4VcVerifierModule.mjs.map +1 -0
  132. package/build/openid4vc-verifier/OpenId4VcVerifierModuleConfig.d.mts +55 -0
  133. package/build/openid4vc-verifier/OpenId4VcVerifierModuleConfig.d.mts.map +1 -0
  134. package/build/openid4vc-verifier/OpenId4VcVerifierModuleConfig.mjs +36 -0
  135. package/build/openid4vc-verifier/OpenId4VcVerifierModuleConfig.mjs.map +1 -0
  136. package/build/openid4vc-verifier/OpenId4VpVerifierService.d.mts +60 -0
  137. package/build/openid4vc-verifier/OpenId4VpVerifierService.d.mts.map +1 -0
  138. package/build/openid4vc-verifier/OpenId4VpVerifierService.mjs +714 -0
  139. package/build/openid4vc-verifier/OpenId4VpVerifierService.mjs.map +1 -0
  140. package/build/openid4vc-verifier/OpenId4VpVerifierServiceOptions.d.mts +194 -0
  141. package/build/openid4vc-verifier/OpenId4VpVerifierServiceOptions.d.mts.map +1 -0
  142. package/build/openid4vc-verifier/index.d.mts +12 -0
  143. package/build/openid4vc-verifier/index.mjs +11 -0
  144. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.d.mts +129 -0
  145. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.d.mts.map +1 -0
  146. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.mjs +64 -0
  147. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.mjs.map +1 -0
  148. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRepository.d.mts +10 -0
  149. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRepository.d.mts.map +1 -0
  150. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRepository.mjs +22 -0
  151. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRepository.mjs.map +1 -0
  152. package/build/openid4vc-verifier/repository/OpenId4VcVerifierRecord.d.mts +33 -0
  153. package/build/openid4vc-verifier/repository/OpenId4VcVerifierRecord.d.mts.map +1 -0
  154. package/build/openid4vc-verifier/repository/OpenId4VcVerifierRecord.mjs +32 -0
  155. package/build/openid4vc-verifier/repository/OpenId4VcVerifierRecord.mjs.map +1 -0
  156. package/build/openid4vc-verifier/repository/OpenId4VcVerifierRepository.d.mts +12 -0
  157. package/build/openid4vc-verifier/repository/OpenId4VcVerifierRepository.d.mts.map +1 -0
  158. package/build/openid4vc-verifier/repository/OpenId4VcVerifierRepository.mjs +28 -0
  159. package/build/openid4vc-verifier/repository/OpenId4VcVerifierRepository.mjs.map +1 -0
  160. package/build/openid4vc-verifier/repository/index.d.mts +4 -0
  161. package/build/openid4vc-verifier/repository/index.mjs +4 -0
  162. package/build/openid4vc-verifier/router/authorizationEndpoint.mjs +117 -0
  163. package/build/openid4vc-verifier/router/authorizationEndpoint.mjs.map +1 -0
  164. package/build/openid4vc-verifier/router/authorizationRequestEndpoint.mjs +39 -0
  165. package/build/openid4vc-verifier/router/authorizationRequestEndpoint.mjs.map +1 -0
  166. package/build/openid4vc-verifier/router/index.mjs +1 -0
  167. package/build/shared/callbacks.d.mts +47 -0
  168. package/build/shared/callbacks.d.mts.map +1 -0
  169. package/build/shared/callbacks.mjs +279 -0
  170. package/build/shared/callbacks.mjs.map +1 -0
  171. package/build/shared/index.d.mts +7 -0
  172. package/build/shared/index.mjs +4 -0
  173. package/build/shared/issuerMetadataUtils.d.mts +22 -0
  174. package/build/shared/issuerMetadataUtils.d.mts.map +1 -0
  175. package/build/shared/issuerMetadataUtils.mjs +30 -0
  176. package/build/shared/issuerMetadataUtils.mjs.map +1 -0
  177. package/build/shared/models/CredentialHolderBinding.d.mts +71 -0
  178. package/build/shared/models/CredentialHolderBinding.d.mts.map +1 -0
  179. package/build/shared/models/CredentialHolderBinding.mjs +1 -0
  180. package/build/shared/models/OpenId4VcJwtIssuer.d.mts +46 -0
  181. package/build/shared/models/OpenId4VcJwtIssuer.d.mts.map +1 -0
  182. package/build/shared/models/OpenId4VcJwtIssuer.mjs +1 -0
  183. package/build/shared/models/OpenId4VciAuthorizationServerConfig.d.mts +71 -0
  184. package/build/shared/models/OpenId4VciAuthorizationServerConfig.d.mts.map +1 -0
  185. package/build/shared/models/OpenId4VciCredentialFormatProfile.d.mts +12 -0
  186. package/build/shared/models/OpenId4VciCredentialFormatProfile.d.mts.map +1 -0
  187. package/build/shared/models/OpenId4VciCredentialFormatProfile.mjs +14 -0
  188. package/build/shared/models/OpenId4VciCredentialFormatProfile.mjs.map +1 -0
  189. package/build/shared/models/index.d.mts +30 -0
  190. package/build/shared/models/index.d.mts.map +1 -0
  191. package/build/shared/models/index.mjs +6 -0
  192. package/build/shared/router/context.mjs +52 -0
  193. package/build/shared/router/context.mjs.map +1 -0
  194. package/build/shared/router/express.browser.d.mts +5 -0
  195. package/build/shared/router/express.browser.d.mts.map +1 -0
  196. package/build/shared/router/express.browser.mjs +8 -0
  197. package/build/shared/router/express.browser.mjs.map +1 -0
  198. package/build/shared/router/express.mjs +10 -0
  199. package/build/shared/router/express.mjs.map +1 -0
  200. package/build/shared/router/express.native.d.mts +5 -0
  201. package/build/shared/router/express.native.d.mts.map +1 -0
  202. package/build/shared/router/express.native.mjs +8 -0
  203. package/build/shared/router/express.native.mjs.map +1 -0
  204. package/build/shared/router/index.mjs +3 -0
  205. package/build/shared/router/tenants.mjs +36 -0
  206. package/build/shared/router/tenants.mjs.map +1 -0
  207. package/build/shared/transactionData.mjs +19 -0
  208. package/build/shared/transactionData.mjs.map +1 -0
  209. package/build/shared/utils.mjs +90 -0
  210. package/build/shared/utils.mjs.map +1 -0
  211. package/package.json +30 -23
  212. package/build/index.d.ts +0 -4
  213. package/build/index.js +0 -21
  214. package/build/index.js.map +0 -1
  215. package/build/openid4vc-holder/OpenId4VcHolderApi.d.ts +0 -124
  216. package/build/openid4vc-holder/OpenId4VcHolderApi.js +0 -155
  217. package/build/openid4vc-holder/OpenId4VcHolderApi.js.map +0 -1
  218. package/build/openid4vc-holder/OpenId4VcHolderModule.d.ts +0 -13
  219. package/build/openid4vc-holder/OpenId4VcHolderModule.js +0 -35
  220. package/build/openid4vc-holder/OpenId4VcHolderModule.js.map +0 -1
  221. package/build/openid4vc-holder/OpenId4VciHolderService.d.ts +0 -72
  222. package/build/openid4vc-holder/OpenId4VciHolderService.js +0 -569
  223. package/build/openid4vc-holder/OpenId4VciHolderService.js.map +0 -1
  224. package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.d.ts +0 -238
  225. package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.js +0 -14
  226. package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.js.map +0 -1
  227. package/build/openid4vc-holder/OpenId4vcSiopHolderService.d.ts +0 -32
  228. package/build/openid4vc-holder/OpenId4vcSiopHolderService.js +0 -302
  229. package/build/openid4vc-holder/OpenId4vcSiopHolderService.js.map +0 -1
  230. package/build/openid4vc-holder/OpenId4vcSiopHolderServiceOptions.d.ts +0 -38
  231. package/build/openid4vc-holder/OpenId4vcSiopHolderServiceOptions.js +0 -3
  232. package/build/openid4vc-holder/OpenId4vcSiopHolderServiceOptions.js.map +0 -1
  233. package/build/openid4vc-holder/index.d.ts +0 -6
  234. package/build/openid4vc-holder/index.js +0 -23
  235. package/build/openid4vc-holder/index.js.map +0 -1
  236. package/build/openid4vc-issuer/OpenId4VcIssuanceSessionState.d.ts +0 -12
  237. package/build/openid4vc-issuer/OpenId4VcIssuanceSessionState.js +0 -19
  238. package/build/openid4vc-issuer/OpenId4VcIssuanceSessionState.js.map +0 -1
  239. package/build/openid4vc-issuer/OpenId4VcIssuerApi.d.ts +0 -101
  240. package/build/openid4vc-issuer/OpenId4VcIssuerApi.js +0 -110
  241. package/build/openid4vc-issuer/OpenId4VcIssuerApi.js.map +0 -1
  242. package/build/openid4vc-issuer/OpenId4VcIssuerEvents.d.ts +0 -13
  243. package/build/openid4vc-issuer/OpenId4VcIssuerEvents.js +0 -8
  244. package/build/openid4vc-issuer/OpenId4VcIssuerEvents.js.map +0 -1
  245. package/build/openid4vc-issuer/OpenId4VcIssuerModule.d.ts +0 -21
  246. package/build/openid4vc-issuer/OpenId4VcIssuerModule.js +0 -121
  247. package/build/openid4vc-issuer/OpenId4VcIssuerModule.js.map +0 -1
  248. package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.d.ts +0 -190
  249. package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.js +0 -141
  250. package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.js.map +0 -1
  251. package/build/openid4vc-issuer/OpenId4VcIssuerService.d.ts +0 -116
  252. package/build/openid4vc-issuer/OpenId4VcIssuerService.js +0 -698
  253. package/build/openid4vc-issuer/OpenId4VcIssuerService.js.map +0 -1
  254. package/build/openid4vc-issuer/OpenId4VcIssuerServiceOptions.d.ts +0 -229
  255. package/build/openid4vc-issuer/OpenId4VcIssuerServiceOptions.js +0 -3
  256. package/build/openid4vc-issuer/OpenId4VcIssuerServiceOptions.js.map +0 -1
  257. package/build/openid4vc-issuer/index.d.ts +0 -8
  258. package/build/openid4vc-issuer/index.js +0 -27
  259. package/build/openid4vc-issuer/index.js.map +0 -1
  260. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.d.ts +0 -160
  261. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.js +0 -88
  262. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.js.map +0 -1
  263. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRepository.d.ts +0 -5
  264. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRepository.js +0 -29
  265. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRepository.js.map +0 -1
  266. package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.d.ts +0 -56
  267. package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.js +0 -83
  268. package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.js.map +0 -1
  269. package/build/openid4vc-issuer/repository/OpenId4VcIssuerRepository.d.ts +0 -8
  270. package/build/openid4vc-issuer/repository/OpenId4VcIssuerRepository.js +0 -35
  271. package/build/openid4vc-issuer/repository/OpenId4VcIssuerRepository.js.map +0 -1
  272. package/build/openid4vc-issuer/repository/index.d.ts +0 -4
  273. package/build/openid4vc-issuer/repository/index.js +0 -21
  274. package/build/openid4vc-issuer/repository/index.js.map +0 -1
  275. package/build/openid4vc-issuer/router/accessTokenEndpoint.d.ts +0 -5
  276. package/build/openid4vc-issuer/router/accessTokenEndpoint.js +0 -164
  277. package/build/openid4vc-issuer/router/accessTokenEndpoint.js.map +0 -1
  278. package/build/openid4vc-issuer/router/authorizationChallengeEndpoint.d.ts +0 -3
  279. package/build/openid4vc-issuer/router/authorizationChallengeEndpoint.js +0 -213
  280. package/build/openid4vc-issuer/router/authorizationChallengeEndpoint.js.map +0 -1
  281. package/build/openid4vc-issuer/router/authorizationServerMetadataEndpoint.d.ts +0 -6
  282. package/build/openid4vc-issuer/router/authorizationServerMetadataEndpoint.js +0 -25
  283. package/build/openid4vc-issuer/router/authorizationServerMetadataEndpoint.js.map +0 -1
  284. package/build/openid4vc-issuer/router/credentialEndpoint.d.ts +0 -3
  285. package/build/openid4vc-issuer/router/credentialEndpoint.js +0 -176
  286. package/build/openid4vc-issuer/router/credentialEndpoint.js.map +0 -1
  287. package/build/openid4vc-issuer/router/credentialOfferEndpoint.d.ts +0 -3
  288. package/build/openid4vc-issuer/router/credentialOfferEndpoint.js +0 -45
  289. package/build/openid4vc-issuer/router/credentialOfferEndpoint.js.map +0 -1
  290. package/build/openid4vc-issuer/router/index.d.ts +0 -9
  291. package/build/openid4vc-issuer/router/index.js +0 -20
  292. package/build/openid4vc-issuer/router/index.js.map +0 -1
  293. package/build/openid4vc-issuer/router/issuerMetadataEndpoint.d.ts +0 -2
  294. package/build/openid4vc-issuer/router/issuerMetadataEndpoint.js +0 -26
  295. package/build/openid4vc-issuer/router/issuerMetadataEndpoint.js.map +0 -1
  296. package/build/openid4vc-issuer/router/jwksEndpoint.d.ts +0 -3
  297. package/build/openid4vc-issuer/router/jwksEndpoint.js +0 -20
  298. package/build/openid4vc-issuer/router/jwksEndpoint.js.map +0 -1
  299. package/build/openid4vc-issuer/router/nonceEndpoint.d.ts +0 -3
  300. package/build/openid4vc-issuer/router/nonceEndpoint.js +0 -26
  301. package/build/openid4vc-issuer/router/nonceEndpoint.js.map +0 -1
  302. package/build/openid4vc-issuer/router/requestContext.d.ts +0 -5
  303. package/build/openid4vc-issuer/router/requestContext.js +0 -3
  304. package/build/openid4vc-issuer/router/requestContext.js.map +0 -1
  305. package/build/openid4vc-issuer/util/txCode.d.ts +0 -3
  306. package/build/openid4vc-issuer/util/txCode.js +0 -18
  307. package/build/openid4vc-issuer/util/txCode.js.map +0 -1
  308. package/build/openid4vc-verifier/OpenId4VcSiopVerifierService.d.ts +0 -55
  309. package/build/openid4vc-verifier/OpenId4VcSiopVerifierService.js +0 -498
  310. package/build/openid4vc-verifier/OpenId4VcSiopVerifierService.js.map +0 -1
  311. package/build/openid4vc-verifier/OpenId4VcSiopVerifierServiceOptions.d.ts +0 -77
  312. package/build/openid4vc-verifier/OpenId4VcSiopVerifierServiceOptions.js +0 -3
  313. package/build/openid4vc-verifier/OpenId4VcSiopVerifierServiceOptions.js.map +0 -1
  314. package/build/openid4vc-verifier/OpenId4VcVerificationSessionState.d.ts +0 -6
  315. package/build/openid4vc-verifier/OpenId4VcVerificationSessionState.js +0 -11
  316. package/build/openid4vc-verifier/OpenId4VcVerificationSessionState.js.map +0 -1
  317. package/build/openid4vc-verifier/OpenId4VcVerifierApi.d.ts +0 -61
  318. package/build/openid4vc-verifier/OpenId4VcVerifierApi.js +0 -108
  319. package/build/openid4vc-verifier/OpenId4VcVerifierApi.js.map +0 -1
  320. package/build/openid4vc-verifier/OpenId4VcVerifierEvents.d.ts +0 -13
  321. package/build/openid4vc-verifier/OpenId4VcVerifierEvents.js +0 -8
  322. package/build/openid4vc-verifier/OpenId4VcVerifierEvents.js.map +0 -1
  323. package/build/openid4vc-verifier/OpenId4VcVerifierModule.d.ts +0 -21
  324. package/build/openid4vc-verifier/OpenId4VcVerifierModule.js +0 -109
  325. package/build/openid4vc-verifier/OpenId4VcVerifierModule.js.map +0 -1
  326. package/build/openid4vc-verifier/OpenId4VcVerifierModuleConfig.d.ts +0 -31
  327. package/build/openid4vc-verifier/OpenId4VcVerifierModuleConfig.js +0 -28
  328. package/build/openid4vc-verifier/OpenId4VcVerifierModuleConfig.js.map +0 -1
  329. package/build/openid4vc-verifier/index.d.ts +0 -8
  330. package/build/openid4vc-verifier/index.js +0 -25
  331. package/build/openid4vc-verifier/index.js.map +0 -1
  332. package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartyEventEmitter.d.ts +0 -49
  333. package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartyEventEmitter.js +0 -234
  334. package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartyEventEmitter.js.map +0 -1
  335. package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartySessionManager.d.ts +0 -19
  336. package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartySessionManager.js +0 -146
  337. package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartySessionManager.js.map +0 -1
  338. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.d.ts +0 -71
  339. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.js +0 -46
  340. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.js.map +0 -1
  341. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRepository.d.ts +0 -5
  342. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRepository.js +0 -29
  343. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRepository.js.map +0 -1
  344. package/build/openid4vc-verifier/repository/OpenId4VcVerifierRecord.d.ts +0 -29
  345. package/build/openid4vc-verifier/repository/OpenId4VcVerifierRecord.js +0 -29
  346. package/build/openid4vc-verifier/repository/OpenId4VcVerifierRecord.js.map +0 -1
  347. package/build/openid4vc-verifier/repository/OpenId4VcVerifierRepository.d.ts +0 -8
  348. package/build/openid4vc-verifier/repository/OpenId4VcVerifierRepository.js +0 -35
  349. package/build/openid4vc-verifier/repository/OpenId4VcVerifierRepository.js.map +0 -1
  350. package/build/openid4vc-verifier/repository/index.d.ts +0 -4
  351. package/build/openid4vc-verifier/repository/index.js +0 -21
  352. package/build/openid4vc-verifier/repository/index.js.map +0 -1
  353. package/build/openid4vc-verifier/router/authorizationEndpoint.d.ts +0 -11
  354. package/build/openid4vc-verifier/router/authorizationEndpoint.js +0 -102
  355. package/build/openid4vc-verifier/router/authorizationEndpoint.js.map +0 -1
  356. package/build/openid4vc-verifier/router/authorizationRequestEndpoint.d.ts +0 -11
  357. package/build/openid4vc-verifier/router/authorizationRequestEndpoint.js +0 -63
  358. package/build/openid4vc-verifier/router/authorizationRequestEndpoint.js.map +0 -1
  359. package/build/openid4vc-verifier/router/index.d.ts +0 -2
  360. package/build/openid4vc-verifier/router/index.js +0 -6
  361. package/build/openid4vc-verifier/router/index.js.map +0 -1
  362. package/build/openid4vc-verifier/router/requestContext.d.ts +0 -5
  363. package/build/openid4vc-verifier/router/requestContext.js +0 -3
  364. package/build/openid4vc-verifier/router/requestContext.js.map +0 -1
  365. package/build/shared/callbacks.d.ts +0 -18
  366. package/build/shared/callbacks.js +0 -81
  367. package/build/shared/callbacks.js.map +0 -1
  368. package/build/shared/index.d.ts +0 -2
  369. package/build/shared/index.js +0 -19
  370. package/build/shared/index.js.map +0 -1
  371. package/build/shared/issuerMetadataUtils.d.ts +0 -158
  372. package/build/shared/issuerMetadataUtils.js +0 -38
  373. package/build/shared/issuerMetadataUtils.js.map +0 -1
  374. package/build/shared/models/CredentialHolderBinding.d.ts +0 -13
  375. package/build/shared/models/CredentialHolderBinding.js +0 -3
  376. package/build/shared/models/CredentialHolderBinding.js.map +0 -1
  377. package/build/shared/models/OpenId4VcJwtIssuer.d.ts +0 -28
  378. package/build/shared/models/OpenId4VcJwtIssuer.js +0 -3
  379. package/build/shared/models/OpenId4VcJwtIssuer.js.map +0 -1
  380. package/build/shared/models/OpenId4VciAuthorizationServerConfig.d.ts +0 -10
  381. package/build/shared/models/OpenId4VciAuthorizationServerConfig.js +0 -3
  382. package/build/shared/models/OpenId4VciAuthorizationServerConfig.js.map +0 -1
  383. package/build/shared/models/OpenId4VciCredentialFormatProfile.d.ts +0 -7
  384. package/build/shared/models/OpenId4VciCredentialFormatProfile.js +0 -12
  385. package/build/shared/models/OpenId4VciCredentialFormatProfile.js.map +0 -1
  386. package/build/shared/models/index.d.ts +0 -24
  387. package/build/shared/models/index.js +0 -25
  388. package/build/shared/models/index.js.map +0 -1
  389. package/build/shared/router/context.d.ts +0 -17
  390. package/build/shared/router/context.js +0 -76
  391. package/build/shared/router/context.js.map +0 -1
  392. package/build/shared/router/express.d.ts +0 -2
  393. package/build/shared/router/express.js +0 -15
  394. package/build/shared/router/express.js.map +0 -1
  395. package/build/shared/router/express.native.d.ts +0 -1
  396. package/build/shared/router/express.native.js +0 -7
  397. package/build/shared/router/express.native.js.map +0 -1
  398. package/build/shared/router/index.d.ts +0 -3
  399. package/build/shared/router/index.js +0 -20
  400. package/build/shared/router/index.js.map +0 -1
  401. package/build/shared/router/tenants.d.ts +0 -13
  402. package/build/shared/router/tenants.js +0 -49
  403. package/build/shared/router/tenants.js.map +0 -1
  404. package/build/shared/transform.d.ts +0 -5
  405. package/build/shared/transform.js +0 -73
  406. package/build/shared/transform.js.map +0 -1
  407. package/build/shared/utils.d.ts +0 -22
  408. package/build/shared/utils.js +0 -154
  409. package/build/shared/utils.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenId4VciCredentialFormatProfile.d.mts","names":[],"sources":["../../../src/shared/models/OpenId4VciCredentialFormatProfile.ts"],"sourcesContent":[],"mappings":";aAAY,iCAAA;EAAA,SAAA,GAAA,aAAA"}
@@ -0,0 +1,14 @@
1
+ //#region src/shared/models/OpenId4VciCredentialFormatProfile.ts
2
+ let OpenId4VciCredentialFormatProfile = /* @__PURE__ */ function(OpenId4VciCredentialFormatProfile$1) {
3
+ OpenId4VciCredentialFormatProfile$1["JwtVcJson"] = "jwt_vc_json";
4
+ OpenId4VciCredentialFormatProfile$1["JwtVcJsonLd"] = "jwt_vc_json-ld";
5
+ OpenId4VciCredentialFormatProfile$1["LdpVc"] = "ldp_vc";
6
+ OpenId4VciCredentialFormatProfile$1["SdJwtVc"] = "vc+sd-jwt";
7
+ OpenId4VciCredentialFormatProfile$1["SdJwtDc"] = "dc+sd-jwt";
8
+ OpenId4VciCredentialFormatProfile$1["MsoMdoc"] = "mso_mdoc";
9
+ return OpenId4VciCredentialFormatProfile$1;
10
+ }({});
11
+
12
+ //#endregion
13
+ export { OpenId4VciCredentialFormatProfile };
14
+ //# sourceMappingURL=OpenId4VciCredentialFormatProfile.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenId4VciCredentialFormatProfile.mjs","names":[],"sources":["../../../src/shared/models/OpenId4VciCredentialFormatProfile.ts"],"sourcesContent":["export enum OpenId4VciCredentialFormatProfile {\n JwtVcJson = 'jwt_vc_json',\n JwtVcJsonLd = 'jwt_vc_json-ld',\n LdpVc = 'ldp_vc',\n SdJwtVc = 'vc+sd-jwt',\n SdJwtDc = 'dc+sd-jwt',\n MsoMdoc = 'mso_mdoc',\n}\n"],"mappings":";AAAA,IAAY,kGAAL;AACL;AACA;AACA;AACA;AACA;AACA"}
@@ -0,0 +1,30 @@
1
+ import { OpenId4VcCredentialHolderAttestationBinding, OpenId4VcCredentialHolderBinding, OpenId4VcCredentialHolderDidBinding, OpenId4VcCredentialHolderJwkBinding, VerifiedOpenId4VcCredentialHolderBinding } from "./CredentialHolderBinding.mjs";
2
+ import { OpenId4VciAuthorizationServerClientAuthenticationClientSecret, OpenId4VciAuthorizationServerConfig, OpenId4VciChainedAuthorizationServerConfig, OpenId4VciDirectAuthorizationServerConfig } from "./OpenId4VciAuthorizationServerConfig.mjs";
3
+ import { OpenId4VciCredentialFormatProfile } from "./OpenId4VciCredentialFormatProfile.mjs";
4
+ import { OpenId4VcJwtIssuer, OpenId4VcJwtIssuerDid, OpenId4VcJwtIssuerEncoded, OpenId4VcJwtIssuerJwk, OpenId4VcJwtIssuerJwkEncoded, OpenId4VcJwtIssuerX5c, OpenId4VcJwtIssuerX5cEncoded } from "./OpenId4VcJwtIssuer.mjs";
5
+ import { AccessTokenResponse, authorizationCodeGrantIdentifier as authorizationCodeGrantIdentifier$1, preAuthorizedCodeGrantIdentifier as preAuthorizedCodeGrantIdentifier$1 } from "@openid4vc/oauth2";
6
+ import { CredentialConfigurationSupported, CredentialConfigurationSupportedWithFormats, CredentialIssuerMetadata, CredentialIssuerMetadataDisplayEntry, CredentialOfferObject, CredentialOfferPreAuthorizedCodeGrantTxCode, CredentialRequest, CredentialRequestFormatSpecific, CredentialRequestWithFormats, DeferredCredentialRequest, IssuerMetadataResult, ParseCredentialRequestReturn } from "@openid4vc/openid4vci";
7
+ import { Openid4vpAuthorizationRequest, Openid4vpAuthorizationRequest as Openid4vpAuthorizationRequest$1, Openid4vpAuthorizationRequestDcApi, Openid4vpAuthorizationResponse, ResolvedOpenid4vpAuthorizationRequest } from "@openid4vc/openid4vp";
8
+
9
+ //#region src/shared/models/index.d.ts
10
+ type OpenId4VciCredentialConfigurationSupportedWithFormats = CredentialConfigurationSupportedWithFormats;
11
+ type OpenId4VciCredentialConfigurationSupported = CredentialConfigurationSupported;
12
+ type OpenId4VciCredentialConfigurationsSupported = Record<string, OpenId4VciCredentialConfigurationSupported>;
13
+ type OpenId4VciCredentialConfigurationsSupportedWithFormats = Record<string, OpenId4VciCredentialConfigurationSupportedWithFormats>;
14
+ type OpenId4VciAccessTokenResponse = AccessTokenResponse;
15
+ type OpenId4VciMetadata = IssuerMetadataResult;
16
+ type OpenId4VciTxCode = CredentialOfferPreAuthorizedCodeGrantTxCode;
17
+ type OpenId4VciCredentialIssuerMetadata = CredentialIssuerMetadata;
18
+ type OpenId4VciParsedCredentialRequest = ParseCredentialRequestReturn;
19
+ type OpenId4VciCredentialRequestFormatSpecific = CredentialRequestFormatSpecific;
20
+ type OpenId4VciCredentialIssuerMetadataDisplay = CredentialIssuerMetadataDisplayEntry;
21
+ type OpenId4VciCredentialRequest = CredentialRequest;
22
+ type OpenId4VciCredentialRequestWithFormats = CredentialRequestWithFormats;
23
+ type OpenId4VciDeferredCredentialRequest = DeferredCredentialRequest;
24
+ type OpenId4VciCredentialOfferPayload = CredentialOfferObject;
25
+ type OpenId4VpVerifiedAuthorizationRequest = ResolvedOpenid4vpAuthorizationRequest;
26
+ type OpenId4VpAuthorizationRequestPayload = Openid4vpAuthorizationRequest | Openid4vpAuthorizationRequestDcApi;
27
+ type OpenId4VpAuthorizationResponsePayload = Openid4vpAuthorizationResponse;
28
+ //#endregion
29
+ export { OpenId4VciAccessTokenResponse, OpenId4VciCredentialConfigurationSupported, OpenId4VciCredentialConfigurationSupportedWithFormats, OpenId4VciCredentialConfigurationsSupported, OpenId4VciCredentialConfigurationsSupportedWithFormats, OpenId4VciCredentialIssuerMetadata, OpenId4VciCredentialIssuerMetadataDisplay, OpenId4VciCredentialOfferPayload, OpenId4VciCredentialRequest, OpenId4VciCredentialRequestFormatSpecific, OpenId4VciCredentialRequestWithFormats, OpenId4VciDeferredCredentialRequest, OpenId4VciMetadata, OpenId4VciParsedCredentialRequest, OpenId4VciTxCode, OpenId4VpAuthorizationRequestPayload, OpenId4VpAuthorizationResponsePayload, OpenId4VpVerifiedAuthorizationRequest, type Openid4vpAuthorizationRequest$1 as Openid4vpAuthorizationRequest, authorizationCodeGrantIdentifier$1 as authorizationCodeGrantIdentifier, preAuthorizedCodeGrantIdentifier$1 as preAuthorizedCodeGrantIdentifier };
30
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/shared/models/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;KAyBY,qDAAA,GAAwD;KACxD,0CAAA,GAA6C;KAE7C,2CAAA,GAA8C,eAAe;KAC7D,sDAAA,GAAyD,eAEnE;AANU,KASA,6BAAA,GAAgC,mBATqB;AACrD,KASA,kBAAA,GAAqB,oBATqB;AAE1C,KASA,gBAAA,GAAmB,2CAT0C;AAC7D,KASA,kCAAA,GAAqC,wBAP/C;AAGU,KAMA,iCAAA,GAAoC,4BANe;AACnD,KAMA,yCAAA,GAA4C,+BANH;AAEzC,KAMA,yCAAA,GAA4C,oCANkB;AAC9D,KAOA,2BAAA,GAA8B,iBAPO;AAErC,KAMA,sCAAA,GAAyC,4BANuB;AAChE,KAOA,mCAAA,GAAsC,yBAPM;AAE5C,KAOA,gCAAA,GAAmC,qBAPS;AAE5C,KAOA,qCAAA,GAAwC,qCAPO;AAC/C,KAOA,oCAAA,GAAuC,6BAPE,GAO8B,kCAPF;AAErE,KAMA,qCAAA,GAAwC,8BANuB"}
@@ -0,0 +1,6 @@
1
+ import "./CredentialHolderBinding.mjs";
2
+ import { OpenId4VciCredentialFormatProfile } from "./OpenId4VciCredentialFormatProfile.mjs";
3
+ import "./OpenId4VcJwtIssuer.mjs";
4
+ import { authorizationCodeGrantIdentifier as authorizationCodeGrantIdentifier$1, preAuthorizedCodeGrantIdentifier as preAuthorizedCodeGrantIdentifier$1 } from "@openid4vc/oauth2";
5
+
6
+ export { authorizationCodeGrantIdentifier$1 as authorizationCodeGrantIdentifier, preAuthorizedCodeGrantIdentifier$1 as preAuthorizedCodeGrantIdentifier };
@@ -0,0 +1,52 @@
1
+ import { CredoError } from "@credo-ts/core";
2
+ import { Oauth2ResourceUnauthorizedError, SupportedAuthenticationScheme } from "@openid4vc/oauth2";
3
+
4
+ //#region src/shared/router/context.ts
5
+ function sendUnauthorizedError(response, next, logger, error, status) {
6
+ const errorMessage = error instanceof Error ? error.message : error;
7
+ logger.warn(`[OID4VC] Sending authorization error response: ${JSON.stringify(errorMessage)}`, { error });
8
+ const unauhorizedError = error instanceof Oauth2ResourceUnauthorizedError ? error : new Oauth2ResourceUnauthorizedError("Unknown error occured", [{ scheme: SupportedAuthenticationScheme.DPoP }, { scheme: SupportedAuthenticationScheme.Bearer }]);
9
+ response.setHeader("WWW-Authenticate", unauhorizedError.toHeaderValue()).status(status ?? 403).send();
10
+ next(error);
11
+ }
12
+ function sendOauth2ErrorResponse(response, next, logger, error) {
13
+ logger.warn(`[OID4VC] Sending oauth2 error response: ${JSON.stringify(error.message)}`, { error });
14
+ response.status(error.status).json(error.errorResponse);
15
+ next(error);
16
+ }
17
+ function sendUnknownServerErrorResponse(response, next, logger, error, additionalParams = {}) {
18
+ logger.error("[OID4VC] Sending unknown server error response", { error });
19
+ response.status(500).json({
20
+ error: "server_error",
21
+ ...additionalParams
22
+ });
23
+ next(error instanceof Error ? error : new CredoError("Unknown error in openid4vc error response handler"));
24
+ }
25
+ function sendNotFoundResponse(response, next, logger, internalReason) {
26
+ logger.debug(`[OID4VC] Sending not found response: ${internalReason}`);
27
+ response.status(404).send();
28
+ next(new CredoError(internalReason));
29
+ }
30
+ function sendErrorResponse(response, next, logger, status, errorCode, errorDescription, additionalPayload, error) {
31
+ const body = {
32
+ error: errorCode,
33
+ error_description: errorDescription,
34
+ ...additionalPayload
35
+ };
36
+ logger.warn(`[OID4VC] Sending error response: ${JSON.stringify(body)}`, { error });
37
+ response.status(status).json(body);
38
+ next(error instanceof Error ? error : new CredoError("Unknown error in openid4vc error response handler"));
39
+ }
40
+ function sendJsonResponse(response, next, body, contentType, status) {
41
+ response.setHeader("Content-Type", contentType ?? "application/json").status(status ?? 200).send(JSON.stringify(body));
42
+ next();
43
+ }
44
+ function getRequestContext(request) {
45
+ const requestContext = request.requestContext;
46
+ if (!requestContext) throw new CredoError("Request context not set.");
47
+ return requestContext;
48
+ }
49
+
50
+ //#endregion
51
+ export { getRequestContext, sendErrorResponse, sendJsonResponse, sendNotFoundResponse, sendOauth2ErrorResponse, sendUnauthorizedError, sendUnknownServerErrorResponse };
52
+ //# sourceMappingURL=context.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.mjs","names":[],"sources":["../../../src/shared/router/context.ts"],"sourcesContent":["import type { AgentContext, Logger } from '@credo-ts/core'\nimport { CredoError } from '@credo-ts/core'\nimport type { Oauth2ErrorCodes, Oauth2ServerErrorResponseError } from '@openid4vc/oauth2'\nimport { Oauth2ResourceUnauthorizedError, SupportedAuthenticationScheme } from '@openid4vc/oauth2'\nimport type { NextFunction, Request, Response } from 'express'\n\nexport interface OpenId4VcRequest<RC extends Record<string, unknown> = Record<string, never>> extends Request {\n requestContext?: RC & OpenId4VcRequestContext\n}\n\nexport interface OpenId4VcRequestContext {\n agentContext: AgentContext\n}\n\nexport function sendUnauthorizedError(\n response: Response,\n next: NextFunction,\n logger: Logger,\n error: unknown | Oauth2ResourceUnauthorizedError,\n status?: number\n) {\n const errorMessage = error instanceof Error ? error.message : error\n logger.warn(`[OID4VC] Sending authorization error response: ${JSON.stringify(errorMessage)}`, {\n error,\n })\n\n const unauhorizedError =\n error instanceof Oauth2ResourceUnauthorizedError\n ? error\n : new Oauth2ResourceUnauthorizedError('Unknown error occured', [\n { scheme: SupportedAuthenticationScheme.DPoP },\n { scheme: SupportedAuthenticationScheme.Bearer },\n ])\n\n response\n .setHeader('WWW-Authenticate', unauhorizedError.toHeaderValue())\n .status(status ?? 403)\n .send()\n next(error)\n}\n\nexport function sendOauth2ErrorResponse(\n response: Response,\n next: NextFunction,\n logger: Logger,\n error: Oauth2ServerErrorResponseError\n) {\n logger.warn(`[OID4VC] Sending oauth2 error response: ${JSON.stringify(error.message)}`, {\n error,\n })\n\n response.status(error.status).json(error.errorResponse)\n next(error)\n}\nexport function sendUnknownServerErrorResponse(\n response: Response,\n next: NextFunction,\n logger: Logger,\n error: unknown,\n additionalParams: Record<string, unknown> = {}\n) {\n logger.error('[OID4VC] Sending unknown server error response', {\n error,\n })\n\n response.status(500).json({\n error: 'server_error',\n ...additionalParams,\n })\n\n const throwError =\n error instanceof Error ? error : new CredoError('Unknown error in openid4vc error response handler')\n next(throwError)\n}\n\nexport function sendNotFoundResponse(response: Response, next: NextFunction, logger: Logger, internalReason: string) {\n logger.debug(`[OID4VC] Sending not found response: ${internalReason}`)\n\n response.status(404).send()\n next(new CredoError(internalReason))\n}\n\nexport function sendErrorResponse(\n response: Response,\n next: NextFunction,\n logger: Logger,\n status: number,\n errorCode: Oauth2ErrorCodes | string,\n errorDescription?: string,\n additionalPayload?: Record<string, unknown>,\n error?: Error\n) {\n const body = {\n error: errorCode,\n error_description: errorDescription,\n ...additionalPayload,\n }\n logger.warn(`[OID4VC] Sending error response: ${JSON.stringify(body)}`, {\n error,\n })\n\n response.status(status).json(body)\n\n const throwError =\n error instanceof Error ? error : new CredoError('Unknown error in openid4vc error response handler')\n next(throwError)\n}\n\nexport function sendJsonResponse(\n response: Response,\n next: NextFunction,\n // biome-ignore lint/suspicious/noExplicitAny: no explanation\n body: any,\n contentType?: string,\n status?: number\n) {\n response\n .setHeader('Content-Type', contentType ?? 'application/json')\n .status(status ?? 200)\n .send(JSON.stringify(body))\n\n next()\n}\n\n// biome-ignore lint/suspicious/noExplicitAny: no explanation\nexport function getRequestContext<T extends OpenId4VcRequest<any>>(request: T): NonNullable<T['requestContext']> {\n const requestContext = request.requestContext\n if (!requestContext) throw new CredoError('Request context not set.')\n\n return requestContext\n}\n"],"mappings":";;;;AAcA,SAAgB,sBACd,UACA,MACA,QACA,OACA,QACA;CACA,MAAM,eAAe,iBAAiB,QAAQ,MAAM,UAAU;AAC9D,QAAO,KAAK,kDAAkD,KAAK,UAAU,aAAa,IAAI,EAC5F,OACD,CAAC;CAEF,MAAM,mBACJ,iBAAiB,kCACb,QACA,IAAI,gCAAgC,yBAAyB,CAC3D,EAAE,QAAQ,8BAA8B,MAAM,EAC9C,EAAE,QAAQ,8BAA8B,QAAQ,CACjD,CAAC;AAER,UACG,UAAU,oBAAoB,iBAAiB,eAAe,CAAC,CAC/D,OAAO,UAAU,IAAI,CACrB,MAAM;AACT,MAAK,MAAM;;AAGb,SAAgB,wBACd,UACA,MACA,QACA,OACA;AACA,QAAO,KAAK,2CAA2C,KAAK,UAAU,MAAM,QAAQ,IAAI,EACtF,OACD,CAAC;AAEF,UAAS,OAAO,MAAM,OAAO,CAAC,KAAK,MAAM,cAAc;AACvD,MAAK,MAAM;;AAEb,SAAgB,+BACd,UACA,MACA,QACA,OACA,mBAA4C,EAAE,EAC9C;AACA,QAAO,MAAM,kDAAkD,EAC7D,OACD,CAAC;AAEF,UAAS,OAAO,IAAI,CAAC,KAAK;EACxB,OAAO;EACP,GAAG;EACJ,CAAC;AAIF,MADE,iBAAiB,QAAQ,QAAQ,IAAI,WAAW,oDAAoD,CACtF;;AAGlB,SAAgB,qBAAqB,UAAoB,MAAoB,QAAgB,gBAAwB;AACnH,QAAO,MAAM,wCAAwC,iBAAiB;AAEtE,UAAS,OAAO,IAAI,CAAC,MAAM;AAC3B,MAAK,IAAI,WAAW,eAAe,CAAC;;AAGtC,SAAgB,kBACd,UACA,MACA,QACA,QACA,WACA,kBACA,mBACA,OACA;CACA,MAAM,OAAO;EACX,OAAO;EACP,mBAAmB;EACnB,GAAG;EACJ;AACD,QAAO,KAAK,oCAAoC,KAAK,UAAU,KAAK,IAAI,EACtE,OACD,CAAC;AAEF,UAAS,OAAO,OAAO,CAAC,KAAK,KAAK;AAIlC,MADE,iBAAiB,QAAQ,QAAQ,IAAI,WAAW,oDAAoD,CACtF;;AAGlB,SAAgB,iBACd,UACA,MAEA,MACA,aACA,QACA;AACA,UACG,UAAU,gBAAgB,eAAe,mBAAmB,CAC5D,OAAO,UAAU,IAAI,CACrB,KAAK,KAAK,UAAU,KAAK,CAAC;AAE7B,OAAM;;AAIR,SAAgB,kBAAmD,SAA8C;CAC/G,MAAM,iBAAiB,QAAQ;AAC/B,KAAI,CAAC,eAAgB,OAAM,IAAI,WAAW,2BAA2B;AAErE,QAAO"}
@@ -0,0 +1,5 @@
1
+ //#region src/shared/router/express.browser.d.ts
2
+ declare function importExpress(): void;
3
+ //#endregion
4
+ export { importExpress };
5
+ //# sourceMappingURL=express.browser.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"express.browser.d.mts","names":[],"sources":["../../../src/shared/router/express.browser.ts"],"sourcesContent":[],"mappings":";iBAAgB,aAAA,CAAA"}
@@ -0,0 +1,8 @@
1
+ //#region src/shared/router/express.browser.ts
2
+ function importExpress() {
3
+ throw new Error("Express cannot be imported in the browser. This is probably because you are trying to use the 'OpenId4VcIssuerModule' or the 'OpenId4VcVerifierModule'.");
4
+ }
5
+
6
+ //#endregion
7
+ export { importExpress };
8
+ //# sourceMappingURL=express.browser.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"express.browser.mjs","names":[],"sources":["../../../src/shared/router/express.browser.ts"],"sourcesContent":["export function importExpress() {\n throw new Error(\n \"Express cannot be imported in the browser. This is probably because you are trying to use the 'OpenId4VcIssuerModule' or the 'OpenId4VcVerifierModule'.\"\n )\n}\n"],"mappings":";AAAA,SAAgB,gBAAgB;AAC9B,OAAM,IAAI,MACR,0JACD"}
@@ -0,0 +1,10 @@
1
+ import express from "express";
2
+
3
+ //#region src/shared/router/express.ts
4
+ function importExpress() {
5
+ return express;
6
+ }
7
+
8
+ //#endregion
9
+ export { importExpress };
10
+ //# sourceMappingURL=express.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"express.mjs","names":[],"sources":["../../../src/shared/router/express.ts"],"sourcesContent":["import express from 'express'\n\n// In React Native the express.native.ts file will be used which will throw when actuall called.\nexport function importExpress() {\n return express\n}\n"],"mappings":";;;AAGA,SAAgB,gBAAgB;AAC9B,QAAO"}
@@ -0,0 +1,5 @@
1
+ //#region src/shared/router/express.native.d.ts
2
+ declare function importExpress(): void;
3
+ //#endregion
4
+ export { importExpress };
5
+ //# sourceMappingURL=express.native.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"express.native.d.mts","names":[],"sources":["../../../src/shared/router/express.native.ts"],"sourcesContent":[],"mappings":";iBAAgB,aAAA,CAAA"}
@@ -0,0 +1,8 @@
1
+ //#region src/shared/router/express.native.ts
2
+ function importExpress() {
3
+ throw new Error("Express cannot be imported in React Native. This is probably because you are trying to use the 'OpenId4VcIssuerModule' or the 'OpenId4VcVerifierModule'.");
4
+ }
5
+
6
+ //#endregion
7
+ export { importExpress };
8
+ //# sourceMappingURL=express.native.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"express.native.mjs","names":[],"sources":["../../../src/shared/router/express.native.ts"],"sourcesContent":["export function importExpress() {\n throw new Error(\n \"Express cannot be imported in React Native. This is probably because you are trying to use the 'OpenId4VcIssuerModule' or the 'OpenId4VcVerifierModule'.\"\n )\n}\n"],"mappings":";AAAA,SAAgB,gBAAgB;AAC9B,OAAM,IAAI,MACR,2JACD"}
@@ -0,0 +1,3 @@
1
+ import { getRequestContext, sendErrorResponse, sendJsonResponse, sendNotFoundResponse, sendOauth2ErrorResponse, sendUnauthorizedError, sendUnknownServerErrorResponse } from "./context.mjs";
2
+ import { importExpress } from "./express.mjs";
3
+ import { getAgentContextForActorId, storeActorIdForContextCorrelationId } from "./tenants.mjs";
@@ -0,0 +1,36 @@
1
+ import { InjectionSymbols, getApiForModuleByName } from "@credo-ts/core";
2
+
3
+ //#region src/shared/router/tenants.ts
4
+ const OPENID4VC_ACTOR_IDS_METADATA_KEY = "_openid4vc/openId4VcActorIds";
5
+ async function getAgentContextForActorId(rootAgentContext, actorId) {
6
+ const tenantsApi = getApiForModuleByName(rootAgentContext, "TenantsModule");
7
+ if (tenantsApi) {
8
+ const [tenant] = await tenantsApi.findTenantsByQuery({ [OPENID4VC_ACTOR_IDS_METADATA_KEY]: [actorId] });
9
+ if (tenant) return rootAgentContext.dependencyManager.resolve(InjectionSymbols.AgentContextProvider).getAgentContextForContextCorrelationId(`tenant-${tenant.id}`);
10
+ }
11
+ return rootAgentContext;
12
+ }
13
+ /**
14
+ * Store the actor id associated with a context correlation id. If multi-tenancy is not used
15
+ * this method won't do anything as we can just use the actor from the default context. However
16
+ * if multi-tenancy is used, we will store the actor id in the tenant record metadata so it can
17
+ * be queried when a request comes in for the specific actor id.
18
+ *
19
+ * The reason for doing this is that we don't want to expose the context correlation id in the
20
+ * actor metadata url, as it is then possible to see exactly which actors are registered under
21
+ * the same agent.
22
+ */
23
+ async function storeActorIdForContextCorrelationId(agentContext, actorId) {
24
+ const tenantsApi = getApiForModuleByName(agentContext, "TenantsModule");
25
+ if (tenantsApi && tenantsApi.rootAgentContext.contextCorrelationId !== agentContext.contextCorrelationId) {
26
+ const tenantRecord = await tenantsApi.getTenantById(agentContext.contextCorrelationId.replace("tenant-", ""));
27
+ const openId4VcActorIds = [...tenantRecord.metadata.get(OPENID4VC_ACTOR_IDS_METADATA_KEY) ?? [], actorId];
28
+ tenantRecord.metadata.set(OPENID4VC_ACTOR_IDS_METADATA_KEY, openId4VcActorIds);
29
+ tenantRecord.setTag(OPENID4VC_ACTOR_IDS_METADATA_KEY, openId4VcActorIds);
30
+ await tenantsApi.updateTenant(tenantRecord);
31
+ }
32
+ }
33
+
34
+ //#endregion
35
+ export { getAgentContextForActorId, storeActorIdForContextCorrelationId };
36
+ //# sourceMappingURL=tenants.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tenants.mjs","names":[],"sources":["../../../src/shared/router/tenants.ts"],"sourcesContent":["import type { AgentContext, AgentContextProvider } from '@credo-ts/core'\nimport { getApiForModuleByName, InjectionSymbols } from '@credo-ts/core'\nimport type { TenantsModule } from '@credo-ts/tenants'\n\nconst OPENID4VC_ACTOR_IDS_METADATA_KEY = '_openid4vc/openId4VcActorIds'\n\nexport async function getAgentContextForActorId(rootAgentContext: AgentContext, actorId: string) {\n // Check if multi-tenancy is enabled, and if so find the associated multi-tenant record\n // This is a bit hacky as it uses the tenants module to store the openid4vc actor id\n // but this way we don't have to expose the contextCorrelationId in the openid metadata\n const tenantsApi = getApiForModuleByName<TenantsModule>(rootAgentContext, 'TenantsModule')\n if (tenantsApi) {\n const [tenant] = await tenantsApi.findTenantsByQuery({\n [OPENID4VC_ACTOR_IDS_METADATA_KEY]: [actorId],\n })\n\n if (tenant) {\n const agentContextProvider = rootAgentContext.dependencyManager.resolve<AgentContextProvider>(\n InjectionSymbols.AgentContextProvider\n )\n return agentContextProvider.getAgentContextForContextCorrelationId(`tenant-${tenant.id}`)\n }\n }\n\n return rootAgentContext\n}\n\n/**\n * Store the actor id associated with a context correlation id. If multi-tenancy is not used\n * this method won't do anything as we can just use the actor from the default context. However\n * if multi-tenancy is used, we will store the actor id in the tenant record metadata so it can\n * be queried when a request comes in for the specific actor id.\n *\n * The reason for doing this is that we don't want to expose the context correlation id in the\n * actor metadata url, as it is then possible to see exactly which actors are registered under\n * the same agent.\n */\nexport async function storeActorIdForContextCorrelationId(agentContext: AgentContext, actorId: string) {\n // It's kind of hacky, but we add support for the tenants module specifically here to map an actorId to\n // a specific tenant. Otherwise we have to expose /:contextCorrelationId/:actorId in all the public URLs\n // which is of course not so nice.\n const tenantsApi = getApiForModuleByName<TenantsModule>(agentContext, 'TenantsModule')\n\n // We don't want to query the tenant record if the current context is the root context\n if (tenantsApi && tenantsApi.rootAgentContext.contextCorrelationId !== agentContext.contextCorrelationId) {\n const tenantRecord = await tenantsApi.getTenantById(agentContext.contextCorrelationId.replace('tenant-', ''))\n\n const currentOpenId4VcActorIds = tenantRecord.metadata.get<string[]>(OPENID4VC_ACTOR_IDS_METADATA_KEY) ?? []\n const openId4VcActorIds = [...currentOpenId4VcActorIds, actorId]\n\n tenantRecord.metadata.set(OPENID4VC_ACTOR_IDS_METADATA_KEY, openId4VcActorIds)\n tenantRecord.setTag(OPENID4VC_ACTOR_IDS_METADATA_KEY, openId4VcActorIds)\n await tenantsApi.updateTenant(tenantRecord)\n }\n}\n"],"mappings":";;;AAIA,MAAM,mCAAmC;AAEzC,eAAsB,0BAA0B,kBAAgC,SAAiB;CAI/F,MAAM,aAAa,sBAAqC,kBAAkB,gBAAgB;AAC1F,KAAI,YAAY;EACd,MAAM,CAAC,UAAU,MAAM,WAAW,mBAAmB,GAClD,mCAAmC,CAAC,QAAQ,EAC9C,CAAC;AAEF,MAAI,OAIF,QAH6B,iBAAiB,kBAAkB,QAC9D,iBAAiB,qBAClB,CAC2B,uCAAuC,UAAU,OAAO,KAAK;;AAI7F,QAAO;;;;;;;;;;;;AAaT,eAAsB,oCAAoC,cAA4B,SAAiB;CAIrG,MAAM,aAAa,sBAAqC,cAAc,gBAAgB;AAGtF,KAAI,cAAc,WAAW,iBAAiB,yBAAyB,aAAa,sBAAsB;EACxG,MAAM,eAAe,MAAM,WAAW,cAAc,aAAa,qBAAqB,QAAQ,WAAW,GAAG,CAAC;EAG7G,MAAM,oBAAoB,CAAC,GADM,aAAa,SAAS,IAAc,iCAAiC,IAAI,EAAE,EACpD,QAAQ;AAEhE,eAAa,SAAS,IAAI,kCAAkC,kBAAkB;AAC9E,eAAa,OAAO,kCAAkC,kBAAkB;AACxE,QAAM,WAAW,aAAa,aAAa"}
@@ -0,0 +1,19 @@
1
+ import { CredoError } from "@credo-ts/core";
2
+
3
+ //#region src/shared/transactionData.ts
4
+ function getSdJwtVcTransactionDataHashes(sdJwtVc) {
5
+ if (!sdJwtVc.kbJwt) return;
6
+ const transactionDataHashes = sdJwtVc.kbJwt.payload.transaction_data_hashes;
7
+ if (!transactionDataHashes) return;
8
+ if (!Array.isArray(transactionDataHashes) || !transactionDataHashes.every((hash) => typeof hash === "string")) throw new CredoError("Property 'transaction_data_hashes' in SD-JWT VC KB-JWT payload must be an array of strings");
9
+ const transactionDataHashesAlg = sdJwtVc.kbJwt.payload.transaction_data_hashes_alg;
10
+ if (typeof transactionDataHashesAlg !== "string" && transactionDataHashes !== void 0) throw new CredoError("Property 'transaction_data_hashes_alg' in SD-JWT VC KB-JWT payload is not of string");
11
+ return {
12
+ transaction_data_hashes: transactionDataHashes,
13
+ transaction_data_hashes_alg: transactionDataHashesAlg
14
+ };
15
+ }
16
+
17
+ //#endregion
18
+ export { getSdJwtVcTransactionDataHashes };
19
+ //# sourceMappingURL=transactionData.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transactionData.mjs","names":[],"sources":["../../src/shared/transactionData.ts"],"sourcesContent":["import { CredoError, type SdJwtVc } from '@credo-ts/core'\n\nexport function getSdJwtVcTransactionDataHashes(sdJwtVc: SdJwtVc) {\n if (!sdJwtVc.kbJwt) {\n return undefined\n }\n\n const transactionDataHashes = sdJwtVc.kbJwt.payload.transaction_data_hashes\n if (!transactionDataHashes) {\n return undefined\n }\n\n if (!Array.isArray(transactionDataHashes) || !transactionDataHashes.every((hash) => typeof hash === 'string')) {\n throw new CredoError(\"Property 'transaction_data_hashes' in SD-JWT VC KB-JWT payload must be an array of strings\")\n }\n\n const transactionDataHashesAlg = sdJwtVc.kbJwt.payload.transaction_data_hashes_alg\n if (typeof transactionDataHashesAlg !== 'string' && transactionDataHashes !== undefined) {\n throw new CredoError(\"Property 'transaction_data_hashes_alg' in SD-JWT VC KB-JWT payload is not of string\")\n }\n\n return {\n transaction_data_hashes: transactionDataHashes,\n transaction_data_hashes_alg: transactionDataHashesAlg as string | undefined,\n }\n}\n"],"mappings":";;;AAEA,SAAgB,gCAAgC,SAAkB;AAChE,KAAI,CAAC,QAAQ,MACX;CAGF,MAAM,wBAAwB,QAAQ,MAAM,QAAQ;AACpD,KAAI,CAAC,sBACH;AAGF,KAAI,CAAC,MAAM,QAAQ,sBAAsB,IAAI,CAAC,sBAAsB,OAAO,SAAS,OAAO,SAAS,SAAS,CAC3G,OAAM,IAAI,WAAW,6FAA6F;CAGpH,MAAM,2BAA2B,QAAQ,MAAM,QAAQ;AACvD,KAAI,OAAO,6BAA6B,YAAY,0BAA0B,OAC5E,OAAM,IAAI,WAAW,sFAAsF;AAG7G,QAAO;EACL,yBAAyB;EACzB,6BAA6B;EAC9B"}
@@ -0,0 +1,90 @@
1
+ import { AgentContext, ClaimFormat, CredoError, DidsApi, Kms, SignatureSuiteRegistry, X509Certificate, getPublicJwkFromVerificationMethod } from "@credo-ts/core";
2
+
3
+ //#region src/shared/utils.ts
4
+ /**
5
+ * Returns the JWA Signature Algorithms that are supported by the wallet.
6
+ */
7
+ function getSupportedJwaSignatureAlgorithms(agentContext) {
8
+ const kms = agentContext.resolve(Kms.KeyManagementApi);
9
+ return Object.values(Kms.KnownJwaSignatureAlgorithms).filter((algorithm) => kms.supportedBackendsForOperation({
10
+ operation: "sign",
11
+ algorithm
12
+ }).length > 0);
13
+ }
14
+ async function getPublicJwkFromDid(agentContext, didUrl, allowedPurposes = ["authentication"]) {
15
+ return getPublicJwkFromVerificationMethod((await agentContext.dependencyManager.resolve(DidsApi).resolveDidDocument(didUrl)).dereferenceKey(didUrl, allowedPurposes));
16
+ }
17
+ function encodeJwtIssuer(jwtIssuer) {
18
+ if (jwtIssuer.method === "jwk") return {
19
+ method: "jwk",
20
+ jwk: jwtIssuer.jwk.toJson()
21
+ };
22
+ if (jwtIssuer.method === "x5c") return {
23
+ method: "x5c",
24
+ leafCertificateKeyId: jwtIssuer.x5c[0].keyId,
25
+ x5c: jwtIssuer.x5c.map((c) => c.toString("base64"))
26
+ };
27
+ return jwtIssuer;
28
+ }
29
+ function decodeJwtIssuer(encodedJwtIssuer) {
30
+ if (encodedJwtIssuer.method === "jwk") return {
31
+ method: "jwk",
32
+ jwk: Kms.PublicJwk.fromUnknown(encodedJwtIssuer.jwk)
33
+ };
34
+ if (encodedJwtIssuer.method === "x5c") return {
35
+ method: "x5c",
36
+ x5c: encodedJwtIssuer.x5c.map((e, i) => {
37
+ const c = X509Certificate.fromEncodedCertificate(e);
38
+ if (i === 0) c.keyId = encodedJwtIssuer.leafCertificateKeyId;
39
+ return c;
40
+ })
41
+ };
42
+ return encodedJwtIssuer;
43
+ }
44
+ async function credoJwtIssuerToOpenId4VcJwtIssuer(agentContext, createJwtIssuer) {
45
+ if (createJwtIssuer.method === "did") {
46
+ const { publicJwk } = await agentContext.resolve(DidsApi).resolveVerificationMethodFromCreatedDidRecord(createJwtIssuer.didUrl);
47
+ return {
48
+ method: createJwtIssuer.method,
49
+ didUrl: createJwtIssuer.didUrl,
50
+ alg: publicJwk.signatureAlgorithm,
51
+ kid: publicJwk.keyId
52
+ };
53
+ }
54
+ if (createJwtIssuer.method === "x5c") {
55
+ const leafCertificate = createJwtIssuer.x5c[0];
56
+ if (!leafCertificate) throw new CredoError("Unable to extract leaf certificate, x5c certificate chain is empty");
57
+ return {
58
+ ...createJwtIssuer,
59
+ x5c: createJwtIssuer.x5c.map((certificate) => certificate.toString("base64")),
60
+ alg: leafCertificate.publicJwk.signatureAlgorithm,
61
+ kid: leafCertificate.publicJwk.keyId
62
+ };
63
+ }
64
+ if (createJwtIssuer.method === "jwk") return {
65
+ ...createJwtIssuer,
66
+ publicJwk: createJwtIssuer.jwk.toJson(),
67
+ alg: createJwtIssuer.jwk.signatureAlgorithm
68
+ };
69
+ throw new CredoError(`Unsupported jwt issuer method '${createJwtIssuer.method}'`);
70
+ }
71
+ function getProofTypeFromPublicJwk(agentContext, key) {
72
+ const supportedSignatureSuites = agentContext.dependencyManager.resolve(SignatureSuiteRegistry).getAllByPublicJwkType(key);
73
+ if (supportedSignatureSuites.length === 0) throw new CredoError(`Couldn't find a supported signature suite for the given key ${key.jwkTypeHumanDescription}.`);
74
+ return supportedSignatureSuites[0].proofType;
75
+ }
76
+ function dcqlCredentialQueryToPresentationFormat(credential) {
77
+ switch (credential.format) {
78
+ case "dc+sd-jwt": return ClaimFormat.SdJwtDc;
79
+ case "vc+sd-jwt":
80
+ if (credential.meta && "type_values" in credential.meta) return ClaimFormat.SdJwtW3cVp;
81
+ return ClaimFormat.SdJwtDc;
82
+ case "jwt_vc_json": return ClaimFormat.JwtVp;
83
+ case "ldp_vc": return ClaimFormat.LdpVp;
84
+ case "mso_mdoc": return ClaimFormat.MsoMdoc;
85
+ }
86
+ }
87
+
88
+ //#endregion
89
+ export { credoJwtIssuerToOpenId4VcJwtIssuer, dcqlCredentialQueryToPresentationFormat, decodeJwtIssuer, encodeJwtIssuer, getProofTypeFromPublicJwk, getPublicJwkFromDid, getSupportedJwaSignatureAlgorithms };
90
+ //# sourceMappingURL=utils.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.mjs","names":[],"sources":["../../src/shared/utils.ts"],"sourcesContent":["import {\n AgentContext,\n ClaimFormat,\n CredoError,\n type DcqlQuery,\n type DidPurpose,\n DidsApi,\n getPublicJwkFromVerificationMethod,\n Kms,\n SignatureSuiteRegistry,\n X509Certificate,\n} from '@credo-ts/core'\nimport type { Jwk, JwtSigner } from '@openid4vc/oauth2'\nimport type { OpenId4VcJwtIssuer, OpenId4VcJwtIssuerEncoded } from './models'\n\n/**\n * Returns the JWA Signature Algorithms that are supported by the wallet.\n */\nexport function getSupportedJwaSignatureAlgorithms(agentContext: AgentContext): Kms.KnownJwaSignatureAlgorithm[] {\n const kms = agentContext.resolve(Kms.KeyManagementApi)\n\n // If we can sign with an algorithm we assume it's supported (also for verification)\n const supportedJwaSignatureAlgorithms = Object.values(Kms.KnownJwaSignatureAlgorithms).filter(\n (algorithm) => kms.supportedBackendsForOperation({ operation: 'sign', algorithm }).length > 0\n )\n\n return supportedJwaSignatureAlgorithms\n}\n\nexport async function getPublicJwkFromDid(\n agentContext: AgentContext,\n didUrl: string,\n allowedPurposes: DidPurpose[] = ['authentication']\n) {\n const didsApi = agentContext.dependencyManager.resolve(DidsApi)\n const didDocument = await didsApi.resolveDidDocument(didUrl)\n const verificationMethod = didDocument.dereferenceKey(didUrl, allowedPurposes)\n\n return getPublicJwkFromVerificationMethod(verificationMethod)\n}\n\nexport function encodeJwtIssuer(jwtIssuer: OpenId4VcJwtIssuer): OpenId4VcJwtIssuerEncoded {\n if (jwtIssuer.method === 'jwk') {\n return {\n method: 'jwk',\n jwk: jwtIssuer.jwk.toJson(),\n }\n }\n\n if (jwtIssuer.method === 'x5c') {\n return {\n method: 'x5c',\n leafCertificateKeyId: jwtIssuer.x5c[0].keyId,\n x5c: jwtIssuer.x5c.map((c) => c.toString('base64')),\n }\n }\n\n return jwtIssuer\n}\n\nexport function decodeJwtIssuer(encodedJwtIssuer: OpenId4VcJwtIssuerEncoded): OpenId4VcJwtIssuer {\n if (encodedJwtIssuer.method === 'jwk') {\n return {\n method: 'jwk',\n jwk: Kms.PublicJwk.fromUnknown(encodedJwtIssuer.jwk),\n }\n }\n\n if (encodedJwtIssuer.method === 'x5c') {\n return {\n method: 'x5c',\n x5c: encodedJwtIssuer.x5c.map((e, i) => {\n const c = X509Certificate.fromEncodedCertificate(e)\n if (i === 0) c.keyId = encodedJwtIssuer.leafCertificateKeyId\n return c\n }),\n }\n }\n\n return encodedJwtIssuer\n}\n\nexport async function credoJwtIssuerToOpenId4VcJwtIssuer(\n agentContext: AgentContext,\n createJwtIssuer: OpenId4VcJwtIssuer\n): Promise<JwtSigner> {\n if (createJwtIssuer.method === 'did') {\n const dids = agentContext.resolve(DidsApi)\n const { publicJwk } = await dids.resolveVerificationMethodFromCreatedDidRecord(createJwtIssuer.didUrl)\n\n return {\n method: createJwtIssuer.method,\n didUrl: createJwtIssuer.didUrl,\n alg: publicJwk.signatureAlgorithm,\n kid: publicJwk.keyId,\n }\n }\n if (createJwtIssuer.method === 'x5c') {\n const leafCertificate = createJwtIssuer.x5c[0]\n if (!leafCertificate) {\n throw new CredoError('Unable to extract leaf certificate, x5c certificate chain is empty')\n }\n\n return {\n ...createJwtIssuer,\n x5c: createJwtIssuer.x5c.map((certificate) => certificate.toString('base64')),\n alg: leafCertificate.publicJwk.signatureAlgorithm,\n kid: leafCertificate.publicJwk.keyId,\n }\n }\n if (createJwtIssuer.method === 'jwk') {\n return {\n ...createJwtIssuer,\n publicJwk: createJwtIssuer.jwk.toJson() as Jwk,\n alg: createJwtIssuer.jwk.signatureAlgorithm,\n }\n }\n\n throw new CredoError(`Unsupported jwt issuer method '${(createJwtIssuer as OpenId4VcJwtIssuer).method}'`)\n}\n\nexport function getProofTypeFromPublicJwk(agentContext: AgentContext, key: Kms.PublicJwk) {\n const signatureSuiteRegistry = agentContext.dependencyManager.resolve(SignatureSuiteRegistry)\n\n const supportedSignatureSuites = signatureSuiteRegistry.getAllByPublicJwkType(key)\n if (supportedSignatureSuites.length === 0) {\n throw new CredoError(`Couldn't find a supported signature suite for the given key ${key.jwkTypeHumanDescription}.`)\n }\n\n return supportedSignatureSuites[0].proofType\n}\n\nexport function parseIfJson<T>(input: T): T | Record<string, unknown> {\n if (typeof input !== 'string') {\n return input\n }\n\n try {\n // Try to parse the string as JSON\n return JSON.parse(input)\n } catch (_error) {\n /* empty */\n }\n\n return input\n}\n\nexport function dcqlCredentialQueryToPresentationFormat(credential: DcqlQuery['credentials'][number]) {\n switch (credential.format) {\n case 'dc+sd-jwt':\n return ClaimFormat.SdJwtDc\n case 'vc+sd-jwt':\n if (credential.meta && 'type_values' in credential.meta) {\n return ClaimFormat.SdJwtW3cVp\n }\n\n return ClaimFormat.SdJwtDc\n case 'jwt_vc_json':\n return ClaimFormat.JwtVp\n case 'ldp_vc':\n return ClaimFormat.LdpVp\n case 'mso_mdoc':\n return ClaimFormat.MsoMdoc\n }\n}\n"],"mappings":";;;;;;AAkBA,SAAgB,mCAAmC,cAA8D;CAC/G,MAAM,MAAM,aAAa,QAAQ,IAAI,iBAAiB;AAOtD,QAJwC,OAAO,OAAO,IAAI,4BAA4B,CAAC,QACpF,cAAc,IAAI,8BAA8B;EAAE,WAAW;EAAQ;EAAW,CAAC,CAAC,SAAS,EAC7F;;AAKH,eAAsB,oBACpB,cACA,QACA,kBAAgC,CAAC,iBAAiB,EAClD;AAKA,QAAO,oCAHa,MADJ,aAAa,kBAAkB,QAAQ,QAAQ,CAC7B,mBAAmB,OAAO,EACrB,eAAe,QAAQ,gBAAgB,CAEjB;;AAG/D,SAAgB,gBAAgB,WAA0D;AACxF,KAAI,UAAU,WAAW,MACvB,QAAO;EACL,QAAQ;EACR,KAAK,UAAU,IAAI,QAAQ;EAC5B;AAGH,KAAI,UAAU,WAAW,MACvB,QAAO;EACL,QAAQ;EACR,sBAAsB,UAAU,IAAI,GAAG;EACvC,KAAK,UAAU,IAAI,KAAK,MAAM,EAAE,SAAS,SAAS,CAAC;EACpD;AAGH,QAAO;;AAGT,SAAgB,gBAAgB,kBAAiE;AAC/F,KAAI,iBAAiB,WAAW,MAC9B,QAAO;EACL,QAAQ;EACR,KAAK,IAAI,UAAU,YAAY,iBAAiB,IAAI;EACrD;AAGH,KAAI,iBAAiB,WAAW,MAC9B,QAAO;EACL,QAAQ;EACR,KAAK,iBAAiB,IAAI,KAAK,GAAG,MAAM;GACtC,MAAM,IAAI,gBAAgB,uBAAuB,EAAE;AACnD,OAAI,MAAM,EAAG,GAAE,QAAQ,iBAAiB;AACxC,UAAO;IACP;EACH;AAGH,QAAO;;AAGT,eAAsB,mCACpB,cACA,iBACoB;AACpB,KAAI,gBAAgB,WAAW,OAAO;EAEpC,MAAM,EAAE,cAAc,MADT,aAAa,QAAQ,QAAQ,CACT,8CAA8C,gBAAgB,OAAO;AAEtG,SAAO;GACL,QAAQ,gBAAgB;GACxB,QAAQ,gBAAgB;GACxB,KAAK,UAAU;GACf,KAAK,UAAU;GAChB;;AAEH,KAAI,gBAAgB,WAAW,OAAO;EACpC,MAAM,kBAAkB,gBAAgB,IAAI;AAC5C,MAAI,CAAC,gBACH,OAAM,IAAI,WAAW,qEAAqE;AAG5F,SAAO;GACL,GAAG;GACH,KAAK,gBAAgB,IAAI,KAAK,gBAAgB,YAAY,SAAS,SAAS,CAAC;GAC7E,KAAK,gBAAgB,UAAU;GAC/B,KAAK,gBAAgB,UAAU;GAChC;;AAEH,KAAI,gBAAgB,WAAW,MAC7B,QAAO;EACL,GAAG;EACH,WAAW,gBAAgB,IAAI,QAAQ;EACvC,KAAK,gBAAgB,IAAI;EAC1B;AAGH,OAAM,IAAI,WAAW,kCAAmC,gBAAuC,OAAO,GAAG;;AAG3G,SAAgB,0BAA0B,cAA4B,KAAoB;CAGxF,MAAM,2BAFyB,aAAa,kBAAkB,QAAQ,uBAAuB,CAErC,sBAAsB,IAAI;AAClF,KAAI,yBAAyB,WAAW,EACtC,OAAM,IAAI,WAAW,+DAA+D,IAAI,wBAAwB,GAAG;AAGrH,QAAO,yBAAyB,GAAG;;AAkBrC,SAAgB,wCAAwC,YAA8C;AACpG,SAAQ,WAAW,QAAnB;EACE,KAAK,YACH,QAAO,YAAY;EACrB,KAAK;AACH,OAAI,WAAW,QAAQ,iBAAiB,WAAW,KACjD,QAAO,YAAY;AAGrB,UAAO,YAAY;EACrB,KAAK,cACH,QAAO,YAAY;EACrB,KAAK,SACH,QAAO,YAAY;EACrB,KAAK,WACH,QAAO,YAAY"}
package/package.json CHANGED
@@ -1,8 +1,10 @@
1
1
  {
2
2
  "name": "@credo-ts/openid4vc",
3
- "main": "build/index",
4
- "types": "build/index",
5
- "version": "0.6.1-pr-2091-20241119140918",
3
+ "exports": {
4
+ ".": "./build/index.mjs",
5
+ "./package.json": "./package.json"
6
+ },
7
+ "version": "0.6.1",
6
8
  "files": [
7
9
  "build"
8
10
  ],
@@ -10,6 +12,14 @@
10
12
  "publishConfig": {
11
13
  "access": "public"
12
14
  },
15
+ "browser": {
16
+ "./build/shared/router/express.mjs": "./build/shared/router/express.browser.mjs",
17
+ "./build/shared/router/express.js": "./build/shared/router/express.browser.js"
18
+ },
19
+ "react-native": {
20
+ "./build/shared/router/express.mjs": "./build/shared/router/express.native.mjs",
21
+ "./build/shared/router/express.js": "./build/shared/router/express.native.js"
22
+ },
13
23
  "homepage": "https://github.com/openwallet-foundation/credo-ts/tree/main/packages/openid4vc",
14
24
  "repository": {
15
25
  "type": "git",
@@ -17,28 +27,25 @@
17
27
  "directory": "packages/openid4vc"
18
28
  },
19
29
  "dependencies": {
20
- "@sphereon/did-auth-siop": "0.16.1-fix.173",
21
- "@sphereon/oid4vc-common": "0.16.1-fix.173",
22
- "@sphereon/ssi-types": "0.30.2-next.135",
23
- "class-transformer": "^0.5.1",
24
- "rxjs": "^7.8.0",
25
- "zod": "^3.23.8",
26
- "@animo-id/oid4vci": "0.1.3",
27
- "@animo-id/oauth2": "0.1.3",
28
- "@credo-ts/core": "0.6.1-pr-2091-20241119140918"
30
+ "class-transformer": "0.5.1",
31
+ "rxjs": "^7.8.2",
32
+ "zod": "^4.1.12",
33
+ "@openid4vc/openid4vci": "^0.4.1",
34
+ "@openid4vc/oauth2": "^0.4.1",
35
+ "@openid4vc/openid4vp": "^0.4.1",
36
+ "@openid4vc/utils": "^0.4.1",
37
+ "@types/express": "^5.0.6",
38
+ "express": "^5.2.0",
39
+ "@credo-ts/core": "0.6.1"
29
40
  },
30
41
  "devDependencies": {
31
- "@types/express": "^4.17.21",
32
- "express": "^4.18.2",
33
- "nock": "^14.0.0-beta.16",
34
- "rimraf": "^4.4.0",
35
- "typescript": "~5.5.2",
36
- "@credo-ts/tenants": "0.6.1-pr-2091-20241119140918"
42
+ "nock": "^14.0.10",
43
+ "typescript": "~5.9.3",
44
+ "@credo-ts/tenants": "0.6.1"
37
45
  },
38
46
  "scripts": {
39
- "build": "pnpm run clean && pnpm run compile",
40
- "clean": "rimraf ./build",
41
- "compile": "tsc -p tsconfig.build.json",
42
- "test": "jest"
43
- }
47
+ "build": "tsdown --config-loader unconfig"
48
+ },
49
+ "types": "./build/index.d.mts",
50
+ "module": "./build/index.mjs"
44
51
  }
package/build/index.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export * from './openid4vc-holder';
2
- export * from './openid4vc-verifier';
3
- export * from './openid4vc-issuer';
4
- export * from './shared';
package/build/index.js DELETED
@@ -1,21 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./openid4vc-holder"), exports);
18
- __exportStar(require("./openid4vc-verifier"), exports);
19
- __exportStar(require("./openid4vc-issuer"), exports);
20
- __exportStar(require("./shared"), exports);
21
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAkC;AAClC,uDAAoC;AACpC,qDAAkC;AAClC,2CAAwB"}
@@ -1,124 +0,0 @@
1
- import type { OpenId4VciResolvedCredentialOffer, OpenId4VciAuthCodeFlowOptions, OpenId4VciTokenRequestOptions as OpenId4VciRequestTokenOptions, OpenId4VciCredentialRequestOptions as OpenId4VciRequestCredentialOptions, OpenId4VciSendNotificationOptions, OpenId4VciRequestTokenResponse, OpenId4VciRetrieveAuthorizationCodeUsingPresentationOptions } from './OpenId4VciHolderServiceOptions';
2
- import type { OpenId4VcSiopAcceptAuthorizationRequestOptions } from './OpenId4vcSiopHolderServiceOptions';
3
- import { AgentContext, DifPresentationExchangeService, DifPexCredentialsForRequest } from '@credo-ts/core';
4
- import { OpenId4VciMetadata } from '../shared';
5
- import { OpenId4VciHolderService } from './OpenId4VciHolderService';
6
- import { OpenId4VcSiopHolderService } from './OpenId4vcSiopHolderService';
7
- /**
8
- * @public
9
- */
10
- export declare class OpenId4VcHolderApi {
11
- private agentContext;
12
- private openId4VciHolderService;
13
- private openId4VcSiopHolderService;
14
- private difPresentationExchangeService;
15
- constructor(agentContext: AgentContext, openId4VciHolderService: OpenId4VciHolderService, openId4VcSiopHolderService: OpenId4VcSiopHolderService, difPresentationExchangeService: DifPresentationExchangeService);
16
- /**
17
- * Resolves the authentication request given as URI or JWT to a unified format, and
18
- * verifies the validity of the request.
19
- *
20
- * The resolved request can be accepted with the @see acceptSiopAuthorizationRequest.
21
- *
22
- * If the authorization request uses OpenID4VP and included presentation definitions,
23
- * a `presentationExchange` property will be defined with credentials that satisfy the
24
- * incoming request. When `presentationExchange` is present, you MUST supply `presentationExchange`
25
- * when calling `acceptSiopAuthorizationRequest` as well.
26
- *
27
- * @param requestJwtOrUri JWT or an SIOPv2 request URI
28
- * @returns the resolved and verified authentication request.
29
- */
30
- resolveSiopAuthorizationRequest(requestJwtOrUri: string): Promise<import("./OpenId4vcSiopHolderServiceOptions").OpenId4VcSiopResolvedAuthorizationRequest>;
31
- /**
32
- * Accepts the authentication request after it has been resolved and verified with {@link resolveSiopAuthorizationRequest}.
33
- *
34
- * If the resolved authorization request included a `presentationExchange` property, you MUST supply `presentationExchange`
35
- * in the `options` parameter.
36
- *
37
- * If no `presentationExchange` property is present, you MUST supply `openIdTokenIssuer` in the `options` parameter.
38
- */
39
- acceptSiopAuthorizationRequest(options: OpenId4VcSiopAcceptAuthorizationRequestOptions): Promise<{
40
- readonly ok: false;
41
- readonly serverResponse: {
42
- readonly status: number;
43
- readonly body: string | Record<string, unknown> | null;
44
- };
45
- readonly submittedResponse: import("@sphereon/did-auth-siop").AuthorizationResponsePayload;
46
- readonly redirectUri?: undefined;
47
- readonly presentationDuringIssuanceSession?: undefined;
48
- } | {
49
- readonly ok: true;
50
- readonly serverResponse: {
51
- readonly status: number;
52
- readonly body: Record<string, unknown>;
53
- };
54
- readonly submittedResponse: import("@sphereon/did-auth-siop").AuthorizationResponsePayload;
55
- readonly redirectUri: string | undefined;
56
- readonly presentationDuringIssuanceSession: string | undefined;
57
- }>;
58
- /**
59
- * Automatically select credentials from available credentials for a request. Can be called after calling
60
- * @see resolveSiopAuthorizationRequest.
61
- */
62
- selectCredentialsForRequest(credentialsForRequest: DifPexCredentialsForRequest): import("@credo-ts/core").DifPexInputDescriptorToCredentials;
63
- resolveIssuerMetadata(credentialIssuer: string): Promise<OpenId4VciMetadata>;
64
- /**
65
- * Resolves a credential offer given as credential offer URL, or issuance initiation URL,
66
- * into a unified format with metadata.
67
- *
68
- * @param credentialOffer the credential offer to resolve
69
- * @returns The uniform credential offer payload, the issuer metadata, protocol version, and the offered credentials with metadata.
70
- */
71
- resolveCredentialOffer(credentialOffer: string): Promise<OpenId4VciResolvedCredentialOffer>;
72
- /**
73
- * This function is to be used to receive an credential in OpenID4VCI using the Authorization Code Flow.
74
- *
75
- * Not to be confused with the {@link resolveSiopAuthorizationRequest}, which is only used for SIOP requests.
76
- *
77
- * It will generate an authorization session based on the provided options.
78
- *
79
- * There are two possible flows:
80
- * - Oauth2Recirect: an authorization request URI is returend which can be used to obtain the authorization code.
81
- * This needs to be done manually (e.g. by opening a browser window)
82
- * - PresentationDuringIssuance: an openid4vp presentation request needs to be handled. A oid4vpRequestUri is returned
83
- * which can be parsed using `resolveSiopAuthorizationRequest`. After the presentation session has been completed,
84
- * the resulting `presentationDuringIssuanceSession` can be used to obtain an authorization code
85
- *
86
- * Authorization to request credentials can be requested via authorization_details or scopes.
87
- * This function automatically generates the authorization_details for all offered credentials.
88
- * If scopes are provided, the provided scopes are sent alongside the authorization_details.
89
- *
90
- * @param resolvedCredentialOffer Obtained through @see resolveCredentialOffer
91
- * @param authCodeFlowOptions
92
- * @returns The authorization request URI alongside the code verifier and original @param authCodeFlowOptions
93
- */
94
- resolveIssuanceAuthorizationRequest(resolvedCredentialOffer: OpenId4VciResolvedCredentialOffer, authCodeFlowOptions: OpenId4VciAuthCodeFlowOptions): Promise<import("./OpenId4VciHolderServiceOptions").OpenId4VciResolvedAuthorizationRequest>;
95
- /**
96
- * Retrieve an authorization code using an `presentationDuringIssuanceSession`.
97
- *
98
- * The authorization code can be exchanged for an `accessToken` @see requestToken
99
- */
100
- retrieveAuthorizationCodeUsingPresentation(options: OpenId4VciRetrieveAuthorizationCodeUsingPresentationOptions): Promise<{
101
- authorizationCode: string;
102
- }>;
103
- /**
104
- * Requests the token to be used for credential requests.
105
- */
106
- requestToken(options: OpenId4VciRequestTokenOptions): Promise<OpenId4VciRequestTokenResponse>;
107
- /**
108
- * Request a set of credentials from the credential isser.
109
- * Can be used with both the pre-authorized code flow and the authorization code flow.
110
- */
111
- requestCredentials(options: OpenId4VciRequestCredentialOptions): Promise<{
112
- credentials: import("./OpenId4VciHolderServiceOptions").OpenId4VciCredentialResponse[];
113
- dpop: {
114
- nonce: string | undefined;
115
- jwk: import("@credo-ts/core").Jwk;
116
- alg: import("@credo-ts/core").JwaSignatureAlgorithm;
117
- } | undefined;
118
- cNonce: string | undefined;
119
- }>;
120
- /**
121
- * Send a notification event to the credential issuer
122
- */
123
- sendNotification(options: OpenId4VciSendNotificationOptions): Promise<void>;
124
- }