@authup/server-core 1.0.0-beta.62 → 1.0.0-beta.64

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 (769) hide show
  1. package/dist/adapters/database/data-source/options/module.d.ts +1 -0
  2. package/dist/adapters/database/data-source/options/module.d.ts.map +1 -1
  3. package/dist/adapters/database/data-source/options/module.mjs +33 -4
  4. package/dist/adapters/database/data-source/options/module.mjs.map +1 -1
  5. package/dist/adapters/database/domains/client/entity.d.ts +1 -2
  6. package/dist/adapters/database/domains/client/entity.d.ts.map +1 -1
  7. package/dist/adapters/database/domains/client/entity.mjs +7 -14
  8. package/dist/adapters/database/domains/client/entity.mjs.map +1 -1
  9. package/dist/adapters/database/domains/identity-provider-attribute/subscriber.d.ts +9 -1
  10. package/dist/adapters/database/domains/identity-provider-attribute/subscriber.d.ts.map +1 -1
  11. package/dist/adapters/database/domains/identity-provider-attribute/subscriber.mjs +14 -0
  12. package/dist/adapters/database/domains/identity-provider-attribute/subscriber.mjs.map +1 -1
  13. package/dist/adapters/database/domains/session/entity.d.ts +8 -0
  14. package/dist/adapters/database/domains/session/entity.d.ts.map +1 -1
  15. package/dist/adapters/database/domains/session/entity.mjs +19 -0
  16. package/dist/adapters/database/domains/session/entity.mjs.map +1 -1
  17. package/dist/adapters/database/domains/user/entity.d.ts +1 -0
  18. package/dist/adapters/database/domains/user/entity.d.ts.map +1 -1
  19. package/dist/adapters/database/domains/user/entity.mjs +6 -0
  20. package/dist/adapters/database/domains/user/entity.mjs.map +1 -1
  21. package/dist/adapters/database/extra-attribute-repository/repository.mjs +1 -1
  22. package/dist/adapters/database/extra-attribute-repository/repository.mjs.map +1 -1
  23. package/dist/adapters/database/extra-attribute-repository/tree/adapter.mjs +4 -2
  24. package/dist/adapters/database/extra-attribute-repository/tree/adapter.mjs.map +1 -1
  25. package/dist/adapters/database/extra-attribute-repository/tree/repository.mjs +1 -1
  26. package/dist/adapters/database/extra-attribute-repository/tree/repository.mjs.map +1 -1
  27. package/dist/adapters/database/index.mjs +3 -3
  28. package/dist/adapters/database/migrations/mysql/1787571998009-SessionUserAndClientColumns.d.ts +56 -0
  29. package/dist/adapters/database/migrations/mysql/1787571998009-SessionUserAndClientColumns.d.ts.map +1 -0
  30. package/dist/adapters/database/migrations/mysql/1787571998009-SessionUserAndClientColumns.mjs +105 -0
  31. package/dist/adapters/database/migrations/mysql/1787571998009-SessionUserAndClientColumns.mjs.map +1 -0
  32. package/dist/adapters/database/migrations/postgres/1787571998009-SessionUserAndClientColumns.d.ts +56 -0
  33. package/dist/adapters/database/migrations/postgres/1787571998009-SessionUserAndClientColumns.d.ts.map +1 -0
  34. package/dist/adapters/database/migrations/postgres/1787571998009-SessionUserAndClientColumns.mjs +104 -0
  35. package/dist/adapters/database/migrations/postgres/1787571998009-SessionUserAndClientColumns.mjs.map +1 -0
  36. package/dist/adapters/database/subscriber/module.d.ts +6 -2
  37. package/dist/adapters/database/subscriber/module.d.ts.map +1 -1
  38. package/dist/adapters/database/subscriber/module.mjs +9 -5
  39. package/dist/adapters/database/subscriber/module.mjs.map +1 -1
  40. package/dist/adapters/http/adapters/oauth2/authorization/module.mjs +1 -1
  41. package/dist/adapters/http/adapters/oauth2/authorization/module.mjs.map +1 -1
  42. package/dist/adapters/http/adapters/oauth2/grant-types/refresh_token.d.ts.map +1 -1
  43. package/dist/adapters/http/adapters/oauth2/grant-types/refresh_token.mjs +8 -2
  44. package/dist/adapters/http/adapters/oauth2/grant-types/refresh_token.mjs.map +1 -1
  45. package/dist/adapters/http/constants.d.ts +18 -0
  46. package/dist/adapters/http/constants.d.ts.map +1 -0
  47. package/dist/adapters/http/constants.mjs +23 -0
  48. package/dist/adapters/http/constants.mjs.map +1 -0
  49. package/dist/adapters/http/controllers/entities/client/module.mjs +1 -1
  50. package/dist/adapters/http/controllers/entities/identity-provider/module.d.ts +23 -1
  51. package/dist/adapters/http/controllers/entities/identity-provider/module.d.ts.map +1 -1
  52. package/dist/adapters/http/controllers/entities/identity-provider/module.mjs +86 -47
  53. package/dist/adapters/http/controllers/entities/identity-provider/module.mjs.map +1 -1
  54. package/dist/adapters/http/controllers/entities/identity-provider/types.d.ts +6 -0
  55. package/dist/adapters/http/controllers/entities/identity-provider/types.d.ts.map +1 -1
  56. package/dist/adapters/http/controllers/entities/realm/module.d.ts.map +1 -1
  57. package/dist/adapters/http/controllers/entities/realm/module.mjs +2 -0
  58. package/dist/adapters/http/controllers/entities/realm/module.mjs.map +1 -1
  59. package/dist/adapters/http/controllers/entities/session/module.d.ts +33 -1
  60. package/dist/adapters/http/controllers/entities/session/module.d.ts.map +1 -1
  61. package/dist/adapters/http/controllers/entities/session/module.mjs +74 -0
  62. package/dist/adapters/http/controllers/entities/session/module.mjs.map +1 -1
  63. package/dist/adapters/http/controllers/index.mjs +3 -1
  64. package/dist/adapters/http/controllers/workflows/account/index.d.ts +1 -0
  65. package/dist/adapters/http/controllers/workflows/account/index.d.ts.map +1 -1
  66. package/dist/adapters/http/controllers/workflows/account/module.d.ts +25 -16
  67. package/dist/adapters/http/controllers/workflows/account/module.d.ts.map +1 -1
  68. package/dist/adapters/http/controllers/workflows/account/module.mjs +40 -17
  69. package/dist/adapters/http/controllers/workflows/account/module.mjs.map +1 -1
  70. package/dist/adapters/http/controllers/workflows/account/types.d.ts +33 -0
  71. package/dist/adapters/http/controllers/workflows/account/types.d.ts.map +1 -0
  72. package/dist/adapters/http/controllers/workflows/activate/module.d.ts +8 -4
  73. package/dist/adapters/http/controllers/workflows/activate/module.d.ts.map +1 -1
  74. package/dist/adapters/http/controllers/workflows/activate/module.mjs +7 -9
  75. package/dist/adapters/http/controllers/workflows/activate/module.mjs.map +1 -1
  76. package/dist/adapters/http/controllers/workflows/admin/index.d.ts.map +1 -0
  77. package/dist/adapters/http/controllers/workflows/admin/index.mjs +5 -0
  78. package/dist/adapters/http/controllers/workflows/admin/module.d.ts +30 -0
  79. package/dist/adapters/http/controllers/workflows/admin/module.d.ts.map +1 -0
  80. package/dist/adapters/http/controllers/workflows/admin/module.mjs +88 -0
  81. package/dist/adapters/http/controllers/workflows/admin/module.mjs.map +1 -0
  82. package/dist/adapters/http/controllers/workflows/admin/types.d.ts +14 -0
  83. package/dist/adapters/http/controllers/workflows/admin/types.d.ts.map +1 -0
  84. package/dist/adapters/http/controllers/workflows/auth-console.d.ts +16 -0
  85. package/dist/adapters/http/controllers/workflows/auth-console.d.ts.map +1 -0
  86. package/dist/adapters/http/controllers/workflows/auth-console.mjs +32 -0
  87. package/dist/adapters/http/controllers/workflows/auth-console.mjs.map +1 -0
  88. package/dist/adapters/http/controllers/workflows/authenticator-challenge/module.d.ts +2 -0
  89. package/dist/adapters/http/controllers/workflows/authenticator-challenge/module.d.ts.map +1 -1
  90. package/dist/adapters/http/controllers/workflows/authenticator-challenge/module.mjs +21 -3
  91. package/dist/adapters/http/controllers/workflows/authenticator-challenge/module.mjs.map +1 -1
  92. package/dist/adapters/http/controllers/workflows/authorize/module.d.ts +16 -1
  93. package/dist/adapters/http/controllers/workflows/authorize/module.d.ts.map +1 -1
  94. package/dist/adapters/http/controllers/workflows/authorize/module.mjs +44 -21
  95. package/dist/adapters/http/controllers/workflows/authorize/module.mjs.map +1 -1
  96. package/dist/adapters/http/controllers/workflows/authorize/types.d.ts +5 -0
  97. package/dist/adapters/http/controllers/workflows/authorize/types.d.ts.map +1 -1
  98. package/dist/adapters/http/controllers/workflows/console-login/index.d.ts +3 -0
  99. package/dist/adapters/http/controllers/workflows/console-login/index.d.ts.map +1 -0
  100. package/dist/adapters/http/controllers/workflows/console-login/index.mjs +5 -0
  101. package/dist/adapters/http/controllers/workflows/console-login/module.d.ts +83 -0
  102. package/dist/adapters/http/controllers/workflows/console-login/module.d.ts.map +1 -0
  103. package/dist/adapters/http/controllers/workflows/console-login/module.mjs +230 -0
  104. package/dist/adapters/http/controllers/workflows/console-login/module.mjs.map +1 -0
  105. package/dist/adapters/http/controllers/workflows/console-login/types.d.ts +58 -0
  106. package/dist/adapters/http/controllers/workflows/console-login/types.d.ts.map +1 -0
  107. package/dist/adapters/http/controllers/workflows/index.d.ts +2 -0
  108. package/dist/adapters/http/controllers/workflows/index.d.ts.map +1 -1
  109. package/dist/adapters/http/controllers/workflows/index.mjs +5 -1
  110. package/dist/adapters/http/controllers/workflows/logout/module.d.ts +32 -3
  111. package/dist/adapters/http/controllers/workflows/logout/module.d.ts.map +1 -1
  112. package/dist/adapters/http/controllers/workflows/logout/module.mjs +48 -24
  113. package/dist/adapters/http/controllers/workflows/logout/module.mjs.map +1 -1
  114. package/dist/adapters/http/controllers/workflows/logout/types.d.ts +1 -1
  115. package/dist/adapters/http/controllers/workflows/logout/types.d.ts.map +1 -1
  116. package/dist/adapters/http/controllers/workflows/password-forgot/module.d.ts +8 -4
  117. package/dist/adapters/http/controllers/workflows/password-forgot/module.d.ts.map +1 -1
  118. package/dist/adapters/http/controllers/workflows/password-forgot/module.mjs +7 -9
  119. package/dist/adapters/http/controllers/workflows/password-forgot/module.mjs.map +1 -1
  120. package/dist/adapters/http/controllers/workflows/password-reset/module.d.ts +8 -4
  121. package/dist/adapters/http/controllers/workflows/password-reset/module.d.ts.map +1 -1
  122. package/dist/adapters/http/controllers/workflows/password-reset/module.mjs +7 -10
  123. package/dist/adapters/http/controllers/workflows/password-reset/module.mjs.map +1 -1
  124. package/dist/adapters/http/controllers/workflows/register/module.d.ts +8 -4
  125. package/dist/adapters/http/controllers/workflows/register/module.d.ts.map +1 -1
  126. package/dist/adapters/http/controllers/workflows/register/module.mjs +7 -9
  127. package/dist/adapters/http/controllers/workflows/register/module.mjs.map +1 -1
  128. package/dist/adapters/http/controllers/workflows/status/module.mjs +1 -1
  129. package/dist/adapters/http/controllers/workflows/token/module.d.ts +45 -2
  130. package/dist/adapters/http/controllers/workflows/token/module.d.ts.map +1 -1
  131. package/dist/adapters/http/controllers/workflows/token/module.mjs +117 -26
  132. package/dist/adapters/http/controllers/workflows/token/module.mjs.map +1 -1
  133. package/dist/adapters/http/cookie/index.d.ts +2 -0
  134. package/dist/adapters/http/cookie/index.d.ts.map +1 -0
  135. package/dist/adapters/http/cookie/index.mjs +5 -0
  136. package/dist/adapters/http/cookie/session.d.ts +35 -0
  137. package/dist/adapters/http/cookie/session.d.ts.map +1 -0
  138. package/dist/adapters/http/cookie/session.mjs +62 -0
  139. package/dist/adapters/http/cookie/session.mjs.map +1 -0
  140. package/dist/adapters/http/index.d.ts +2 -0
  141. package/dist/adapters/http/index.d.ts.map +1 -1
  142. package/dist/adapters/http/index.mjs +20 -16
  143. package/dist/adapters/http/internal-client/index.d.ts +3 -0
  144. package/dist/adapters/http/internal-client/index.d.ts.map +1 -0
  145. package/dist/adapters/http/internal-client/index.mjs +5 -0
  146. package/dist/adapters/http/internal-client/module.d.ts +21 -0
  147. package/dist/adapters/http/internal-client/module.d.ts.map +1 -0
  148. package/dist/adapters/http/{ui/auth-console/http-client.mjs → internal-client/module.mjs} +16 -15
  149. package/dist/adapters/http/internal-client/module.mjs.map +1 -0
  150. package/dist/adapters/http/internal-client/types.d.ts +13 -0
  151. package/dist/adapters/http/internal-client/types.d.ts.map +1 -0
  152. package/dist/adapters/http/middleware/built-in/authorization/index.d.ts +1 -0
  153. package/dist/adapters/http/middleware/built-in/authorization/index.d.ts.map +1 -1
  154. package/dist/adapters/http/middleware/built-in/authorization/index.mjs +2 -1
  155. package/dist/adapters/http/middleware/built-in/authorization/issuance.d.ts +45 -0
  156. package/dist/adapters/http/middleware/built-in/authorization/issuance.d.ts.map +1 -0
  157. package/dist/adapters/http/middleware/built-in/authorization/issuance.mjs +61 -0
  158. package/dist/adapters/http/middleware/built-in/authorization/issuance.mjs.map +1 -0
  159. package/dist/adapters/http/middleware/built-in/authorization/module.d.ts +26 -2
  160. package/dist/adapters/http/middleware/built-in/authorization/module.d.ts.map +1 -1
  161. package/dist/adapters/http/middleware/built-in/authorization/module.mjs +67 -1
  162. package/dist/adapters/http/middleware/built-in/authorization/module.mjs.map +1 -1
  163. package/dist/adapters/http/middleware/built-in/authorization/types.d.ts +21 -1
  164. package/dist/adapters/http/middleware/built-in/authorization/types.d.ts.map +1 -1
  165. package/dist/adapters/http/middleware/built-in/basic.d.ts +2 -2
  166. package/dist/adapters/http/middleware/built-in/basic.d.ts.map +1 -1
  167. package/dist/adapters/http/middleware/built-in/basic.mjs.map +1 -1
  168. package/dist/adapters/http/middleware/built-in/cors.d.ts +8 -2
  169. package/dist/adapters/http/middleware/built-in/cors.d.ts.map +1 -1
  170. package/dist/adapters/http/middleware/built-in/cors.mjs +20 -3
  171. package/dist/adapters/http/middleware/built-in/cors.mjs.map +1 -1
  172. package/dist/adapters/http/middleware/built-in/error.d.ts +2 -2
  173. package/dist/adapters/http/middleware/built-in/error.d.ts.map +1 -1
  174. package/dist/adapters/http/middleware/built-in/error.mjs +10 -1
  175. package/dist/adapters/http/middleware/built-in/error.mjs.map +1 -1
  176. package/dist/adapters/http/middleware/built-in/index.d.ts +1 -4
  177. package/dist/adapters/http/middleware/built-in/index.d.ts.map +1 -1
  178. package/dist/adapters/http/middleware/built-in/index.mjs +3 -4
  179. package/dist/adapters/http/middleware/built-in/internal-http-client.d.ts +17 -0
  180. package/dist/adapters/http/middleware/built-in/internal-http-client.d.ts.map +1 -0
  181. package/dist/adapters/http/middleware/built-in/internal-http-client.mjs +27 -0
  182. package/dist/adapters/http/middleware/built-in/internal-http-client.mjs.map +1 -0
  183. package/dist/adapters/http/middleware/built-in/logger.mjs +1 -1
  184. package/dist/adapters/http/middleware/built-in/logger.mjs.map +1 -1
  185. package/dist/adapters/http/middleware/built-in/prometheus.d.ts +6 -5
  186. package/dist/adapters/http/middleware/built-in/prometheus.d.ts.map +1 -1
  187. package/dist/adapters/http/middleware/built-in/prometheus.mjs +3 -2
  188. package/dist/adapters/http/middleware/built-in/prometheus.mjs.map +1 -1
  189. package/dist/adapters/http/middleware/built-in/rate-limit.d.ts +2 -2
  190. package/dist/adapters/http/middleware/built-in/rate-limit.d.ts.map +1 -1
  191. package/dist/adapters/http/middleware/built-in/rate-limit.mjs +15 -0
  192. package/dist/adapters/http/middleware/built-in/rate-limit.mjs.map +1 -1
  193. package/dist/adapters/http/middleware/index.mjs +3 -4
  194. package/dist/adapters/http/request/constants.d.ts +1 -1
  195. package/dist/adapters/http/request/constants.d.ts.map +1 -1
  196. package/dist/adapters/http/request/constants.mjs +1 -5
  197. package/dist/adapters/http/request/constants.mjs.map +1 -1
  198. package/dist/adapters/http/request/helpers/index.d.ts +1 -1
  199. package/dist/adapters/http/request/helpers/index.d.ts.map +1 -1
  200. package/dist/adapters/http/request/helpers/index.mjs +2 -2
  201. package/dist/adapters/http/request/helpers/locale.d.ts +2 -1
  202. package/dist/adapters/http/request/helpers/locale.d.ts.map +1 -1
  203. package/dist/adapters/http/request/helpers/locale.mjs +1 -1
  204. package/dist/adapters/http/request/helpers/locale.mjs.map +1 -1
  205. package/dist/adapters/http/request/helpers/same-origin.d.ts +38 -0
  206. package/dist/adapters/http/request/helpers/same-origin.d.ts.map +1 -0
  207. package/dist/adapters/http/request/helpers/same-origin.mjs +68 -0
  208. package/dist/adapters/http/request/helpers/same-origin.mjs.map +1 -0
  209. package/dist/adapters/http/request/index.mjs +2 -2
  210. package/dist/adapters/http/request/permission/module.mjs +1 -1
  211. package/dist/adapters/http/request/permission/module.mjs.map +1 -1
  212. package/dist/adapters/http/request/types.d.ts +1 -2
  213. package/dist/adapters/http/request/types.d.ts.map +1 -1
  214. package/dist/adapters/shared/ldap/module.d.ts.map +1 -1
  215. package/dist/adapters/shared/ldap/module.mjs +4 -1
  216. package/dist/adapters/shared/ldap/module.mjs.map +1 -1
  217. package/dist/app/builder.d.ts +4 -4
  218. package/dist/app/builder.d.ts.map +1 -1
  219. package/dist/app/builder.mjs +7 -4
  220. package/dist/app/builder.mjs.map +1 -1
  221. package/dist/app/factory.d.ts +10 -0
  222. package/dist/app/factory.d.ts.map +1 -1
  223. package/dist/app/factory.mjs +26 -2
  224. package/dist/app/factory.mjs.map +1 -1
  225. package/dist/app/index.mjs +17 -19
  226. package/dist/app/modules/authentication/module.d.ts.map +1 -1
  227. package/dist/app/modules/authentication/module.mjs +15 -2
  228. package/dist/app/modules/authentication/module.mjs.map +1 -1
  229. package/dist/app/modules/authentication/repositories/session.d.ts +4 -1
  230. package/dist/app/modules/authentication/repositories/session.d.ts.map +1 -1
  231. package/dist/app/modules/authentication/repositories/session.mjs +20 -3
  232. package/dist/app/modules/authentication/repositories/session.mjs.map +1 -1
  233. package/dist/app/modules/components/index.d.ts +1 -0
  234. package/dist/app/modules/components/index.d.ts.map +1 -1
  235. package/dist/app/modules/components/module.d.ts +3 -1
  236. package/dist/app/modules/components/module.d.ts.map +1 -1
  237. package/dist/app/modules/components/module.mjs +26 -7
  238. package/dist/app/modules/components/module.mjs.map +1 -1
  239. package/dist/app/modules/components/types.d.ts +11 -0
  240. package/dist/app/modules/components/types.d.ts.map +1 -0
  241. package/dist/app/modules/config/app-origins.d.ts +10 -0
  242. package/dist/app/modules/config/app-origins.d.ts.map +1 -0
  243. package/dist/app/modules/config/app-origins.mjs +21 -0
  244. package/dist/app/modules/config/app-origins.mjs.map +1 -0
  245. package/dist/app/modules/config/constants.d.ts +23 -50
  246. package/dist/app/modules/config/constants.d.ts.map +1 -1
  247. package/dist/app/modules/config/constants.mjs +34 -51
  248. package/dist/app/modules/config/constants.mjs.map +1 -1
  249. package/dist/app/modules/config/index.d.ts +2 -3
  250. package/dist/app/modules/config/index.d.ts.map +1 -1
  251. package/dist/app/modules/config/index.mjs +4 -8
  252. package/dist/app/modules/config/module.d.ts +2 -2
  253. package/dist/app/modules/config/module.d.ts.map +1 -1
  254. package/dist/app/modules/config/module.mjs +1 -1
  255. package/dist/app/modules/config/module.mjs.map +1 -1
  256. package/dist/app/modules/config/read.d.ts +29 -0
  257. package/dist/app/modules/config/read.d.ts.map +1 -0
  258. package/dist/app/modules/config/read.mjs +65 -0
  259. package/dist/app/modules/config/read.mjs.map +1 -0
  260. package/dist/app/modules/config/types.d.ts +30 -397
  261. package/dist/app/modules/config/types.d.ts.map +1 -1
  262. package/dist/app/modules/config/validator.d.ts.map +1 -1
  263. package/dist/app/modules/config/validator.mjs +3 -87
  264. package/dist/app/modules/config/validator.mjs.map +1 -1
  265. package/dist/app/modules/database/index.d.ts +1 -0
  266. package/dist/app/modules/database/index.d.ts.map +1 -1
  267. package/dist/app/modules/database/index.mjs +2 -1
  268. package/dist/app/modules/database/migration.d.ts +33 -0
  269. package/dist/app/modules/database/migration.d.ts.map +1 -0
  270. package/dist/app/modules/database/migration.mjs +52 -0
  271. package/dist/app/modules/database/migration.mjs.map +1 -0
  272. package/dist/app/modules/database/module.d.ts.map +1 -1
  273. package/dist/app/modules/database/module.mjs +12 -6
  274. package/dist/app/modules/database/module.mjs.map +1 -1
  275. package/dist/app/modules/database/repositories/client/repository.d.ts +6 -1
  276. package/dist/app/modules/database/repositories/client/repository.d.ts.map +1 -1
  277. package/dist/app/modules/database/repositories/client/repository.mjs +21 -4
  278. package/dist/app/modules/database/repositories/client/repository.mjs.map +1 -1
  279. package/dist/app/modules/database/repositories/event/repository.d.ts +29 -2
  280. package/dist/app/modules/database/repositories/event/repository.d.ts.map +1 -1
  281. package/dist/app/modules/database/repositories/event/repository.mjs +42 -24
  282. package/dist/app/modules/database/repositories/event/repository.mjs.map +1 -1
  283. package/dist/app/modules/database/repositories/helpers.d.ts +24 -1
  284. package/dist/app/modules/database/repositories/helpers.d.ts.map +1 -1
  285. package/dist/app/modules/database/repositories/helpers.mjs +38 -1
  286. package/dist/app/modules/database/repositories/helpers.mjs.map +1 -1
  287. package/dist/app/modules/database/repositories/identity-provider/repository.d.ts +3 -1
  288. package/dist/app/modules/database/repositories/identity-provider/repository.d.ts.map +1 -1
  289. package/dist/app/modules/database/repositories/identity-provider/repository.mjs +3 -3
  290. package/dist/app/modules/database/repositories/identity-provider/repository.mjs.map +1 -1
  291. package/dist/app/modules/database/repositories/identity-provider-account/repository.mjs +4 -2
  292. package/dist/app/modules/database/repositories/identity-provider-account/repository.mjs.map +1 -1
  293. package/dist/app/modules/database/repositories/key/repository.mjs +1 -1
  294. package/dist/app/modules/database/repositories/permission/repository.mjs +1 -1
  295. package/dist/app/modules/database/repositories/policy/repository.mjs +1 -1
  296. package/dist/app/modules/database/repositories/role/repository.mjs +1 -1
  297. package/dist/app/modules/database/repositories/scope/repository.mjs +1 -1
  298. package/dist/app/modules/database/repositories/trust-anchor/repository.mjs +1 -1
  299. package/dist/app/modules/database/repositories/user/repository.d.ts +7 -2
  300. package/dist/app/modules/database/repositories/user/repository.d.ts.map +1 -1
  301. package/dist/app/modules/database/repositories/user/repository.mjs +21 -4
  302. package/dist/app/modules/database/repositories/user/repository.mjs.map +1 -1
  303. package/dist/app/modules/http/constants.d.ts +3 -1
  304. package/dist/app/modules/http/constants.d.ts.map +1 -1
  305. package/dist/app/modules/http/constants.mjs +3 -2
  306. package/dist/app/modules/http/constants.mjs.map +1 -1
  307. package/dist/app/modules/http/module.d.ts +30 -9
  308. package/dist/app/modules/http/module.d.ts.map +1 -1
  309. package/dist/app/modules/http/module.mjs +31 -33
  310. package/dist/app/modules/http/module.mjs.map +1 -1
  311. package/dist/app/modules/http/modules/controller.d.ts +4 -3
  312. package/dist/app/modules/http/modules/controller.d.ts.map +1 -1
  313. package/dist/app/modules/http/modules/controller.mjs +70 -38
  314. package/dist/app/modules/http/modules/controller.mjs.map +1 -1
  315. package/dist/app/modules/http/modules/middleware.d.ts +13 -22
  316. package/dist/app/modules/http/modules/middleware.d.ts.map +1 -1
  317. package/dist/app/modules/http/modules/middleware.mjs +20 -36
  318. package/dist/app/modules/http/modules/middleware.mjs.map +1 -1
  319. package/dist/app/modules/identity/module.mjs +4 -4
  320. package/dist/app/modules/identity/repositories/client.mjs +4 -2
  321. package/dist/app/modules/identity/repositories/client.mjs.map +1 -1
  322. package/dist/app/modules/identity/repositories/user.mjs +4 -2
  323. package/dist/app/modules/identity/repositories/user.mjs.map +1 -1
  324. package/dist/app/modules/index.mjs +21 -23
  325. package/dist/app/modules/logger/module.mjs +1 -1
  326. package/dist/app/modules/logger/module.mjs.map +1 -1
  327. package/dist/app/modules/mail/module.d.ts.map +1 -1
  328. package/dist/app/modules/mail/module.mjs.map +1 -1
  329. package/dist/app/modules/oauth2/constants.d.ts +3 -1
  330. package/dist/app/modules/oauth2/constants.d.ts.map +1 -1
  331. package/dist/app/modules/oauth2/constants.mjs +2 -0
  332. package/dist/app/modules/oauth2/constants.mjs.map +1 -1
  333. package/dist/app/modules/oauth2/module.d.ts.map +1 -1
  334. package/dist/app/modules/oauth2/module.mjs +14 -4
  335. package/dist/app/modules/oauth2/module.mjs.map +1 -1
  336. package/dist/app/modules/oauth2/repositories/client/repository.mjs +4 -2
  337. package/dist/app/modules/oauth2/repositories/client/repository.mjs.map +1 -1
  338. package/dist/app/modules/oauth2/repositories/consent/repository.d.ts.map +1 -1
  339. package/dist/app/modules/oauth2/repositories/consent/repository.mjs +3 -2
  340. package/dist/app/modules/oauth2/repositories/consent/repository.mjs.map +1 -1
  341. package/dist/app/modules/oauth2/repositories/console-login/index.d.ts +2 -0
  342. package/dist/app/modules/oauth2/repositories/console-login/index.d.ts.map +1 -0
  343. package/dist/app/modules/oauth2/repositories/console-login/index.mjs +5 -0
  344. package/dist/app/modules/oauth2/repositories/console-login/store.d.ts +19 -0
  345. package/dist/app/modules/oauth2/repositories/console-login/store.d.ts.map +1 -0
  346. package/dist/app/modules/oauth2/repositories/console-login/store.mjs +47 -0
  347. package/dist/app/modules/oauth2/repositories/console-login/store.mjs.map +1 -0
  348. package/dist/app/modules/oauth2/repositories/constants.d.ts +2 -0
  349. package/dist/app/modules/oauth2/repositories/constants.d.ts.map +1 -1
  350. package/dist/app/modules/oauth2/repositories/constants.mjs +2 -0
  351. package/dist/app/modules/oauth2/repositories/constants.mjs.map +1 -1
  352. package/dist/app/modules/oauth2/repositories/federated-login/index.d.ts +2 -0
  353. package/dist/app/modules/oauth2/repositories/federated-login/index.d.ts.map +1 -0
  354. package/dist/app/modules/oauth2/repositories/federated-login/index.mjs +5 -0
  355. package/dist/app/modules/oauth2/repositories/federated-login/store.d.ts +9 -0
  356. package/dist/app/modules/oauth2/repositories/federated-login/store.d.ts.map +1 -0
  357. package/dist/app/modules/oauth2/repositories/federated-login/store.mjs +33 -0
  358. package/dist/app/modules/oauth2/repositories/federated-login/store.mjs.map +1 -0
  359. package/dist/app/modules/oauth2/repositories/index.d.ts +2 -0
  360. package/dist/app/modules/oauth2/repositories/index.d.ts.map +1 -1
  361. package/dist/app/modules/oauth2/repositories/index.mjs +5 -1
  362. package/dist/app/modules/oauth2/repositories/session-token/repository.d.ts +2 -2
  363. package/dist/app/modules/oauth2/repositories/session-token/repository.d.ts.map +1 -1
  364. package/dist/app/modules/oauth2/repositories/session-token/repository.mjs +5 -3
  365. package/dist/app/modules/oauth2/repositories/session-token/repository.mjs.map +1 -1
  366. package/dist/app/modules/provisioning/module.d.ts.map +1 -1
  367. package/dist/app/modules/provisioning/module.mjs +5 -6
  368. package/dist/app/modules/provisioning/module.mjs.map +1 -1
  369. package/dist/app/modules/provisioning/sources/composite/module.d.ts.map +1 -1
  370. package/dist/app/modules/provisioning/sources/composite/module.mjs +2 -1
  371. package/dist/app/modules/provisioning/sources/composite/module.mjs.map +1 -1
  372. package/dist/app/modules/provisioning/sources/default/module.d.ts.map +1 -1
  373. package/dist/app/modules/provisioning/sources/default/module.mjs +2 -1
  374. package/dist/app/modules/provisioning/sources/default/module.mjs.map +1 -1
  375. package/dist/app/modules/runtime/module.d.ts.map +1 -1
  376. package/dist/app/modules/runtime/module.mjs +2 -1
  377. package/dist/app/modules/runtime/module.mjs.map +1 -1
  378. package/dist/app/types.d.ts +16 -0
  379. package/dist/app/types.d.ts.map +1 -1
  380. package/dist/cli/commands/config.d.ts +40 -0
  381. package/dist/cli/commands/config.d.ts.map +1 -0
  382. package/dist/cli/commands/config.mjs +65 -0
  383. package/dist/cli/commands/config.mjs.map +1 -0
  384. package/dist/cli/commands/healthcheck.d.ts +3 -2
  385. package/dist/cli/commands/healthcheck.d.ts.map +1 -1
  386. package/dist/cli/commands/healthcheck.mjs +6 -3
  387. package/dist/cli/commands/healthcheck.mjs.map +1 -1
  388. package/dist/cli/commands/index.d.ts +3 -0
  389. package/dist/cli/commands/index.d.ts.map +1 -1
  390. package/dist/cli/commands/index.mjs +3 -1
  391. package/dist/cli/commands/migration.d.ts +3 -10
  392. package/dist/cli/commands/migration.d.ts.map +1 -1
  393. package/dist/cli/commands/migration.mjs +17 -9
  394. package/dist/cli/commands/migration.mjs.map +1 -1
  395. package/dist/cli/commands/shutdown.d.ts +16 -0
  396. package/dist/cli/commands/shutdown.d.ts.map +1 -0
  397. package/dist/cli/commands/shutdown.mjs +41 -0
  398. package/dist/cli/commands/shutdown.mjs.map +1 -0
  399. package/dist/cli/commands/start.d.ts +3 -2
  400. package/dist/cli/commands/start.d.ts.map +1 -1
  401. package/dist/cli/commands/start.mjs +3 -21
  402. package/dist/cli/commands/start.mjs.map +1 -1
  403. package/dist/cli/commands/types.d.ts.map +1 -0
  404. package/dist/cli/index.d.ts +8 -0
  405. package/dist/cli/index.d.ts.map +1 -1
  406. package/dist/cli/index.mjs.map +1 -1
  407. package/dist/cli/module.d.ts +0 -2
  408. package/dist/cli/module.d.ts.map +1 -1
  409. package/dist/cli/module.mjs +4 -3
  410. package/dist/cli/module.mjs.map +1 -1
  411. package/dist/components/oauth2-cleaner/module.d.ts +2 -2
  412. package/dist/components/oauth2-cleaner/module.d.ts.map +1 -1
  413. package/dist/components/oauth2-cleaner/module.mjs +10 -7
  414. package/dist/components/oauth2-cleaner/module.mjs.map +1 -1
  415. package/dist/core/authentication/index.mjs +2 -1
  416. package/dist/core/authentication/session/constants.d.ts +10 -0
  417. package/dist/core/authentication/session/constants.d.ts.map +1 -0
  418. package/dist/core/authentication/session/constants.mjs +16 -0
  419. package/dist/core/authentication/session/constants.mjs.map +1 -0
  420. package/dist/core/authentication/session/index.d.ts +1 -0
  421. package/dist/core/authentication/session/index.d.ts.map +1 -1
  422. package/dist/core/authentication/session/index.mjs +2 -1
  423. package/dist/core/authentication/session/module.d.ts +2 -1
  424. package/dist/core/authentication/session/module.d.ts.map +1 -1
  425. package/dist/core/authentication/session/module.mjs +7 -1
  426. package/dist/core/authentication/session/module.mjs.map +1 -1
  427. package/dist/core/authentication/session/types.d.ts +70 -1
  428. package/dist/core/authentication/session/types.d.ts.map +1 -1
  429. package/dist/core/authentication/session/types.mjs.map +1 -1
  430. package/dist/core/entities/client/schema.d.ts.map +1 -1
  431. package/dist/core/entities/client/schema.mjs +1 -2
  432. package/dist/core/entities/client/schema.mjs.map +1 -1
  433. package/dist/core/entities/client/service.d.ts.map +1 -1
  434. package/dist/core/entities/client/service.mjs +15 -1
  435. package/dist/core/entities/client/service.mjs.map +1 -1
  436. package/dist/core/entities/client/system-clients.d.ts +0 -5
  437. package/dist/core/entities/client/system-clients.d.ts.map +1 -1
  438. package/dist/core/entities/client/system-clients.mjs +0 -6
  439. package/dist/core/entities/client/system-clients.mjs.map +1 -1
  440. package/dist/core/entities/client/types.d.ts +12 -0
  441. package/dist/core/entities/client/types.d.ts.map +1 -1
  442. package/dist/core/entities/client-permission/service.mjs +1 -1
  443. package/dist/core/entities/client-permission/service.mjs.map +1 -1
  444. package/dist/core/entities/event/constants.d.ts +1 -6
  445. package/dist/core/entities/event/constants.d.ts.map +1 -1
  446. package/dist/core/entities/event/constants.mjs +1 -5
  447. package/dist/core/entities/event/constants.mjs.map +1 -1
  448. package/dist/core/entities/event/entity-event-handler.d.ts.map +1 -1
  449. package/dist/core/entities/event/entity-event-handler.mjs +17 -3
  450. package/dist/core/entities/event/entity-event-handler.mjs.map +1 -1
  451. package/dist/core/entities/event/service.d.ts.map +1 -1
  452. package/dist/core/entities/event/service.mjs +3 -3
  453. package/dist/core/entities/event/service.mjs.map +1 -1
  454. package/dist/core/entities/event/types.d.ts +15 -1
  455. package/dist/core/entities/event/types.d.ts.map +1 -1
  456. package/dist/core/entities/identity-provider/types.d.ts +9 -1
  457. package/dist/core/entities/identity-provider/types.d.ts.map +1 -1
  458. package/dist/core/entities/permission/service.mjs +1 -2
  459. package/dist/core/entities/permission/service.mjs.map +1 -1
  460. package/dist/core/entities/role-permission/service.mjs +1 -1
  461. package/dist/core/entities/role-permission/service.mjs.map +1 -1
  462. package/dist/core/entities/session/service.d.ts +13 -1
  463. package/dist/core/entities/session/service.d.ts.map +1 -1
  464. package/dist/core/entities/session/service.mjs +19 -16
  465. package/dist/core/entities/session/service.mjs.map +1 -1
  466. package/dist/core/entities/user/schema.d.ts.map +1 -1
  467. package/dist/core/entities/user/schema.mjs +1 -0
  468. package/dist/core/entities/user/schema.mjs.map +1 -1
  469. package/dist/core/entities/user/service.d.ts.map +1 -1
  470. package/dist/core/entities/user/service.mjs +21 -1
  471. package/dist/core/entities/user/service.mjs.map +1 -1
  472. package/dist/core/entities/user/types.d.ts +12 -0
  473. package/dist/core/entities/user/types.d.ts.map +1 -1
  474. package/dist/core/entities/user-permission/service.mjs +1 -1
  475. package/dist/core/entities/user-permission/service.mjs.map +1 -1
  476. package/dist/core/identity/index.mjs +2 -1
  477. package/dist/core/identity/permission/junction-grant.mjs +1 -1
  478. package/dist/core/identity/permission/junction-grant.mjs.map +1 -1
  479. package/dist/core/identity/provider/account/module.mjs +2 -2
  480. package/dist/core/identity/provider/account/module.mjs.map +1 -1
  481. package/dist/core/identity/provider/authentication/index.mjs +2 -1
  482. package/dist/core/identity/provider/authentication/protocols/index.mjs +2 -1
  483. package/dist/core/identity/provider/authentication/protocols/oauth2/assurance.d.ts +46 -0
  484. package/dist/core/identity/provider/authentication/protocols/oauth2/assurance.d.ts.map +1 -0
  485. package/dist/core/identity/provider/authentication/protocols/oauth2/assurance.mjs +89 -0
  486. package/dist/core/identity/provider/authentication/protocols/oauth2/assurance.mjs.map +1 -0
  487. package/dist/core/identity/provider/authentication/protocols/oauth2/index.d.ts +1 -0
  488. package/dist/core/identity/provider/authentication/protocols/oauth2/index.d.ts.map +1 -1
  489. package/dist/core/identity/provider/authentication/protocols/oauth2/index.mjs +2 -1
  490. package/dist/core/identity/provider/authentication/protocols/oauth2/module.d.ts.map +1 -1
  491. package/dist/core/identity/provider/authentication/protocols/oauth2/module.mjs +9 -2
  492. package/dist/core/identity/provider/authentication/protocols/oauth2/module.mjs.map +1 -1
  493. package/dist/core/identity/provider/index.mjs +2 -1
  494. package/dist/core/identity/registration/service.d.ts.map +1 -1
  495. package/dist/core/identity/registration/service.mjs +2 -1
  496. package/dist/core/identity/registration/service.mjs.map +1 -1
  497. package/dist/core/index.mjs +14 -4
  498. package/dist/core/oauth2/authorization/helpers.d.ts +14 -0
  499. package/dist/core/oauth2/authorization/helpers.d.ts.map +1 -1
  500. package/dist/core/oauth2/authorization/helpers.mjs +15 -2
  501. package/dist/core/oauth2/authorization/helpers.mjs.map +1 -1
  502. package/dist/core/oauth2/authorization/index.mjs +2 -2
  503. package/dist/core/oauth2/authorization/module.d.ts.map +1 -1
  504. package/dist/core/oauth2/authorization/module.mjs +6 -4
  505. package/dist/core/oauth2/authorization/module.mjs.map +1 -1
  506. package/dist/core/oauth2/authorization/state/types.d.ts +8 -0
  507. package/dist/core/oauth2/authorization/state/types.d.ts.map +1 -1
  508. package/dist/core/oauth2/backchannel-logout/constants.d.ts +16 -0
  509. package/dist/core/oauth2/backchannel-logout/constants.d.ts.map +1 -0
  510. package/dist/core/oauth2/backchannel-logout/constants.mjs +20 -0
  511. package/dist/core/oauth2/backchannel-logout/constants.mjs.map +1 -0
  512. package/dist/core/oauth2/backchannel-logout/index.d.ts +4 -0
  513. package/dist/core/oauth2/backchannel-logout/index.d.ts.map +1 -0
  514. package/dist/core/oauth2/backchannel-logout/index.mjs +6 -0
  515. package/dist/core/oauth2/backchannel-logout/module.d.ts +26 -0
  516. package/dist/core/oauth2/backchannel-logout/module.d.ts.map +1 -0
  517. package/dist/core/oauth2/backchannel-logout/module.mjs +78 -0
  518. package/dist/core/oauth2/backchannel-logout/module.mjs.map +1 -0
  519. package/dist/core/oauth2/backchannel-logout/types.d.ts +29 -0
  520. package/dist/core/oauth2/backchannel-logout/types.d.ts.map +1 -0
  521. package/dist/core/oauth2/console-login/constants.d.ts +19 -0
  522. package/dist/core/oauth2/console-login/constants.d.ts.map +1 -0
  523. package/dist/core/oauth2/console-login/constants.mjs +24 -0
  524. package/dist/core/oauth2/console-login/constants.mjs.map +1 -0
  525. package/dist/core/oauth2/console-login/index.d.ts +3 -0
  526. package/dist/core/oauth2/console-login/index.d.ts.map +1 -0
  527. package/dist/core/oauth2/console-login/index.mjs +5 -0
  528. package/dist/core/oauth2/console-login/types.d.ts +53 -0
  529. package/dist/core/oauth2/console-login/types.d.ts.map +1 -0
  530. package/dist/core/oauth2/end-session/service.mjs +1 -1
  531. package/dist/core/oauth2/end-session/service.mjs.map +1 -1
  532. package/dist/core/oauth2/federated-login/constants.d.ts +22 -0
  533. package/dist/core/oauth2/federated-login/constants.d.ts.map +1 -0
  534. package/dist/core/oauth2/federated-login/constants.mjs +27 -0
  535. package/dist/core/oauth2/federated-login/constants.mjs.map +1 -0
  536. package/dist/core/oauth2/federated-login/index.d.ts +1 -0
  537. package/dist/core/oauth2/federated-login/index.d.ts.map +1 -1
  538. package/dist/core/oauth2/federated-login/index.mjs +2 -1
  539. package/dist/core/oauth2/federated-login/module.d.ts +12 -3
  540. package/dist/core/oauth2/federated-login/module.d.ts.map +1 -1
  541. package/dist/core/oauth2/federated-login/module.mjs +98 -42
  542. package/dist/core/oauth2/federated-login/module.mjs.map +1 -1
  543. package/dist/core/oauth2/federated-login/types.d.ts +82 -24
  544. package/dist/core/oauth2/federated-login/types.d.ts.map +1 -1
  545. package/dist/core/oauth2/federated-login/types.mjs +5 -0
  546. package/dist/core/oauth2/federated-login/types.mjs.map +1 -1
  547. package/dist/core/oauth2/grant-types/authorize.mjs +1 -1
  548. package/dist/core/oauth2/grant-types/client-credentials.mjs +1 -1
  549. package/dist/core/oauth2/grant-types/identity.mjs +1 -1
  550. package/dist/core/oauth2/grant-types/password.mjs +1 -1
  551. package/dist/core/oauth2/grant-types/refresh-token.mjs +1 -1
  552. package/dist/core/oauth2/index.d.ts +4 -0
  553. package/dist/core/oauth2/index.d.ts.map +1 -1
  554. package/dist/core/oauth2/index.mjs +15 -4
  555. package/dist/core/oauth2/introspection/index.d.ts +3 -0
  556. package/dist/core/oauth2/introspection/index.d.ts.map +1 -0
  557. package/dist/core/oauth2/introspection/index.mjs +5 -0
  558. package/dist/core/oauth2/introspection/module.d.ts +14 -0
  559. package/dist/core/oauth2/introspection/module.d.ts.map +1 -0
  560. package/dist/core/oauth2/introspection/module.mjs +49 -0
  561. package/dist/core/oauth2/introspection/module.mjs.map +1 -0
  562. package/dist/core/oauth2/introspection/types.d.ts +45 -0
  563. package/dist/core/oauth2/introspection/types.d.ts.map +1 -0
  564. package/dist/core/oauth2/introspection/types.mjs +4 -0
  565. package/dist/core/oauth2/openid/claims.d.ts +20 -2
  566. package/dist/core/oauth2/openid/claims.d.ts.map +1 -1
  567. package/dist/core/oauth2/openid/claims.mjs +18 -4
  568. package/dist/core/oauth2/openid/claims.mjs.map +1 -1
  569. package/dist/core/oauth2/session-credential/constants.d.ts +30 -0
  570. package/dist/core/oauth2/session-credential/constants.d.ts.map +1 -0
  571. package/dist/core/oauth2/session-credential/constants.mjs +34 -0
  572. package/dist/core/oauth2/session-credential/constants.mjs.map +1 -0
  573. package/dist/core/oauth2/session-credential/index.d.ts +3 -0
  574. package/dist/core/oauth2/session-credential/index.d.ts.map +1 -0
  575. package/dist/core/oauth2/session-credential/index.mjs +6 -0
  576. package/dist/core/oauth2/session-credential/module.d.ts +31 -0
  577. package/dist/core/oauth2/session-credential/module.d.ts.map +1 -0
  578. package/dist/core/oauth2/session-credential/module.mjs +43 -0
  579. package/dist/core/oauth2/session-credential/module.mjs.map +1 -0
  580. package/dist/core/oauth2/session-token/constants.d.ts +10 -0
  581. package/dist/core/oauth2/session-token/constants.d.ts.map +1 -0
  582. package/dist/core/oauth2/session-token/constants.mjs +16 -0
  583. package/dist/core/oauth2/session-token/constants.mjs.map +1 -0
  584. package/dist/core/oauth2/session-token/index.d.ts +1 -0
  585. package/dist/core/oauth2/session-token/index.d.ts.map +1 -1
  586. package/dist/core/oauth2/session-token/index.mjs +2 -1
  587. package/dist/core/oauth2/session-token/types.d.ts +13 -2
  588. package/dist/core/oauth2/session-token/types.d.ts.map +1 -1
  589. package/dist/core/oauth2/token/verifier/module.d.ts.map +1 -1
  590. package/dist/core/oauth2/token/verifier/module.mjs +3 -3
  591. package/dist/core/oauth2/token/verifier/module.mjs.map +1 -1
  592. package/dist/core/provisioning/merge/module.mjs +5 -3
  593. package/dist/core/provisioning/merge/module.mjs.map +1 -1
  594. package/dist/core/query/module.mjs +1 -1
  595. package/dist/core/query/module.mjs.map +1 -1
  596. package/dist/core/security/policy/evaluator.mjs +1 -1
  597. package/dist/core/security/policy/evaluator.mjs.map +1 -1
  598. package/dist/index.mjs +62 -59
  599. package/dist/path.mjs +1 -1
  600. package/dist/swagger.json +573 -163
  601. package/dist/utils/error.d.ts +6 -0
  602. package/dist/utils/error.d.ts.map +1 -1
  603. package/dist/utils/error.mjs +6 -2
  604. package/dist/utils/error.mjs.map +1 -1
  605. package/dist/utils/index.mjs +2 -2
  606. package/package.json +32 -26
  607. package/dist/adapters/http/middleware/built-in/assets.d.ts +0 -11
  608. package/dist/adapters/http/middleware/built-in/assets.d.ts.map +0 -1
  609. package/dist/adapters/http/middleware/built-in/assets.mjs +0 -91
  610. package/dist/adapters/http/middleware/built-in/assets.mjs.map +0 -1
  611. package/dist/adapters/http/middleware/built-in/theme.d.ts +0 -15
  612. package/dist/adapters/http/middleware/built-in/theme.d.ts.map +0 -1
  613. package/dist/adapters/http/middleware/built-in/theme.mjs +0 -27
  614. package/dist/adapters/http/middleware/built-in/theme.mjs.map +0 -1
  615. package/dist/adapters/http/middleware/built-in/types.d.ts +0 -14
  616. package/dist/adapters/http/middleware/built-in/types.d.ts.map +0 -1
  617. package/dist/adapters/http/middleware/built-in/ui-http-client.d.ts +0 -15
  618. package/dist/adapters/http/middleware/built-in/ui-http-client.d.ts.map +0 -1
  619. package/dist/adapters/http/middleware/built-in/ui-http-client.mjs +0 -25
  620. package/dist/adapters/http/middleware/built-in/ui-http-client.mjs.map +0 -1
  621. package/dist/adapters/http/request/helpers/redirect.d.ts +0 -14
  622. package/dist/adapters/http/request/helpers/redirect.d.ts.map +0 -1
  623. package/dist/adapters/http/request/helpers/redirect.mjs +0 -36
  624. package/dist/adapters/http/request/helpers/redirect.mjs.map +0 -1
  625. package/dist/adapters/http/ui/account-console/index.d.ts +0 -4
  626. package/dist/adapters/http/ui/account-console/index.d.ts.map +0 -1
  627. package/dist/adapters/http/ui/account-console/index.mjs +0 -6
  628. package/dist/adapters/http/ui/account-console/module.d.ts +0 -28
  629. package/dist/adapters/http/ui/account-console/module.d.ts.map +0 -1
  630. package/dist/adapters/http/ui/account-console/module.mjs +0 -80
  631. package/dist/adapters/http/ui/account-console/module.mjs.map +0 -1
  632. package/dist/adapters/http/ui/account-console/ref.d.ts +0 -30
  633. package/dist/adapters/http/ui/account-console/ref.d.ts.map +0 -1
  634. package/dist/adapters/http/ui/account-console/ref.mjs +0 -50
  635. package/dist/adapters/http/ui/account-console/ref.mjs.map +0 -1
  636. package/dist/adapters/http/ui/account-console/types.d.ts +0 -11
  637. package/dist/adapters/http/ui/account-console/types.d.ts.map +0 -1
  638. package/dist/adapters/http/ui/auth-console/http-client.d.ts +0 -22
  639. package/dist/adapters/http/ui/auth-console/http-client.d.ts.map +0 -1
  640. package/dist/adapters/http/ui/auth-console/http-client.mjs.map +0 -1
  641. package/dist/adapters/http/ui/auth-console/index.d.ts +0 -6
  642. package/dist/adapters/http/ui/auth-console/index.d.ts.map +0 -1
  643. package/dist/adapters/http/ui/auth-console/index.mjs +0 -8
  644. package/dist/adapters/http/ui/auth-console/module.d.ts +0 -4
  645. package/dist/adapters/http/ui/auth-console/module.d.ts.map +0 -1
  646. package/dist/adapters/http/ui/auth-console/module.mjs +0 -73
  647. package/dist/adapters/http/ui/auth-console/module.mjs.map +0 -1
  648. package/dist/adapters/http/ui/auth-console/resolve.d.ts +0 -21
  649. package/dist/adapters/http/ui/auth-console/resolve.d.ts.map +0 -1
  650. package/dist/adapters/http/ui/auth-console/resolve.mjs +0 -53
  651. package/dist/adapters/http/ui/auth-console/resolve.mjs.map +0 -1
  652. package/dist/adapters/http/ui/auth-console/serve.d.ts +0 -9
  653. package/dist/adapters/http/ui/auth-console/serve.d.ts.map +0 -1
  654. package/dist/adapters/http/ui/auth-console/serve.mjs +0 -35
  655. package/dist/adapters/http/ui/auth-console/serve.mjs.map +0 -1
  656. package/dist/adapters/http/ui/auth-console/types.d.ts +0 -26
  657. package/dist/adapters/http/ui/auth-console/types.d.ts.map +0 -1
  658. package/dist/adapters/http/ui/console-packages/index.d.ts.map +0 -1
  659. package/dist/adapters/http/ui/console-packages/index.mjs +0 -5
  660. package/dist/adapters/http/ui/console-packages/module.d.ts +0 -33
  661. package/dist/adapters/http/ui/console-packages/module.d.ts.map +0 -1
  662. package/dist/adapters/http/ui/console-packages/module.mjs +0 -70
  663. package/dist/adapters/http/ui/console-packages/module.mjs.map +0 -1
  664. package/dist/adapters/http/ui/console-packages/types.d.ts +0 -12
  665. package/dist/adapters/http/ui/console-packages/types.d.ts.map +0 -1
  666. package/dist/adapters/http/ui/index.d.ts +0 -6
  667. package/dist/adapters/http/ui/index.d.ts.map +0 -1
  668. package/dist/adapters/http/ui/index.mjs +0 -25
  669. package/dist/adapters/http/ui/shared/html.d.ts +0 -76
  670. package/dist/adapters/http/ui/shared/html.d.ts.map +0 -1
  671. package/dist/adapters/http/ui/shared/html.mjs +0 -104
  672. package/dist/adapters/http/ui/shared/html.mjs.map +0 -1
  673. package/dist/adapters/http/ui/shared/index.d.ts +0 -2
  674. package/dist/adapters/http/ui/shared/index.d.ts.map +0 -1
  675. package/dist/adapters/http/ui/shared/index.mjs +0 -5
  676. package/dist/adapters/http/ui/theme/apply.d.ts +0 -12
  677. package/dist/adapters/http/ui/theme/apply.d.ts.map +0 -1
  678. package/dist/adapters/http/ui/theme/apply.mjs +0 -29
  679. package/dist/adapters/http/ui/theme/apply.mjs.map +0 -1
  680. package/dist/adapters/http/ui/theme/assets.d.ts +0 -20
  681. package/dist/adapters/http/ui/theme/assets.d.ts.map +0 -1
  682. package/dist/adapters/http/ui/theme/assets.mjs +0 -86
  683. package/dist/adapters/http/ui/theme/assets.mjs.map +0 -1
  684. package/dist/adapters/http/ui/theme/constants.d.ts +0 -16
  685. package/dist/adapters/http/ui/theme/constants.d.ts.map +0 -1
  686. package/dist/adapters/http/ui/theme/constants.mjs +0 -20
  687. package/dist/adapters/http/ui/theme/constants.mjs.map +0 -1
  688. package/dist/adapters/http/ui/theme/contract/constants.d.ts +0 -120
  689. package/dist/adapters/http/ui/theme/contract/constants.d.ts.map +0 -1
  690. package/dist/adapters/http/ui/theme/contract/constants.mjs +0 -136
  691. package/dist/adapters/http/ui/theme/contract/constants.mjs.map +0 -1
  692. package/dist/adapters/http/ui/theme/contract/head.d.ts +0 -12
  693. package/dist/adapters/http/ui/theme/contract/head.d.ts.map +0 -1
  694. package/dist/adapters/http/ui/theme/contract/head.mjs +0 -61
  695. package/dist/adapters/http/ui/theme/contract/head.mjs.map +0 -1
  696. package/dist/adapters/http/ui/theme/contract/index.d.ts +0 -6
  697. package/dist/adapters/http/ui/theme/contract/index.d.ts.map +0 -1
  698. package/dist/adapters/http/ui/theme/contract/index.mjs +0 -8
  699. package/dist/adapters/http/ui/theme/contract/manifest.d.ts +0 -25
  700. package/dist/adapters/http/ui/theme/contract/manifest.d.ts.map +0 -1
  701. package/dist/adapters/http/ui/theme/contract/manifest.mjs +0 -77
  702. package/dist/adapters/http/ui/theme/contract/manifest.mjs.map +0 -1
  703. package/dist/adapters/http/ui/theme/contract/types.d.ts +0 -26
  704. package/dist/adapters/http/ui/theme/contract/types.d.ts.map +0 -1
  705. package/dist/adapters/http/ui/theme/contract/utils.d.ts +0 -11
  706. package/dist/adapters/http/ui/theme/contract/utils.d.ts.map +0 -1
  707. package/dist/adapters/http/ui/theme/contract/utils.mjs +0 -22
  708. package/dist/adapters/http/ui/theme/contract/utils.mjs.map +0 -1
  709. package/dist/adapters/http/ui/theme/index.d.ts +0 -7
  710. package/dist/adapters/http/ui/theme/index.d.ts.map +0 -1
  711. package/dist/adapters/http/ui/theme/index.mjs +0 -13
  712. package/dist/adapters/http/ui/theme/module.d.ts +0 -79
  713. package/dist/adapters/http/ui/theme/module.d.ts.map +0 -1
  714. package/dist/adapters/http/ui/theme/module.mjs +0 -206
  715. package/dist/adapters/http/ui/theme/module.mjs.map +0 -1
  716. package/dist/adapters/http/ui/theme/types.d.ts +0 -42
  717. package/dist/adapters/http/ui/theme/types.d.ts.map +0 -1
  718. package/dist/app/modules/config/helpers.d.ts +0 -9
  719. package/dist/app/modules/config/helpers.d.ts.map +0 -1
  720. package/dist/app/modules/config/helpers.mjs +0 -22
  721. package/dist/app/modules/config/helpers.mjs.map +0 -1
  722. package/dist/app/modules/config/normalize.d.ts +0 -3
  723. package/dist/app/modules/config/normalize.d.ts.map +0 -1
  724. package/dist/app/modules/config/normalize.mjs +0 -117
  725. package/dist/app/modules/config/normalize.mjs.map +0 -1
  726. package/dist/app/modules/config/origins.d.ts +0 -25
  727. package/dist/app/modules/config/origins.d.ts.map +0 -1
  728. package/dist/app/modules/config/origins.mjs +0 -46
  729. package/dist/app/modules/config/origins.mjs.map +0 -1
  730. package/dist/app/modules/config/read/env.d.ts +0 -3
  731. package/dist/app/modules/config/read/env.d.ts.map +0 -1
  732. package/dist/app/modules/config/read/env.mjs +0 -139
  733. package/dist/app/modules/config/read/env.mjs.map +0 -1
  734. package/dist/app/modules/config/read/fs.d.ts +0 -3
  735. package/dist/app/modules/config/read/fs.d.ts.map +0 -1
  736. package/dist/app/modules/config/read/fs.mjs +0 -60
  737. package/dist/app/modules/config/read/fs.mjs.map +0 -1
  738. package/dist/app/modules/config/read/index.d.ts +0 -5
  739. package/dist/app/modules/config/read/index.d.ts.map +0 -1
  740. package/dist/app/modules/config/read/index.mjs +0 -7
  741. package/dist/app/modules/config/read/module.d.ts +0 -4
  742. package/dist/app/modules/config/read/module.d.ts.map +0 -1
  743. package/dist/app/modules/config/read/module.mjs +0 -29
  744. package/dist/app/modules/config/read/module.mjs.map +0 -1
  745. package/dist/app/modules/config/read/types.d.ts +0 -9
  746. package/dist/app/modules/config/read/types.d.ts.map +0 -1
  747. package/dist/app/modules/config/trust-proxy.d.ts +0 -28
  748. package/dist/app/modules/config/trust-proxy.d.ts.map +0 -1
  749. package/dist/app/modules/config/trust-proxy.mjs +0 -64
  750. package/dist/app/modules/config/trust-proxy.mjs.map +0 -1
  751. package/dist/cli/config.d.ts +0 -18
  752. package/dist/cli/config.d.ts.map +0 -1
  753. package/dist/cli/config.mjs +0 -34
  754. package/dist/cli/config.mjs.map +0 -1
  755. package/dist/cli/types.d.ts.map +0 -1
  756. package/dist/utils/host.d.ts +0 -2
  757. package/dist/utils/host.d.ts.map +0 -1
  758. package/dist/utils/host.mjs +0 -12
  759. package/dist/utils/host.mjs.map +0 -1
  760. /package/dist/adapters/http/{middleware/built-in → controllers/workflows/account}/types.mjs +0 -0
  761. /package/dist/adapters/http/{ui/console-packages → controllers/workflows/admin}/index.d.ts +0 -0
  762. /package/dist/adapters/http/{ui/account-console → controllers/workflows/admin}/types.mjs +0 -0
  763. /package/dist/adapters/http/{ui/auth-console → controllers/workflows/console-login}/types.mjs +0 -0
  764. /package/dist/adapters/http/{ui/console-packages → internal-client}/types.mjs +0 -0
  765. /package/dist/{adapters/http/ui/theme/contract → app/modules/components}/types.mjs +0 -0
  766. /package/dist/cli/{types.d.ts → commands/types.d.ts} +0 -0
  767. /package/dist/{adapters/http/ui/theme → cli/commands}/types.mjs +0 -0
  768. /package/dist/{app/modules/config/read → core/oauth2/backchannel-logout}/types.mjs +0 -0
  769. /package/dist/{cli → core/oauth2/console-login}/types.mjs +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"module.mjs","names":["OAuth2Authorization","OAuth2AuthorizationCodeRequestValidator","readFromLocations","useRequestIdentityOrFail","useRequestSessionId","HTTPOAuth2Authorizer","codeRequestVerifier","requestValidator","consentService","logger","ctx","authorizeWithRequest","event","codeRequestValidated","validateWithRequest","data","client","redirectUriVerified","verify","identity","result","authorize","raw","sessionId","builtIn","record","clientId","id","realmId","owner","sub","subKind","type","scope","e","warn","error","run"],"sources":["../../../../../../src/adapters/http/adapters/oauth2/authorization/module.ts"],"sourcesContent":["/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { IAppEvent } from 'routup';\nimport type { Logger } from '@authup/server-kit';\nimport type { OAuth2AuthorizationCodeRequest } from '@authup/core-kit';\nimport type { IConsentService, IOAuth2AuthorizationCodeRequestVerifier, OAuth2AuthorizationResult } from '../../../../../core/index.ts';\nimport { OAuth2Authorization, OAuth2AuthorizationCodeRequestValidator } from '../../../../../core/index.ts';\nimport { readFromLocations, useRequestIdentityOrFail, useRequestSessionId } from '../../../request/index.ts';\nimport type { HTTPOAuth2AuthorizationManagerContext } from './types.ts';\n\nexport class HTTPOAuth2Authorizer extends OAuth2Authorization {\n protected codeRequestVerifier : IOAuth2AuthorizationCodeRequestVerifier;\n\n protected requestValidator : OAuth2AuthorizationCodeRequestValidator;\n\n protected consentService? : IConsentService;\n\n protected logger? : Logger;\n\n constructor(ctx: HTTPOAuth2AuthorizationManagerContext) {\n super(ctx);\n\n this.codeRequestVerifier = ctx.codeRequestVerifier;\n this.consentService = ctx.consentService;\n this.logger = ctx.logger;\n\n this.requestValidator = new OAuth2AuthorizationCodeRequestValidator();\n }\n\n async authorizeWithRequest(event: IAppEvent) : Promise<OAuth2AuthorizationResult> {\n const codeRequestValidated = await this.validateWithRequest(event);\n\n const {\n data,\n client,\n redirectUriVerified,\n } = await this.codeRequestVerifier.verify(codeRequestValidated);\n\n const identity = useRequestIdentityOrFail(event);\n\n const result = await this.authorize(data, identity.raw, {\n sessionId: useRequestSessionId(event),\n client,\n redirectUriVerified,\n });\n\n // Persisted per-scope consent (plan 055): recorded only after a\n // successful approval — an access-policy denial throws inside\n // authorize() above, so a denied identity never writes a row.\n // built_in clients keep zero rows (locked); insert-missing makes\n // re-recording idempotent (union/keep).\n if (this.consentService && client && !client.builtIn) {\n try {\n await this.consentService.record({\n clientId: client.id,\n realmId: client.realmId,\n owner: {\n sub: identity.raw.data.id,\n subKind: identity.raw.type,\n },\n scope: data.scope ?? null,\n });\n } catch (e) {\n // never fail an issued code over a consent-write failure\n this.logger?.warn('Recording the OAuth2 consent grant failed.', {\n clientId: client.id,\n error: e,\n });\n }\n }\n\n return result;\n }\n\n /**\n * Validate authorization request.\n *\n * @throws OAuth2Error\n */\n async validateWithRequest(\n event: IAppEvent,\n ) : Promise<OAuth2AuthorizationCodeRequest> {\n const data = await readFromLocations(event, ['body', 'query']);\n return this.requestValidator.run(data);\n }\n}\n"],"mappings":";;;;;;;;;;;AAeA,IAAaK,uBAAb,cAA0CL,oBAAAA;CAC5BM;CAEAC;CAEAC;CAEAC;CAEV,YAAYC,KAA4C;EACpD,MAAMA,GAAAA;EAEN,KAAKJ,sBAAsBI,IAAIJ;EAC/B,KAAKE,iBAAiBE,IAAIF;EAC1B,KAAKC,SAASC,IAAID;EAElB,KAAKF,mBAAmB,IAAIN,wCAAAA;CAChC;CAEA,MAAMU,qBAAqBC,OAAuD;EAC9E,MAAMC,uBAAuB,MAAM,KAAKC,oBAAoBF,KAAAA;EAE5D,MAAM,EACFG,MACAC,QACAC,wBACA,MAAM,KAAKX,oBAAoBY,OAAOL,oBAAAA;EAE1C,MAAMM,WAAWhB,yBAAyBS,KAAAA;EAE1C,MAAMQ,SAAS,MAAM,KAAKC,UAAUN,MAAMI,SAASG,KAAK;GACpDC,WAAWnB,oBAAoBQ,KAAAA;GAC/BI;GACAC;EACJ,CAAA;EAOA,IAAI,KAAKT,kBAAkBQ,UAAU,CAACA,OAAOQ,SACzC,IAAI;GACA,MAAM,KAAKhB,eAAeiB,OAAO;IAC7BC,UAAUV,OAAOW;IACjBC,SAASZ,OAAOY;IAChBC,OAAO;KACHC,KAAKX,SAASG,IAAIP,KAAKY;KACvBI,SAASZ,SAASG,IAAIU;IAC1B;IACAC,OAAOlB,KAAKkB,SAAS;GACzB,CAAA;EACJ,SAASC,GAAG;GAER,KAAKzB,QAAQ0B,KAAK,8CAA8C;IAC5DT,UAAUV,OAAOW;IACjBS,OAAOF;GACX,CAAA;EACJ;EAGJ,OAAOd;CACX;;;;;IAOA,MAAMN,oBACFF,OACwC;EACxC,MAAMG,OAAO,MAAMb,kBAAkBU,OAAO,CAAC,QAAQ,OAAQ,CAAA;EAC7D,OAAO,KAAKL,iBAAiB8B,IAAItB,IAAAA;CACrC;AACJ"}
1
+ {"version":3,"file":"module.mjs","names":["OAuth2Authorization","OAuth2AuthorizationCodeRequestValidator","readFromLocations","useRequestIdentityOrFail","useRequestSessionId","HTTPOAuth2Authorizer","codeRequestVerifier","requestValidator","consentService","logger","ctx","authorizeWithRequest","event","codeRequestValidated","validateWithRequest","data","client","redirectUriVerified","verify","identity","result","authorize","raw","sessionId","builtIn","record","clientId","id","realmId","owner","sub","subKind","type","scope","e","warn","error","run"],"sources":["../../../../../../src/adapters/http/adapters/oauth2/authorization/module.ts"],"sourcesContent":["/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { IAppEvent } from 'routup';\nimport type { Logger } from '@authup/server-kit';\nimport type { OAuth2AuthorizationCodeRequest } from '@authup/core-kit';\nimport type { IConsentService, IOAuth2AuthorizationCodeRequestVerifier, OAuth2AuthorizationResult } from '../../../../../core/index.ts';\nimport { OAuth2Authorization, OAuth2AuthorizationCodeRequestValidator } from '../../../../../core/index.ts';\nimport { readFromLocations, useRequestIdentityOrFail, useRequestSessionId } from '../../../request/index.ts';\nimport type { HTTPOAuth2AuthorizationManagerContext } from './types.ts';\n\nexport class HTTPOAuth2Authorizer extends OAuth2Authorization {\n protected codeRequestVerifier : IOAuth2AuthorizationCodeRequestVerifier;\n\n protected requestValidator : OAuth2AuthorizationCodeRequestValidator;\n\n protected consentService? : IConsentService;\n\n protected logger? : Logger;\n\n constructor(ctx: HTTPOAuth2AuthorizationManagerContext) {\n super(ctx);\n\n this.codeRequestVerifier = ctx.codeRequestVerifier;\n this.consentService = ctx.consentService;\n this.logger = ctx.logger;\n\n this.requestValidator = new OAuth2AuthorizationCodeRequestValidator();\n }\n\n async authorizeWithRequest(event: IAppEvent) : Promise<OAuth2AuthorizationResult> {\n const codeRequestValidated = await this.validateWithRequest(event);\n\n const {\n data,\n client,\n redirectUriVerified,\n } = await this.codeRequestVerifier.verify(codeRequestValidated);\n\n const identity = useRequestIdentityOrFail(event);\n\n const result = await this.authorize(data, identity.raw, {\n sessionId: useRequestSessionId(event),\n client,\n redirectUriVerified,\n });\n\n // Persisted per-scope consent (plan 055): recorded only after a\n // successful approval — an access-policy denial throws inside\n // authorize() above, so a denied identity never writes a row.\n // built_in clients keep zero rows (locked); insert-missing makes\n // re-recording idempotent (union/keep).\n if (client && this.consentService && !client.builtIn) {\n try {\n await this.consentService.record({\n clientId: client.id,\n realmId: client.realmId,\n owner: {\n sub: identity.raw.data.id,\n subKind: identity.raw.type,\n },\n scope: data.scope ?? null,\n });\n } catch (e) {\n // never fail an issued code over a consent-write failure\n this.logger?.warn('Recording the OAuth2 consent grant failed.', {\n clientId: client.id,\n error: e,\n });\n }\n }\n\n return result;\n }\n\n /**\n * Validate authorization request.\n *\n * @throws OAuth2Error\n */\n async validateWithRequest(\n event: IAppEvent,\n ) : Promise<OAuth2AuthorizationCodeRequest> {\n const data = await readFromLocations(event, ['body', 'query']);\n return this.requestValidator.run(data);\n }\n}\n"],"mappings":";;;;;;;;;;;AAeA,IAAaK,uBAAb,cAA0CL,oBAAAA;CAC5BM;CAEAC;CAEAC;CAEAC;CAEV,YAAYC,KAA4C;EACpD,MAAMA,GAAAA;EAEN,KAAKJ,sBAAsBI,IAAIJ;EAC/B,KAAKE,iBAAiBE,IAAIF;EAC1B,KAAKC,SAASC,IAAID;EAElB,KAAKF,mBAAmB,IAAIN,wCAAAA;CAChC;CAEA,MAAMU,qBAAqBC,OAAuD;EAC9E,MAAMC,uBAAuB,MAAM,KAAKC,oBAAoBF,KAAAA;EAE5D,MAAM,EACFG,MACAC,QACAC,wBACA,MAAM,KAAKX,oBAAoBY,OAAOL,oBAAAA;EAE1C,MAAMM,WAAWhB,yBAAyBS,KAAAA;EAE1C,MAAMQ,SAAS,MAAM,KAAKC,UAAUN,MAAMI,SAASG,KAAK;GACpDC,WAAWnB,oBAAoBQ,KAAAA;GAC/BI;GACAC;EACJ,CAAA;EAOA,IAAID,UAAU,KAAKR,kBAAkB,CAACQ,OAAOQ,SACzC,IAAI;GACA,MAAM,KAAKhB,eAAeiB,OAAO;IAC7BC,UAAUV,OAAOW;IACjBC,SAASZ,OAAOY;IAChBC,OAAO;KACHC,KAAKX,SAASG,IAAIP,KAAKY;KACvBI,SAASZ,SAASG,IAAIU;IAC1B;IACAC,OAAOlB,KAAKkB,SAAS;GACzB,CAAA;EACJ,SAASC,GAAG;GAER,KAAKzB,QAAQ0B,KAAK,8CAA8C;IAC5DT,UAAUV,OAAOW;IACjBS,OAAOF;GACX,CAAA;EACJ;EAGJ,OAAOd;CACX;;;;;IAOA,MAAMN,oBACFF,OACwC;EACxC,MAAMG,OAAO,MAAMb,kBAAkBU,OAAO,CAAC,QAAQ,OAAQ,CAAA;EAC7D,OAAO,KAAKL,iBAAiB8B,IAAItB,IAAAA;CACrC;AACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"refresh_token.d.ts","sourceRoot":"","sources":["../../../../../../src/adapters/http/adapters/oauth2/grant-types/refresh_token.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAA2B,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAGvF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAExC,OAAO,EAAE,uBAAuB,EAA4B,MAAM,8BAA8B,CAAC;AACjG,OAAO,KAAK,EACR,oBAAoB,EACpB,gBAAgB,EAChB,yBAAyB,EAC5B,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,kCAAkC,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACvF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAOnE,qBAAa,2BAA4B,SAAQ,uBAAwB,YAAW,gBAAgB;IAChG,SAAS,CAAC,mBAAmB,EAAG,yBAAyB,CAAC;IAE1D,SAAS,CAAC,oBAAoB,EAAG,oBAAoB,CAAC;IAEtD,SAAS,CAAC,eAAe,EAAG,gBAAgB,CAAC;IAE7C,SAAS,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;gBAEnC,GAAG,EAAE,kCAAkC;IAS7C,cAAc,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,wBAAwB,CAAC;CAqG5E"}
1
+ {"version":3,"file":"refresh_token.d.ts","sourceRoot":"","sources":["../../../../../../src/adapters/http/adapters/oauth2/grant-types/refresh_token.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAA2B,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAQvF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAExC,OAAO,EAAE,uBAAuB,EAA4B,MAAM,8BAA8B,CAAC;AACjG,OAAO,KAAK,EACR,oBAAoB,EACpB,gBAAgB,EAChB,yBAAyB,EAC5B,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,kCAAkC,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACvF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAOnE,qBAAa,2BAA4B,SAAQ,uBAAwB,YAAW,gBAAgB;IAChG,SAAS,CAAC,mBAAmB,EAAG,yBAAyB,CAAC;IAE1D,SAAS,CAAC,oBAAoB,EAAG,oBAAoB,CAAC;IAEtD,SAAS,CAAC,eAAe,EAAG,gBAAgB,CAAC;IAE7C,SAAS,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;gBAEnC,GAAG,EAAE,kCAAkC;IAS7C,cAAc,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,wBAAwB,CAAC;CAqH5E"}
@@ -9,7 +9,7 @@ import { extractClientCredentialsFromRequest } from "./utils/credentials.mjs";
9
9
  import { readRealmHint } from "./utils/realm.mjs";
10
10
  import "./utils/index.mjs";
11
11
  import { isClientPublic } from "@authup/core-kit";
12
- import { OAuth2GrantError, OAuth2RequestError, OAuth2TokenGrant } from "@authup/specs";
12
+ import { OAuth2GrantError, OAuth2RequestError, OAuth2TokenGrant, isJWTError } from "@authup/specs";
13
13
  import { getRequestHeader, getRequestIP } from "routup";
14
14
  import { readRequestBody } from "@routup/basic/body";
15
15
  //#region src/adapters/http/adapters/oauth2/grant-types/refresh_token.ts
@@ -31,7 +31,13 @@ var HTTPOAuth2RefreshTokenGrant = class extends OAuth2RefreshTokenGrant {
31
31
  if (typeof refreshToken !== "string" || refreshToken.length === 0) throw OAuth2RequestError.malformed();
32
32
  const { clientId, clientSecret } = await extractClientCredentialsFromRequest(event);
33
33
  const certificateEvidence = await extractOAuth2ClientCertificateEvidence(event, this.certificateSource);
34
- const payload = await this.refreshTokenVerifier.verify(refreshToken, { skipActiveCheck: true });
34
+ let payload;
35
+ try {
36
+ payload = await this.refreshTokenVerifier.verify(refreshToken, { skipActiveCheck: true });
37
+ } catch (e) {
38
+ if (isJWTError(e)) throw OAuth2GrantError.invalid();
39
+ throw e;
40
+ }
35
41
  let client;
36
42
  if (clientId) {
37
43
  const realm = await this.realmRepository.resolve(readRealmHint(body), true);
@@ -1 +1 @@
1
- {"version":3,"file":"refresh_token.mjs","names":["isClientPublic","OAuth2GrantError","OAuth2RequestError","OAuth2TokenGrant","readRequestBody","getRequestHeader","getRequestIP","OAuth2RefreshTokenGrant","assertClientGrantAllowed","extractClientCredentialsFromRequest","extractOAuth2ClientCertificateEvidence","readRealmHint","HTTPOAuth2RefreshTokenGrant","clientAuthenticator","refreshTokenVerifier","realmRepository","certificateSource","ctx","tokenVerifier","runWithRequest","event","body","refreshToken","refresh_token","length","malformed","clientId","clientSecret","certificateEvidence","payload","verify","skipActiveCheck","client","realm","resolve","authenticate","id","client_id","invalid","undefined","REFRESH_TOKEN","confirmation","cnf","expectedThumbprint","validateCertificateEvidenceForBinding","resolveTokenBinding","realm_id","realmId","runWith","ipAddress","userAgent"],"sources":["../../../../../../src/adapters/http/adapters/oauth2/grant-types/refresh_token.ts"],"sourcesContent":["/*\n * Copyright (c) 2025-2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { type Client, isClientPublic } from '@authup/core-kit';\nimport type { OAuth2TokenConfirmation, OAuth2TokenGrantResponse } from '@authup/specs';\nimport { OAuth2GrantError, OAuth2RequestError, OAuth2TokenGrant } from '@authup/specs';\nimport { readRequestBody } from '@routup/basic/body';\nimport type { IAppEvent } from 'routup';\nimport { getRequestHeader, getRequestIP } from 'routup';\nimport { OAuth2RefreshTokenGrant, assertClientGrantAllowed } from '../../../../../core/index.ts';\nimport type {\n IOAuth2TokenVerifier,\n IRealmRepository,\n OAuth2ClientAuthenticator,\n} from '../../../../../core/index.ts';\nimport type { HTTPOAuth2RefreshTokenGrantContext, IHTTPOAuth2Grant } from './types.ts';\nimport type { CertificateSource } from '../../../request/index.ts';\nimport {\n extractClientCredentialsFromRequest,\n extractOAuth2ClientCertificateEvidence,\n readRealmHint,\n} from './utils/index.ts';\n\nexport class HTTPOAuth2RefreshTokenGrant extends OAuth2RefreshTokenGrant implements IHTTPOAuth2Grant {\n protected clientAuthenticator : OAuth2ClientAuthenticator;\n\n protected refreshTokenVerifier : IOAuth2TokenVerifier;\n\n protected realmRepository : IRealmRepository;\n\n protected certificateSource: CertificateSource;\n\n constructor(ctx: HTTPOAuth2RefreshTokenGrantContext) {\n super(ctx);\n\n this.clientAuthenticator = ctx.clientAuthenticator;\n this.refreshTokenVerifier = ctx.tokenVerifier;\n this.realmRepository = ctx.realmRepository;\n this.certificateSource = ctx.certificateSource ?? 'disabled';\n }\n\n async runWithRequest(event: IAppEvent): Promise<OAuth2TokenGrantResponse> {\n const body = await readRequestBody(event);\n const refreshToken = body?.refresh_token;\n if (typeof refreshToken !== 'string' || refreshToken.length === 0) {\n throw OAuth2RequestError.malformed();\n }\n\n const { clientId, clientSecret } = await extractClientCredentialsFromRequest(event);\n const certificateEvidence = await extractOAuth2ClientCertificateEvidence(event, this.certificateSource);\n\n // RFC 6749 §6: verify the refresh token first to learn its bound\n // client (if any), then enforce binding. Authenticate the requesting\n // client when credentials are present, or when the token requires\n // a client binding.\n //\n // skipActiveCheck: the durable auth_session_tokens row (not the cache\n // blocklist) is the refresh-token authority, so a replayed/consumed\n // token must reach runWith() to trigger family revocation instead of\n // being rejected here with JWT_INACTIVE.\n const payload = await this.refreshTokenVerifier.verify(refreshToken, { skipActiveCheck: true });\n\n let client: Client | undefined;\n\n if (clientId) {\n // A client authenticated itself. Resolve by the presented\n // id/secret (name resolution scoped by the realm hint — resolved\n // lazily so a bare refresh skips the SELECT) and enforce the\n // token↔client binding.\n const realm = await this.realmRepository.resolve(readRealmHint(body), true);\n\n client = await this.clientAuthenticator.authenticate(\n clientId,\n clientSecret,\n realm.id,\n certificateEvidence,\n );\n\n if (payload.client_id && payload.client_id !== client.id) {\n throw OAuth2GrantError.invalid();\n }\n } else if (payload.client_id) {\n // No client credentials were presented, but the token is bound to\n // a client. RFC 6749 §10.4: a public client cannot authenticate\n // (no secret) and is not required to — the bound identity is read\n // from the signed token (client_id is server-minted, so trusted)\n // and refresh-token rotation/replay detection is the abuse control.\n // A client with an authentication method MUST still authenticate.\n // Supplying the server-minted client id lets TLS clients prove\n // themselves with the request certificate, while a secret client\n // still fails because its secret is absent.\n client = await this.clientAuthenticator.authenticate(\n payload.client_id,\n undefined,\n undefined,\n certificateEvidence,\n );\n }\n\n if (client) {\n assertClientGrantAllowed(client, OAuth2TokenGrant.REFRESH_TOKEN);\n }\n\n let confirmation: OAuth2TokenConfirmation | undefined;\n if (payload.cnf) {\n const expectedThumbprint = payload.cnf['x5t#S256'];\n if (typeof expectedThumbprint !== 'string' || expectedThumbprint.length === 0) {\n throw OAuth2GrantError.invalid();\n }\n\n confirmation = this.clientAuthenticator.validateCertificateEvidenceForBinding(\n certificateEvidence,\n );\n if (confirmation['x5t#S256'] !== expectedThumbprint) {\n throw OAuth2GrantError.invalid();\n }\n } else if (client) {\n confirmation = this.clientAuthenticator.resolveTokenBinding(client, certificateEvidence);\n }\n\n // Realm parity for PUBLIC clients only: a public client may not refresh\n // a token whose realm differs from the (bound) client's own realm.\n // Kills cross-realm refresh tokens minted for a public `web` client\n // before the authorize-side realm gate existed. Authenticated clients\n // are exempt — the configured secret/certificate proves identity, and the\n // documented cross-realm password grant (UUID-identified user against a\n // master-realm client) depends on that exemption.\n if (\n client &&\n isClientPublic(client) &&\n payload.realm_id &&\n payload.realm_id !== client.realmId\n ) {\n throw OAuth2GrantError.invalid();\n }\n\n return this.runWith(payload, {\n confirmation,\n ipAddress: getRequestIP(event) ?? undefined,\n userAgent: getRequestHeader(event, 'user-agent') ?? undefined,\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AA2BA,IAAaY,8BAAb,cAAiDL,wBAAAA;CACnCM;CAEAC;CAEAC;CAEAC;CAEV,YAAYC,KAAyC;EACjD,MAAMA,GAAAA;EAEN,KAAKJ,sBAAsBI,IAAIJ;EAC/B,KAAKC,uBAAuBG,IAAIC;EAChC,KAAKH,kBAAkBE,IAAIF;EAC3B,KAAKC,oBAAoBC,IAAID,qBAAqB;CACtD;CAEA,MAAMG,eAAeC,OAAqD;EACtE,MAAMC,OAAO,MAAMjB,gBAAgBgB,KAAAA;EACnC,MAAME,eAAeD,MAAME;EAC3B,IAAI,OAAOD,iBAAiB,YAAYA,aAAaE,WAAW,GAC5D,MAAMtB,mBAAmBuB,UAAS;EAGtC,MAAM,EAAEC,UAAUC,iBAAiB,MAAMlB,oCAAoCW,KAAAA;EAC7E,MAAMQ,sBAAsB,MAAMlB,uCAAuCU,OAAO,KAAKJ,iBAAiB;EAWtG,MAAMa,UAAU,MAAM,KAAKf,qBAAqBgB,OAAOR,cAAc,EAAES,iBAAiB,KAAK,CAAA;EAE7F,IAAIC;EAEJ,IAAIN,UAAU;GAKV,MAAMO,QAAQ,MAAM,KAAKlB,gBAAgBmB,QAAQvB,cAAcU,IAAAA,GAAO,IAAA;GAEtEW,SAAS,MAAM,KAAKnB,oBAAoBsB,aACpCT,UACAC,cACAM,MAAMG,IACNR,mBAAAA;GAGJ,IAAIC,QAAQQ,aAAaR,QAAQQ,cAAcL,OAAOI,IAClD,MAAMnC,iBAAiBqC,QAAO;EAEtC,OAAO,IAAIT,QAAQQ,WAUfL,SAAS,MAAM,KAAKnB,oBAAoBsB,aACpCN,QAAQQ,WACRE,KAAAA,GACAA,KAAAA,GACAX,mBAAAA;EAIR,IAAII,QACAxB,yBAAyBwB,QAAQ7B,iBAAiBqC,aAAa;EAGnE,IAAIC;EACJ,IAAIZ,QAAQa,KAAK;GACb,MAAMC,qBAAqBd,QAAQa,IAAI;GACvC,IAAI,OAAOC,uBAAuB,YAAYA,mBAAmBnB,WAAW,GACxE,MAAMvB,iBAAiBqC,QAAO;GAGlCG,eAAe,KAAK5B,oBAAoB+B,sCACpChB,mBAAAA;GAEJ,IAAIa,aAAa,gBAAgBE,oBAC7B,MAAM1C,iBAAiBqC,QAAO;EAEtC,OAAO,IAAIN,QACPS,eAAe,KAAK5B,oBAAoBgC,oBAAoBb,QAAQJ,mBAAAA;EAUxE,IACII,UACAhC,eAAegC,MAAAA,KACfH,QAAQiB,YACRjB,QAAQiB,aAAad,OAAOe,SAE5B,MAAM9C,iBAAiBqC,QAAO;EAGlC,OAAO,KAAKU,QAAQnB,SAAS;GACzBY;GACAQ,WAAW3C,aAAac,KAAAA,KAAUmB,KAAAA;GAClCW,WAAW7C,iBAAiBe,OAAO,YAAA,KAAiBmB,KAAAA;EACxD,CAAA;CACJ;AACJ"}
1
+ {"version":3,"file":"refresh_token.mjs","names":["isClientPublic","OAuth2GrantError","OAuth2RequestError","OAuth2TokenGrant","isJWTError","readRequestBody","getRequestHeader","getRequestIP","OAuth2RefreshTokenGrant","assertClientGrantAllowed","extractClientCredentialsFromRequest","extractOAuth2ClientCertificateEvidence","readRealmHint","HTTPOAuth2RefreshTokenGrant","clientAuthenticator","refreshTokenVerifier","realmRepository","certificateSource","ctx","tokenVerifier","runWithRequest","event","body","refreshToken","refresh_token","length","malformed","clientId","clientSecret","certificateEvidence","payload","verify","skipActiveCheck","e","invalid","client","realm","resolve","authenticate","id","client_id","undefined","REFRESH_TOKEN","confirmation","cnf","expectedThumbprint","validateCertificateEvidenceForBinding","resolveTokenBinding","realm_id","realmId","runWith","ipAddress","userAgent"],"sources":["../../../../../../src/adapters/http/adapters/oauth2/grant-types/refresh_token.ts"],"sourcesContent":["/*\n * Copyright (c) 2025-2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { type Client, isClientPublic } from '@authup/core-kit';\nimport type { OAuth2TokenConfirmation, OAuth2TokenGrantResponse } from '@authup/specs';\nimport {\n OAuth2GrantError,\n OAuth2RequestError,\n OAuth2TokenGrant,\n isJWTError,\n} from '@authup/specs';\nimport { readRequestBody } from '@routup/basic/body';\nimport type { IAppEvent } from 'routup';\nimport { getRequestHeader, getRequestIP } from 'routup';\nimport { OAuth2RefreshTokenGrant, assertClientGrantAllowed } from '../../../../../core/index.ts';\nimport type {\n IOAuth2TokenVerifier,\n IRealmRepository,\n OAuth2ClientAuthenticator,\n} from '../../../../../core/index.ts';\nimport type { HTTPOAuth2RefreshTokenGrantContext, IHTTPOAuth2Grant } from './types.ts';\nimport type { CertificateSource } from '../../../request/index.ts';\nimport {\n extractClientCredentialsFromRequest,\n extractOAuth2ClientCertificateEvidence,\n readRealmHint,\n} from './utils/index.ts';\n\nexport class HTTPOAuth2RefreshTokenGrant extends OAuth2RefreshTokenGrant implements IHTTPOAuth2Grant {\n protected clientAuthenticator : OAuth2ClientAuthenticator;\n\n protected refreshTokenVerifier : IOAuth2TokenVerifier;\n\n protected realmRepository : IRealmRepository;\n\n protected certificateSource: CertificateSource;\n\n constructor(ctx: HTTPOAuth2RefreshTokenGrantContext) {\n super(ctx);\n\n this.clientAuthenticator = ctx.clientAuthenticator;\n this.refreshTokenVerifier = ctx.tokenVerifier;\n this.realmRepository = ctx.realmRepository;\n this.certificateSource = ctx.certificateSource ?? 'disabled';\n }\n\n async runWithRequest(event: IAppEvent): Promise<OAuth2TokenGrantResponse> {\n const body = await readRequestBody(event);\n const refreshToken = body?.refresh_token;\n if (typeof refreshToken !== 'string' || refreshToken.length === 0) {\n throw OAuth2RequestError.malformed();\n }\n\n const { clientId, clientSecret } = await extractClientCredentialsFromRequest(event);\n const certificateEvidence = await extractOAuth2ClientCertificateEvidence(event, this.certificateSource);\n\n // RFC 6749 §6: verify the refresh token first to learn its bound\n // client (if any), then enforce binding. Authenticate the requesting\n // client when credentials are present, or when the token requires\n // a client binding.\n //\n // skipActiveCheck: the durable auth_session_tokens row (not the cache\n // blocklist) is the refresh-token authority, so a replayed/consumed\n // token must reach runWith() to trigger family revocation instead of\n // being rejected here with JWT_INACTIVE.\n let payload : Awaited<ReturnType<typeof this.refreshTokenVerifier.verify>>;\n try {\n payload = await this.refreshTokenVerifier.verify(refreshToken, { skipActiveCheck: true });\n } catch (e) {\n // RFC 6749 §5.2: a refresh token the endpoint cannot accept is\n // `invalid_grant` (400). A verification failure raises a JWT\n // error, which answers 401 on a resource route (RFC 6750 §3.1),\n // and letting that status escape here would report a bad GRANT\n // as if the CLIENT had failed to authenticate. The branches\n // below already answer `invalid_grant` for a token bound to\n // another client, so this keeps one shape for the parameter.\n if (isJWTError(e)) {\n throw OAuth2GrantError.invalid();\n }\n\n throw e;\n }\n\n let client: Client | undefined;\n\n if (clientId) {\n // A client authenticated itself. Resolve by the presented\n // id/secret (name resolution scoped by the realm hint — resolved\n // lazily so a bare refresh skips the SELECT) and enforce the\n // token↔client binding.\n const realm = await this.realmRepository.resolve(readRealmHint(body), true);\n\n client = await this.clientAuthenticator.authenticate(\n clientId,\n clientSecret,\n realm.id,\n certificateEvidence,\n );\n\n if (payload.client_id && payload.client_id !== client.id) {\n throw OAuth2GrantError.invalid();\n }\n } else if (payload.client_id) {\n // No client credentials were presented, but the token is bound to\n // a client. RFC 6749 §10.4: a public client cannot authenticate\n // (no secret) and is not required to — the bound identity is read\n // from the signed token (client_id is server-minted, so trusted)\n // and refresh-token rotation/replay detection is the abuse control.\n // A client with an authentication method MUST still authenticate.\n // Supplying the server-minted client id lets TLS clients prove\n // themselves with the request certificate, while a secret client\n // still fails because its secret is absent.\n client = await this.clientAuthenticator.authenticate(\n payload.client_id,\n undefined,\n undefined,\n certificateEvidence,\n );\n }\n\n if (client) {\n assertClientGrantAllowed(client, OAuth2TokenGrant.REFRESH_TOKEN);\n }\n\n let confirmation: OAuth2TokenConfirmation | undefined;\n if (payload.cnf) {\n const expectedThumbprint = payload.cnf['x5t#S256'];\n if (typeof expectedThumbprint !== 'string' || expectedThumbprint.length === 0) {\n throw OAuth2GrantError.invalid();\n }\n\n confirmation = this.clientAuthenticator.validateCertificateEvidenceForBinding(\n certificateEvidence,\n );\n if (confirmation['x5t#S256'] !== expectedThumbprint) {\n throw OAuth2GrantError.invalid();\n }\n } else if (client) {\n confirmation = this.clientAuthenticator.resolveTokenBinding(client, certificateEvidence);\n }\n\n // Realm parity for PUBLIC clients only: a public client may not refresh\n // a token whose realm differs from the (bound) client's own realm.\n // Kills cross-realm refresh tokens minted for a public `web` client\n // before the authorize-side realm gate existed. Authenticated clients\n // are exempt — the configured secret/certificate proves identity, and the\n // documented cross-realm password grant (UUID-identified user against a\n // master-realm client) depends on that exemption.\n if (\n client &&\n isClientPublic(client) &&\n payload.realm_id &&\n payload.realm_id !== client.realmId\n ) {\n throw OAuth2GrantError.invalid();\n }\n\n return this.runWith(payload, {\n confirmation,\n ipAddress: getRequestIP(event) ?? undefined,\n userAgent: getRequestHeader(event, 'user-agent') ?? undefined,\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAgCA,IAAaa,8BAAb,cAAiDL,wBAAAA;CACnCM;CAEAC;CAEAC;CAEAC;CAEV,YAAYC,KAAyC;EACjD,MAAMA,GAAAA;EAEN,KAAKJ,sBAAsBI,IAAIJ;EAC/B,KAAKC,uBAAuBG,IAAIC;EAChC,KAAKH,kBAAkBE,IAAIF;EAC3B,KAAKC,oBAAoBC,IAAID,qBAAqB;CACtD;CAEA,MAAMG,eAAeC,OAAqD;EACtE,MAAMC,OAAO,MAAMjB,gBAAgBgB,KAAAA;EACnC,MAAME,eAAeD,MAAME;EAC3B,IAAI,OAAOD,iBAAiB,YAAYA,aAAaE,WAAW,GAC5D,MAAMvB,mBAAmBwB,UAAS;EAGtC,MAAM,EAAEC,UAAUC,iBAAiB,MAAMlB,oCAAoCW,KAAAA;EAC7E,MAAMQ,sBAAsB,MAAMlB,uCAAuCU,OAAO,KAAKJ,iBAAiB;EAWtG,IAAIa;EACJ,IAAI;GACAA,UAAU,MAAM,KAAKf,qBAAqBgB,OAAOR,cAAc,EAAES,iBAAiB,KAAK,CAAA;EAC3F,SAASC,GAAG;GAQR,IAAI7B,WAAW6B,CAAAA,GACX,MAAMhC,iBAAiBiC,QAAO;GAGlC,MAAMD;EACV;EAEA,IAAIE;EAEJ,IAAIR,UAAU;GAKV,MAAMS,QAAQ,MAAM,KAAKpB,gBAAgBqB,QAAQzB,cAAcU,IAAAA,GAAO,IAAA;GAEtEa,SAAS,MAAM,KAAKrB,oBAAoBwB,aACpCX,UACAC,cACAQ,MAAMG,IACNV,mBAAAA;GAGJ,IAAIC,QAAQU,aAAaV,QAAQU,cAAcL,OAAOI,IAClD,MAAMtC,iBAAiBiC,QAAO;EAEtC,OAAO,IAAIJ,QAAQU,WAUfL,SAAS,MAAM,KAAKrB,oBAAoBwB,aACpCR,QAAQU,WACRC,KAAAA,GACAA,KAAAA,GACAZ,mBAAAA;EAIR,IAAIM,QACA1B,yBAAyB0B,QAAQhC,iBAAiBuC,aAAa;EAGnE,IAAIC;EACJ,IAAIb,QAAQc,KAAK;GACb,MAAMC,qBAAqBf,QAAQc,IAAI;GACvC,IAAI,OAAOC,uBAAuB,YAAYA,mBAAmBpB,WAAW,GACxE,MAAMxB,iBAAiBiC,QAAO;GAGlCS,eAAe,KAAK7B,oBAAoBgC,sCACpCjB,mBAAAA;GAEJ,IAAIc,aAAa,gBAAgBE,oBAC7B,MAAM5C,iBAAiBiC,QAAO;EAEtC,OAAO,IAAIC,QACPQ,eAAe,KAAK7B,oBAAoBiC,oBAAoBZ,QAAQN,mBAAAA;EAUxE,IACIM,UACAnC,eAAemC,MAAAA,KACfL,QAAQkB,YACRlB,QAAQkB,aAAab,OAAOc,SAE5B,MAAMhD,iBAAiBiC,QAAO;EAGlC,OAAO,KAAKgB,QAAQpB,SAAS;GACzBa;GACAQ,WAAW5C,aAAac,KAAAA,KAAUoB,KAAAA;GAClCW,WAAW9C,iBAAiBe,OAAO,YAAA,KAAiBoB,KAAAA;EACxD,CAAA;CACJ;AACJ"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * The path segments the served consoles live under. Each is spelled ONCE:
3
+ * the controller mount, the login cookie scope, the callback URL, the asset
4
+ * mount and the shell's rebased vite base all derive from it, so a move
5
+ * cannot drift the login flow away from the page. The vite `base` in each
6
+ * console workspace is a hand-synced literal (a vite config cannot import a
7
+ * server constant); the page specs catch a bundle built against another.
8
+ */
9
+ export declare const ADMIN_CONSOLE_SEGMENT = "console/admin";
10
+ export declare const ACCOUNT_CONSOLE_SEGMENT = "console/account";
11
+ /**
12
+ * The auth console's namespace, under which ONLY its assets are mounted
13
+ * (`<segment>/assets`, the same shape as the two static consoles). Its
14
+ * PAGES stay on their protocol routes (`/authorize`, `/logout`, the
15
+ * workflow paths), so `/console/auth` itself serves nothing.
16
+ */
17
+ export declare const AUTH_CONSOLE_SEGMENT = "console/auth";
18
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/adapters/http/constants.ts"],"names":[],"mappings":"AAOA;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,kBAAkB,CAAC;AAErD,eAAO,MAAM,uBAAuB,oBAAoB,CAAC;AAEzD;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,iBAAiB,CAAC"}
@@ -0,0 +1,23 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ //#region src/adapters/http/constants.ts
5
+ /**
6
+ * The path segments the served consoles live under. Each is spelled ONCE:
7
+ * the controller mount, the login cookie scope, the callback URL, the asset
8
+ * mount and the shell's rebased vite base all derive from it, so a move
9
+ * cannot drift the login flow away from the page. The vite `base` in each
10
+ * console workspace is a hand-synced literal (a vite config cannot import a
11
+ * server constant); the page specs catch a bundle built against another.
12
+ */ const ADMIN_CONSOLE_SEGMENT = "console/admin";
13
+ const ACCOUNT_CONSOLE_SEGMENT = "console/account";
14
+ /**
15
+ * The auth console's namespace, under which ONLY its assets are mounted
16
+ * (`<segment>/assets`, the same shape as the two static consoles). Its
17
+ * PAGES stay on their protocol routes (`/authorize`, `/logout`, the
18
+ * workflow paths), so `/console/auth` itself serves nothing.
19
+ */ const AUTH_CONSOLE_SEGMENT = "console/auth";
20
+ //#endregion
21
+ export { ACCOUNT_CONSOLE_SEGMENT, ADMIN_CONSOLE_SEGMENT, AUTH_CONSOLE_SEGMENT };
22
+
23
+ //# sourceMappingURL=constants.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.mjs","names":["ADMIN_CONSOLE_SEGMENT","ACCOUNT_CONSOLE_SEGMENT","AUTH_CONSOLE_SEGMENT"],"sources":["../../../src/adapters/http/constants.ts"],"sourcesContent":["/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\n/**\n * The path segments the served consoles live under. Each is spelled ONCE:\n * the controller mount, the login cookie scope, the callback URL, the asset\n * mount and the shell's rebased vite base all derive from it, so a move\n * cannot drift the login flow away from the page. The vite `base` in each\n * console workspace is a hand-synced literal (a vite config cannot import a\n * server constant); the page specs catch a bundle built against another.\n */\nexport const ADMIN_CONSOLE_SEGMENT = 'console/admin';\n\nexport const ACCOUNT_CONSOLE_SEGMENT = 'console/account';\n\n/**\n * The auth console's namespace, under which ONLY its assets are mounted\n * (`<segment>/assets`, the same shape as the two static consoles). Its\n * PAGES stay on their protocol routes (`/authorize`, `/logout`, the\n * workflow paths), so `/console/auth` itself serves nothing.\n */\nexport const AUTH_CONSOLE_SEGMENT = 'console/auth';\n"],"mappings":";;;;;;;;;;;GAeA,MAAaA,wBAAwB;AAErC,MAAaC,0BAA0B;;;;;;GAQvC,MAAaC,uBAAuB"}
@@ -3,9 +3,9 @@ import "node:url";
3
3
  import.meta.url;
4
4
  import { RECORD_QUERY_PARAMETERS, describeQuerySchema } from "../../../../../core/query/describe.mjs";
5
5
  import { clientSchema } from "../../../../../core/entities/client/schema.mjs";
6
- import { OAuth2ScopeAttributesResolver } from "../../../../../core/oauth2/scope/resolver.mjs";
7
6
  import { isSelfToken } from "../../../../../utils/self-id.mjs";
8
7
  import "../../../../../utils/index.mjs";
8
+ import { OAuth2ScopeAttributesResolver } from "../../../../../core/oauth2/scope/resolver.mjs";
9
9
  import "../../../../../core/index.mjs";
10
10
  import { useRequestIdentity } from "../../../request/helpers/identity.mjs";
11
11
  import { buildActorContext } from "../../../request/helpers/actor.mjs";
@@ -1,6 +1,7 @@
1
1
  import type { IAppEvent } from 'routup';
2
2
  import type { IdentityProvider, IdentityProviderAccount } from '@authup/core-kit';
3
3
  import type { Logger } from '@authup/server-kit';
4
+ import type { OAuth2TokenGrantResponse } from '@authup/specs';
4
5
  import type { EntityCollectionResponse, EntityRecordResponse, IdentityProviderCreatePayload, IdentityProviderLinkConfirmPayload, IdentityProviderLinkRequestResponse, IdentityProviderSavePayload, IdentityProviderUpdatePayload } from '@authup/core-http-kit';
5
6
  import type { IEventService, IIdentityProviderAccountLinkStore, IIdentityProviderAccountManager, IIdentityProviderRepository, IOAuth2AuthorizationCodeRequestVerifier, IOAuth2AuthorizationStateManager, IOAuth2FederatedLoginService } from '../../../../../core/index.ts';
6
7
  import { OAuth2AuthorizationCodeRequestValidator } from '../../../../../core/index.ts';
@@ -25,7 +26,8 @@ export declare class IdentityProviderController {
25
26
  addProvider(user: IdentityProviderCreatePayload, event: IAppEvent): Promise<EntityRecordResponse<IdentityProvider>>;
26
27
  authorizeOut(_id: string, event: IAppEvent): Promise<Response>;
27
28
  linkRequest(_id: string, event: IAppEvent): Promise<IdentityProviderLinkRequestResponse>;
28
- authorizeIn(_id: string, event: IAppEvent): Promise<string | Response>;
29
+ authorizeIn(_id: string, event: IAppEvent): Promise<Response>;
30
+ completeLogin(_id: string, event: IAppEvent): Promise<OAuth2TokenGrantResponse>;
29
31
  private write;
30
32
  /**
31
33
  * Callback half of the account-linking round-trip (plan 091): the
@@ -43,6 +45,26 @@ export declare class IdentityProviderController {
43
45
  private buildHostedAuthorizeURL;
44
46
  private resolve;
45
47
  private buildProviderAuthenticator;
48
+ /**
49
+ * Scoped to the routes that read it, so the cookie never rides an
50
+ * ordinary API request, and to publicUrl's base path, since a sub-path
51
+ * deployment mounts every route under it.
52
+ */
53
+ private buildFederatedLoginCookiePath;
54
+ private setFederatedLoginCookie;
55
+ /**
56
+ * The completion answers with a token pair and authenticates on a cookie
57
+ * alone, so it must be reachable only from the hosted page's own origin.
58
+ *
59
+ * CORS cannot carry that here: the default reflects every origin WITH
60
+ * credentials, and `SameSite` is scoped to the registrable domain rather
61
+ * than the origin, so a sibling subdomain's script is same-site and would
62
+ * both send the cookie and be allowed to read the response. A browser
63
+ * sends `Origin` on every POST, so requiring it to be publicUrl's own is
64
+ * what closes that. A request without the header is not a browser and
65
+ * carries no cookie of ours to begin with.
66
+ */
67
+ private assertSameOrigin;
46
68
  private saveAuthorizationState;
47
69
  private verifyAuthorizationState;
48
70
  }
@@ -1 +1 @@
1
- {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../../src/adapters/http/controllers/entities/identity-provider/module.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAMxC,OAAO,KAAK,EACR,gBAAgB,EAChB,uBAAuB,EAI1B,MAAM,kBAAkB,CAAC;AAc1B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAKjD,OAAO,KAAK,EACR,wBAAwB,EACxB,oBAAoB,EACpB,6BAA6B,EAC7B,kCAAkC,EAClC,mCAAmC,EACnC,2BAA2B,EAC3B,6BAA6B,EAChC,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EACR,aAAa,EACb,iCAAiC,EACjC,+BAA+B,EAC/B,2BAA2B,EAC3B,uCAAuC,EACvC,gCAAgC,EAChC,4BAA4B,EAI/B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACH,uCAAuC,EAM1C,MAAM,8BAA8B,CAAC;AAetC,OAAO,KAAK,EAAE,iCAAiC,EAAE,iCAAiC,EAAE,MAAM,YAAY,CAAC;AAEvG,qBAEa,0BAA0B;IACnC,SAAS,CAAC,OAAO,EAAE,iCAAiC,CAAC;IAErD,SAAS,CAAC,UAAU,EAAE,2BAA2B,CAAC;IAElD,SAAS,CAAC,cAAc,EAAE,+BAA+B,CAAC;IAE1D,SAAS,CAAC,SAAS,EAAE,iCAAiC,CAAC;IAEvD,SAAS,CAAC,mBAAmB,EAAG,uCAAuC,CAAC;IAExE,SAAS,CAAC,oBAAoB,EAAG,uCAAuC,CAAC;IAEzE,SAAS,CAAC,YAAY,EAAG,gCAAgC,CAAC;IAE1D,SAAS,CAAC,YAAY,EAAG,4BAA4B,CAAC;IAEtD,SAAS,CAAC,YAAY,CAAC,EAAG,aAAa,CAAC;IAExC,SAAS,CAAC,MAAM,CAAC,EAAG,MAAM,CAAC;gBAIf,GAAG,EAAE,iCAAiC;IAgB5C,YAAY,CACF,KAAK,EAAE,SAAS,GAC7B,OAAO,CAAC,wBAAwB,CAAC,gBAAgB,CAAC,CAAC;IAuChD,WAAW,CACA,EAAE,EAAE,MAAM,EACX,KAAK,EAAE,SAAS,GAC7B,OAAO,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAC;IA0B5C,YAAY,CACD,EAAE,EAAE,MAAM,EACd,IAAI,EAAE,6BAA6B,EAChC,KAAK,EAAE,SAAS,GAC5B,OAAO,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAC;IAK7C,GAAG,CACQ,EAAE,EAAE,MAAM,EACd,IAAI,EAAE,2BAA2B,EAC9B,KAAK,EAAE,SAAS,GAC5B,OAAO,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAC;IAK7C,YAAY,CACD,EAAE,EAAE,MAAM,EACX,KAAK,EAAE,SAAS,GAC5B,OAAO,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAC;IA6B7C,WAAW,CACJ,IAAI,EAAE,6BAA6B,EAChC,KAAK,EAAE,SAAS,GAC5B,OAAO,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAC;IAO7C,YAAY,CACD,GAAG,EAAE,MAAM,EACZ,KAAK,EAAE,SAAS;IAoD1B,WAAW,CACA,GAAG,EAAE,MAAM,EACZ,KAAK,EAAE,SAAS,GAC5B,OAAO,CAAC,mCAAmC,CAAC;IA6B1C,WAAW,CACA,GAAG,EAAE,MAAM,EACZ,KAAK,EAAE,SAAS;YA4GlB,KAAK;IA+FnB;;;;;OAKG;YACW,YAAY;IAyE1B;;;OAGG;IAEG,WAAW,CACA,GAAG,EAAE,MAAM,EACf,KAAK,EAAE,kCAAkC,EACtC,KAAK,EAAE,SAAS,GAC5B,OAAO,CAAC,oBAAoB,CAAC,uBAAuB,CAAC,CAAC;IA2E1D,OAAO,CAAC,qBAAqB;IAgB7B,OAAO,CAAC,uBAAuB;YAmBjB,OAAO;IAYrB,OAAO,CAAC,0BAA0B;YAepB,sBAAsB;YAWtB,wBAAwB;CAWzC"}
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../../src/adapters/http/controllers/entities/identity-provider/module.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAMxC,OAAO,KAAK,EACR,gBAAgB,EAChB,uBAAuB,EAI1B,MAAM,kBAAkB,CAAC;AAa1B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAKjD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAE9D,OAAO,KAAK,EACR,wBAAwB,EACxB,oBAAoB,EACpB,6BAA6B,EAC7B,kCAAkC,EAClC,mCAAmC,EACnC,2BAA2B,EAC3B,6BAA6B,EAChC,MAAM,uBAAuB,CAAC;AAG/B,OAAO,KAAK,EACR,aAAa,EACb,iCAAiC,EACjC,+BAA+B,EAC/B,2BAA2B,EAC3B,uCAAuC,EACvC,gCAAgC,EAChC,4BAA4B,EAI/B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAGH,uCAAuC,EAM1C,MAAM,8BAA8B,CAAC;AAatC,OAAO,KAAK,EAAE,iCAAiC,EAAE,iCAAiC,EAAE,MAAM,YAAY,CAAC;AAEvG,qBAEa,0BAA0B;IACnC,SAAS,CAAC,OAAO,EAAE,iCAAiC,CAAC;IAErD,SAAS,CAAC,UAAU,EAAE,2BAA2B,CAAC;IAElD,SAAS,CAAC,cAAc,EAAE,+BAA+B,CAAC;IAE1D,SAAS,CAAC,SAAS,EAAE,iCAAiC,CAAC;IAEvD,SAAS,CAAC,mBAAmB,EAAG,uCAAuC,CAAC;IAExE,SAAS,CAAC,oBAAoB,EAAG,uCAAuC,CAAC;IAEzE,SAAS,CAAC,YAAY,EAAG,gCAAgC,CAAC;IAE1D,SAAS,CAAC,YAAY,EAAG,4BAA4B,CAAC;IAEtD,SAAS,CAAC,YAAY,CAAC,EAAG,aAAa,CAAC;IAExC,SAAS,CAAC,MAAM,CAAC,EAAG,MAAM,CAAC;gBAIf,GAAG,EAAE,iCAAiC;IAqB5C,YAAY,CACF,KAAK,EAAE,SAAS,GAC7B,OAAO,CAAC,wBAAwB,CAAC,gBAAgB,CAAC,CAAC;IAqBhD,WAAW,CACA,EAAE,EAAE,MAAM,EACX,KAAK,EAAE,SAAS,GAC7B,OAAO,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAC;IAyB5C,YAAY,CACD,EAAE,EAAE,MAAM,EACd,IAAI,EAAE,6BAA6B,EAChC,KAAK,EAAE,SAAS,GAC5B,OAAO,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAC;IAK7C,GAAG,CACQ,EAAE,EAAE,MAAM,EACd,IAAI,EAAE,2BAA2B,EAC9B,KAAK,EAAE,SAAS,GAC5B,OAAO,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAC;IAK7C,YAAY,CACD,EAAE,EAAE,MAAM,EACX,KAAK,EAAE,SAAS,GAC5B,OAAO,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAC;IA6B7C,WAAW,CACJ,IAAI,EAAE,6BAA6B,EAChC,KAAK,EAAE,SAAS,GAC5B,OAAO,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAC;IAO7C,YAAY,CACD,GAAG,EAAE,MAAM,EACZ,KAAK,EAAE,SAAS;IAgE1B,WAAW,CACA,GAAG,EAAE,MAAM,EACZ,KAAK,EAAE,SAAS,GAC5B,OAAO,CAAC,mCAAmC,CAAC;IA6B1C,WAAW,CACA,GAAG,EAAE,MAAM,EACZ,KAAK,EAAE,SAAS;IAwG1B,aAAa,CACF,GAAG,EAAE,MAAM,EACZ,KAAK,EAAE,SAAS,GAC5B,OAAO,CAAC,wBAAwB,CAAC;YA8BvB,KAAK;IA2GnB;;;;;OAKG;YACW,YAAY;IAyE1B;;;OAGG;IAEG,WAAW,CACA,GAAG,EAAE,MAAM,EACf,KAAK,EAAE,kCAAkC,EACtC,KAAK,EAAE,SAAS,GAC5B,OAAO,CAAC,oBAAoB,CAAC,uBAAuB,CAAC,CAAC;IA2E1D,OAAO,CAAC,qBAAqB;IAgB7B,OAAO,CAAC,uBAAuB;YAmBjB,OAAO;IAYrB,OAAO,CAAC,0BAA0B;IAelC;;;;OAIG;IACH,OAAO,CAAC,6BAA6B;IAIrC,OAAO,CAAC,uBAAuB;IAc/B;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,gBAAgB;YAWV,sBAAsB;YAWtB,wBAAwB;CAWzC"}
@@ -5,10 +5,11 @@ import { RECORD_QUERY_PARAMETERS, describeQuerySchema } from "../../../../../cor
5
5
  import { identityProviderSchema } from "../../../../../core/entities/identity-provider/schema.mjs";
6
6
  import { decodeQuery } from "../../../../../core/query/module.mjs";
7
7
  import { OAuth2AuthorizationCodeRequestValidator } from "../../../../../core/oauth2/authorization/code-request/validator.mjs";
8
- import { createIdentityProviderOAuth2Authenticator } from "../../../../../core/identity/provider/authentication/factory.mjs";
9
8
  import { describeError } from "../../../../../utils/error.mjs";
10
9
  import { resolveURL } from "../../../../../utils/url.mjs";
11
10
  import "../../../../../utils/index.mjs";
11
+ import { OAUTH2_FEDERATED_LOGIN_COOKIE, OAUTH2_FEDERATED_LOGIN_TTL } from "../../../../../core/oauth2/federated-login/constants.mjs";
12
+ import { createIdentityProviderOAuth2Authenticator } from "../../../../../core/identity/provider/authentication/factory.mjs";
12
13
  import "../../../../../core/index.mjs";
13
14
  import { useRequestPermissionEvaluator } from "../../../request/permission/helper.mjs";
14
15
  import { useRequestIdentityOrFail } from "../../../request/helpers/identity.mjs";
@@ -19,18 +20,18 @@ import { applyRouteRealmIDToBody, getRequestRealmID } from "../../../request/hel
19
20
  import { useRequestEventContext } from "../../../request/event-context.mjs";
20
21
  import "../../../request/index.mjs";
21
22
  import { ForceLoggedInMiddleware } from "../../../middleware/built-in/loggedin/module.mjs";
22
- import { renderAuthConsolePage } from "../../../ui/auth-console/module.mjs";
23
23
  import "../../../middleware/index.mjs";
24
- import "../../../ui/index.mjs";
25
- import { ValidatorGroup, base64URLDecode, isObject, isUUID } from "@authup/kit";
26
- import { EventName, EventRefType, EventScope, IdentityProviderAttributesValidator, IdentityProviderValidator, IdentityType, PermissionName, buildIdentityProviderAuthorizeCallbackPath, isOAuth2IdentityProvider, isOpenIDIdentityProvider } from "@authup/core-kit";
24
+ import { ValidatorGroup, base64URLDecode, createNanoID, getURLBasePath, isObject, isUUID } from "@authup/kit";
25
+ import { EventName, EventRefType, EventScope, IdentityProviderAttributesValidator, IdentityProviderValidator, IdentityType, PermissionName, isOAuth2IdentityProvider, isOpenIDIdentityProvider } from "@authup/core-kit";
27
26
  import { BuiltInPolicyType, definePolicyData } from "@authup/access";
28
27
  import { BadRequestError, EntityNotFoundError } from "@authup/errors";
29
28
  import { OAuth2RequestError } from "@authup/specs";
30
29
  import { URL } from "node:url";
31
30
  import { getRequestHeader, getRequestIP, sendRedirect } from "routup";
31
+ import { setResponseCookie, unsetResponseCookie, useRequestCookie } from "@routup/basic/cookie";
32
32
  import { readRequestBody } from "@routup/basic/body";
33
33
  import { useRequestQuery } from "@routup/basic/query";
34
+ import { IDENTITY_PROVIDER_LOGIN_NOT_PENDING } from "@authup/core-http-kit";
34
35
  import { DBody, DContext, DController, DDelete, DGet, DPath, DPost, DPut, DTags } from "@routup/decorators";
35
36
  //#region src/adapters/http/controllers/entities/identity-provider/module.ts
36
37
  function _ts_decorate(decorators, target, key, desc) {
@@ -75,19 +76,6 @@ var IdentityProviderController = class {
75
76
  schema: identityProviderSchema,
76
77
  actor: buildActorContext(event)
77
78
  }));
78
- try {
79
- const permissionEvaluator = useRequestPermissionEvaluator(event);
80
- await permissionEvaluator.preEvaluate({ name: PermissionName.IDENTITY_PROVIDER_READ });
81
- for (const datum of data) try {
82
- await permissionEvaluator.evaluate({
83
- name: PermissionName.IDENTITY_PROVIDER_READ,
84
- data: definePolicyData({
85
- [BuiltInPolicyType.ATTRIBUTES]: datum,
86
- [BuiltInPolicyType.REALM_MATCH]: datum.realmId ?? null
87
- })
88
- });
89
- } catch {}
90
- } catch {}
91
79
  return {
92
80
  data,
93
81
  meta: {
@@ -100,15 +88,17 @@ var IdentityProviderController = class {
100
88
  const paramId = useRequestParamID(event, { isUUID: false });
101
89
  const entity = await this.repository.findOneByIdOrName(paramId, getRequestRealmID(event));
102
90
  if (!entity) throw new EntityNotFoundError();
103
- try {
104
- await useRequestPermissionEvaluator(event).evaluate({
105
- name: PermissionName.IDENTITY_PROVIDER_READ,
106
- data: definePolicyData({
107
- [BuiltInPolicyType.ATTRIBUTES]: entity,
108
- [BuiltInPolicyType.REALM_MATCH]: entity.realmId ?? null
109
- })
110
- });
111
- } catch {}
91
+ await useRequestPermissionEvaluator(event).evaluateOneOf({
92
+ name: [
93
+ PermissionName.IDENTITY_PROVIDER_READ,
94
+ PermissionName.IDENTITY_PROVIDER_UPDATE,
95
+ PermissionName.IDENTITY_PROVIDER_DELETE
96
+ ],
97
+ data: definePolicyData({
98
+ [BuiltInPolicyType.ATTRIBUTES]: entity,
99
+ [BuiltInPolicyType.REALM_MATCH]: entity.realmId ?? null
100
+ })
101
+ });
112
102
  return {
113
103
  data: entity,
114
104
  meta: { schema: describeQuerySchema(identityProviderSchema, RECORD_QUERY_PARAMETERS) }
@@ -162,7 +152,12 @@ var IdentityProviderController = class {
162
152
  const data = await this.codeRequestVerifier.verify(codeRequestValidated);
163
153
  if (data.client.realmId && entity.realmId && entity.realmId !== data.client.realmId) throw OAuth2RequestError.malformed("The provider and client realm do not match.");
164
154
  const authenticator = this.buildProviderAuthenticator(entity);
165
- const state = await this.saveAuthorizationState(event, { codeRequest: data.data });
155
+ const browserNonce = createNanoID();
156
+ this.setFederatedLoginCookie(event, browserNonce);
157
+ const state = await this.saveAuthorizationState(event, {
158
+ codeRequest: data.data,
159
+ browserNonce
160
+ });
166
161
  return sendRedirect(event, authenticator.buildRedirectURL({ state }));
167
162
  }
168
163
  async linkRequest(_id, event) {
@@ -188,6 +183,8 @@ var IdentityProviderController = class {
188
183
  const { link } = data;
189
184
  if (link) return this.completeLink(event, entity, data, link);
190
185
  if (!data.codeRequest) throw OAuth2RequestError.malformed("The state carries no authorization code request.");
186
+ const browserNonce = useRequestCookie(event, OAUTH2_FEDERATED_LOGIN_COOKIE);
187
+ if (typeof browserNonce !== "string" || !data.browserNonce || browserNonce !== data.browserNonce) return sendRedirect(event, this.buildHostedAuthorizeURL(data.codeRequest).href);
191
188
  const { code, error } = useRequestQuery(event);
192
189
  if (typeof error === "string" && error.length > 0) {
193
190
  this.logger?.info(`The identity provider ${entity.id} answered the authorization with ${JSON.stringify(error.slice(0, 64))}.`);
@@ -203,26 +200,27 @@ var IdentityProviderController = class {
203
200
  userAgent: getRequestHeader(event, "user-agent")
204
201
  }
205
202
  });
203
+ const url = this.buildHostedAuthorizeURL(result.codeRequest);
206
204
  if (result.kind === "refused") {
207
- const url = this.buildHostedAuthorizeURL(result.codeRequest);
208
205
  if (result.error) url.searchParams.set("error", result.error);
209
206
  return sendRedirect(event, url.href);
210
207
  }
211
- const url = new URL(result.redirectUri);
212
- url.searchParams.set("code", result.code);
213
- if (result.state) url.searchParams.set("state", result.state);
214
- if (url.protocol === "http:" || url.protocol === "https:") return sendRedirect(event, url.href);
215
- const payload = {
216
- redirect: url.href,
217
- authorizeUrl: this.buildHostedAuthorizeURL(result.codeRequest).href,
218
- client: result.client
219
- };
220
- return renderAuthConsolePage(event, {
221
- url: buildIdentityProviderAuthorizeCallbackPath(entity.id),
222
- payload: {
223
- config: { baseURL: this.options.baseURL },
224
- data: payload
225
- }
208
+ this.setFederatedLoginCookie(event, result.pendingLoginId);
209
+ url.searchParams.set("provider", entity.id);
210
+ return sendRedirect(event, url.href);
211
+ }
212
+ async completeLogin(_id, event) {
213
+ const id = useRequestParamID(event);
214
+ this.assertSameOrigin(event);
215
+ const pendingLoginId = useRequestCookie(event, OAUTH2_FEDERATED_LOGIN_COOKIE);
216
+ if (typeof pendingLoginId !== "string" || pendingLoginId.length === 0) throw new BadRequestError({
217
+ message: "The login request is unknown or expired.",
218
+ data: { reason: IDENTITY_PROVIDER_LOGIN_NOT_PENDING }
219
+ });
220
+ unsetResponseCookie(event, OAUTH2_FEDERATED_LOGIN_COOKIE, { path: this.buildFederatedLoginCookiePath() });
221
+ return this.loginService.completeHandoff({
222
+ pendingLoginId,
223
+ providerId: id
226
224
  });
227
225
  }
228
226
  async write(event, options = {}) {
@@ -273,8 +271,9 @@ var IdentityProviderController = class {
273
271
  }
274
272
  await this.repository.checkUniqueness(data, entity || void 0);
275
273
  if (entity) {
274
+ const keepAll = entity.protocol === data.protocol;
276
275
  entity = this.repository.merge(entity, data);
277
- await this.repository.saveWithEA(entity, attributes);
276
+ await this.repository.saveWithEA(entity, attributes, { keepAll });
278
277
  event.response.status = 202;
279
278
  return {
280
279
  data: entity,
@@ -295,7 +294,7 @@ var IdentityProviderController = class {
295
294
  * running the login path. No auth code and no session is minted; the
296
295
  * browser lands back on the account console with a marker param.
297
296
  */ async completeLink(event, provider, state, link) {
298
- const url = new URL(resolveURL(this.options.baseURL, "account/connected-accounts"));
297
+ const url = new URL(resolveURL(this.options.accountConsoleUrl, "connected-accounts"));
299
298
  const { code } = useRequestQuery(event);
300
299
  try {
301
300
  if (link.providerId !== provider.id || !provider.enabled) throw new BadRequestError("The identity provider is not available for account linking.");
@@ -398,6 +397,38 @@ var IdentityProviderController = class {
398
397
  }
399
398
  });
400
399
  }
400
+ /**
401
+ * Scoped to the routes that read it, so the cookie never rides an
402
+ * ordinary API request, and to publicUrl's base path, since a sub-path
403
+ * deployment mounts every route under it.
404
+ */ buildFederatedLoginCookiePath() {
405
+ return `${getURLBasePath(this.options.baseURL)}/identity-providers`;
406
+ }
407
+ setFederatedLoginCookie(event, value) {
408
+ setResponseCookie(event, OAUTH2_FEDERATED_LOGIN_COOKIE, value, {
409
+ httpOnly: true,
410
+ sameSite: "lax",
411
+ secure: new URL(this.options.baseURL).protocol === "https:",
412
+ path: this.buildFederatedLoginCookiePath(),
413
+ maxAge: OAUTH2_FEDERATED_LOGIN_TTL / 1e3
414
+ });
415
+ }
416
+ /**
417
+ * The completion answers with a token pair and authenticates on a cookie
418
+ * alone, so it must be reachable only from the hosted page's own origin.
419
+ *
420
+ * CORS cannot carry that here: the default reflects every origin WITH
421
+ * credentials, and `SameSite` is scoped to the registrable domain rather
422
+ * than the origin, so a sibling subdomain's script is same-site and would
423
+ * both send the cookie and be allowed to read the response. A browser
424
+ * sends `Origin` on every POST, so requiring it to be publicUrl's own is
425
+ * what closes that. A request without the header is not a browser and
426
+ * carries no cookie of ours to begin with.
427
+ */ assertSameOrigin(event) {
428
+ const origin = getRequestHeader(event, "origin");
429
+ if (typeof origin !== "string" || origin.length === 0) return;
430
+ if (origin !== new URL(this.options.baseURL).origin) throw new BadRequestError("The login request is unknown or expired.");
431
+ }
401
432
  async saveAuthorizationState(event, data = {}) {
402
433
  return this.stateManager.save({
403
434
  ...data,
@@ -422,7 +453,7 @@ _ts_decorate([
422
453
  _ts_metadata("design:returntype", Promise)
423
454
  ], IdentityProviderController.prototype, "getProviders", null);
424
455
  _ts_decorate([
425
- DGet("/:id", []),
456
+ DGet("/:id", [ForceLoggedInMiddleware]),
426
457
  _ts_param(0, DPath("id")),
427
458
  _ts_param(1, DContext()),
428
459
  _ts_metadata("design:type", Function),
@@ -495,6 +526,14 @@ _ts_decorate([
495
526
  _ts_metadata("design:paramtypes", [String, typeof IAppEvent === "undefined" ? Object : IAppEvent]),
496
527
  _ts_metadata("design:returntype", Promise)
497
528
  ], IdentityProviderController.prototype, "authorizeIn", null);
529
+ _ts_decorate([
530
+ DPost("/:id/login-complete", []),
531
+ _ts_param(0, DPath("id")),
532
+ _ts_param(1, DContext()),
533
+ _ts_metadata("design:type", Function),
534
+ _ts_metadata("design:paramtypes", [String, typeof IAppEvent === "undefined" ? Object : IAppEvent]),
535
+ _ts_metadata("design:returntype", Promise)
536
+ ], IdentityProviderController.prototype, "completeLogin", null);
498
537
  _ts_decorate([
499
538
  DPost("/:id/link-confirm", [ForceLoggedInMiddleware]),
500
539
  _ts_param(0, DPath("id")),