@authup/server-core 1.0.0-beta.52 → 1.0.0-beta.53

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 (742) hide show
  1. package/dist/adapters/database/data-source/options/module.d.ts.map +1 -1
  2. package/dist/adapters/database/data-source/options/module.mjs +18 -8
  3. package/dist/adapters/database/data-source/options/module.mjs.map +1 -1
  4. package/dist/adapters/database/domains/client/entity.d.ts +5 -2
  5. package/dist/adapters/database/domains/client/entity.d.ts.map +1 -1
  6. package/dist/adapters/database/domains/client/entity.mjs +28 -4
  7. package/dist/adapters/database/domains/client/entity.mjs.map +1 -1
  8. package/dist/adapters/database/domains/client-permission/entity.mjs +2 -2
  9. package/dist/adapters/database/domains/consent/entity.d.ts +20 -0
  10. package/dist/adapters/database/domains/consent/entity.d.ts.map +1 -0
  11. package/dist/adapters/database/domains/consent/entity.mjs +110 -0
  12. package/dist/adapters/database/domains/consent/entity.mjs.map +1 -0
  13. package/dist/adapters/database/domains/consent/index.d.ts +3 -0
  14. package/dist/adapters/database/domains/consent/index.d.ts.map +1 -0
  15. package/dist/adapters/database/domains/consent/index.mjs +6 -0
  16. package/dist/adapters/database/domains/consent/subscriber.d.ts +6 -0
  17. package/dist/adapters/database/domains/consent/subscriber.d.ts.map +1 -0
  18. package/dist/adapters/database/domains/consent/subscriber.mjs +45 -0
  19. package/dist/adapters/database/domains/consent/subscriber.mjs.map +1 -0
  20. package/dist/adapters/database/domains/constants.d.ts +1 -0
  21. package/dist/adapters/database/domains/constants.d.ts.map +1 -1
  22. package/dist/adapters/database/domains/constants.mjs +1 -0
  23. package/dist/adapters/database/domains/constants.mjs.map +1 -1
  24. package/dist/adapters/database/domains/event/entity.d.ts +22 -0
  25. package/dist/adapters/database/domains/event/entity.d.ts.map +1 -0
  26. package/dist/adapters/database/domains/event/entity.mjs +174 -0
  27. package/dist/adapters/database/domains/event/entity.mjs.map +1 -0
  28. package/dist/adapters/database/domains/event/index.d.ts +2 -0
  29. package/dist/adapters/database/domains/event/index.d.ts.map +1 -0
  30. package/dist/adapters/database/domains/event/index.mjs +5 -0
  31. package/dist/adapters/database/domains/identity-provider-account/entity.mjs +2 -2
  32. package/dist/adapters/database/domains/index.d.ts +4 -0
  33. package/dist/adapters/database/domains/index.d.ts.map +1 -1
  34. package/dist/adapters/database/domains/index.mjs +24 -15
  35. package/dist/adapters/database/domains/key/entity.d.ts +7 -3
  36. package/dist/adapters/database/domains/key/entity.d.ts.map +1 -1
  37. package/dist/adapters/database/domains/key/entity.mjs +35 -10
  38. package/dist/adapters/database/domains/key/entity.mjs.map +1 -1
  39. package/dist/adapters/database/domains/permission-policy/entity.mjs +2 -2
  40. package/dist/adapters/database/domains/policy/repository.d.ts.map +1 -1
  41. package/dist/adapters/database/domains/policy/repository.mjs +3 -3
  42. package/dist/adapters/database/domains/policy/repository.mjs.map +1 -1
  43. package/dist/adapters/database/domains/robot-permission/entity.mjs +2 -2
  44. package/dist/adapters/database/domains/role/repository.mjs +1 -1
  45. package/dist/adapters/database/domains/role-permission/entity.mjs +2 -2
  46. package/dist/adapters/database/domains/session/entity.d.ts +3 -1
  47. package/dist/adapters/database/domains/session/entity.d.ts.map +1 -1
  48. package/dist/adapters/database/domains/session/entity.mjs +12 -0
  49. package/dist/adapters/database/domains/session/entity.mjs.map +1 -1
  50. package/dist/adapters/database/domains/trust-anchor/entity.d.ts +13 -0
  51. package/dist/adapters/database/domains/trust-anchor/entity.d.ts.map +1 -0
  52. package/dist/adapters/database/domains/trust-anchor/entity.mjs +55 -0
  53. package/dist/adapters/database/domains/trust-anchor/entity.mjs.map +1 -0
  54. package/dist/adapters/database/domains/trust-anchor/index.d.ts +2 -0
  55. package/dist/adapters/database/domains/trust-anchor/index.d.ts.map +1 -0
  56. package/dist/adapters/database/domains/trust-anchor/index.mjs +5 -0
  57. package/dist/adapters/database/domains/user-authenticator/entity.d.ts +20 -0
  58. package/dist/adapters/database/domains/user-authenticator/entity.d.ts.map +1 -0
  59. package/dist/adapters/database/domains/user-authenticator/entity.mjs +98 -0
  60. package/dist/adapters/database/domains/user-authenticator/entity.mjs.map +1 -0
  61. package/dist/adapters/database/domains/user-authenticator/index.d.ts +2 -0
  62. package/dist/adapters/database/domains/user-authenticator/index.d.ts.map +1 -0
  63. package/dist/adapters/database/domains/user-authenticator/index.mjs +5 -0
  64. package/dist/adapters/database/domains/user-permission/entity.mjs +1 -1
  65. package/dist/adapters/database/errors/driver.d.ts +14 -0
  66. package/dist/adapters/database/errors/driver.d.ts.map +1 -0
  67. package/dist/adapters/database/errors/driver.mjs +32 -0
  68. package/dist/adapters/database/errors/driver.mjs.map +1 -0
  69. package/dist/adapters/database/errors/index.d.ts +1 -0
  70. package/dist/adapters/database/errors/index.d.ts.map +1 -1
  71. package/dist/adapters/database/errors/index.mjs +2 -1
  72. package/dist/adapters/database/index.mjs +17 -11
  73. package/dist/adapters/database/migrations/mysql/1783769340000-Default.d.ts +50 -0
  74. package/dist/adapters/database/migrations/mysql/1783769340000-Default.d.ts.map +1 -0
  75. package/dist/adapters/database/migrations/mysql/1783769340000-Default.mjs +320 -0
  76. package/dist/adapters/database/migrations/mysql/1783769340000-Default.mjs.map +1 -0
  77. package/dist/adapters/database/migrations/postgres/1783769340000-Default.d.ts +50 -0
  78. package/dist/adapters/database/migrations/postgres/1783769340000-Default.d.ts.map +1 -0
  79. package/dist/adapters/database/migrations/postgres/1783769340000-Default.mjs +310 -0
  80. package/dist/adapters/database/migrations/postgres/1783769340000-Default.mjs.map +1 -0
  81. package/dist/adapters/database/subscriber/module.d.ts +1 -1
  82. package/dist/adapters/database/subscriber/module.d.ts.map +1 -1
  83. package/dist/adapters/database/subscriber/module.mjs +4 -3
  84. package/dist/adapters/database/subscriber/module.mjs.map +1 -1
  85. package/dist/adapters/http/adapters/index.mjs +2 -1
  86. package/dist/adapters/http/adapters/oauth2/authorization/module.d.ts +4 -1
  87. package/dist/adapters/http/adapters/oauth2/authorization/module.d.ts.map +1 -1
  88. package/dist/adapters/http/adapters/oauth2/authorization/module.mjs +27 -2
  89. package/dist/adapters/http/adapters/oauth2/authorization/module.mjs.map +1 -1
  90. package/dist/adapters/http/adapters/oauth2/authorization/types.d.ts +9 -1
  91. package/dist/adapters/http/adapters/oauth2/authorization/types.d.ts.map +1 -1
  92. package/dist/adapters/http/adapters/oauth2/grant-types/authorize.d.ts +4 -1
  93. package/dist/adapters/http/adapters/oauth2/grant-types/authorize.d.ts.map +1 -1
  94. package/dist/adapters/http/adapters/oauth2/grant-types/authorize.mjs +23 -3
  95. package/dist/adapters/http/adapters/oauth2/grant-types/authorize.mjs.map +1 -1
  96. package/dist/adapters/http/adapters/oauth2/grant-types/client-credentials.d.ts +4 -3
  97. package/dist/adapters/http/adapters/oauth2/grant-types/client-credentials.d.ts.map +1 -1
  98. package/dist/adapters/http/adapters/oauth2/grant-types/client-credentials.mjs +13 -6
  99. package/dist/adapters/http/adapters/oauth2/grant-types/client-credentials.mjs.map +1 -1
  100. package/dist/adapters/http/adapters/oauth2/grant-types/index.mjs +2 -1
  101. package/dist/adapters/http/adapters/oauth2/grant-types/password.d.ts +38 -2
  102. package/dist/adapters/http/adapters/oauth2/grant-types/password.d.ts.map +1 -1
  103. package/dist/adapters/http/adapters/oauth2/grant-types/password.mjs +119 -6
  104. package/dist/adapters/http/adapters/oauth2/grant-types/password.mjs.map +1 -1
  105. package/dist/adapters/http/adapters/oauth2/grant-types/refresh_token.d.ts +2 -0
  106. package/dist/adapters/http/adapters/oauth2/grant-types/refresh_token.d.ts.map +1 -1
  107. package/dist/adapters/http/adapters/oauth2/grant-types/refresh_token.mjs +16 -3
  108. package/dist/adapters/http/adapters/oauth2/grant-types/refresh_token.mjs.map +1 -1
  109. package/dist/adapters/http/adapters/oauth2/grant-types/types.d.ts +14 -3
  110. package/dist/adapters/http/adapters/oauth2/grant-types/types.d.ts.map +1 -1
  111. package/dist/adapters/http/adapters/oauth2/grant-types/utils/certificate.d.ts +5 -0
  112. package/dist/adapters/http/adapters/oauth2/grant-types/utils/certificate.d.ts.map +1 -0
  113. package/dist/adapters/http/adapters/oauth2/grant-types/utils/certificate.mjs +18 -0
  114. package/dist/adapters/http/adapters/oauth2/grant-types/utils/certificate.mjs.map +1 -0
  115. package/dist/adapters/http/adapters/oauth2/grant-types/utils/credentials.mjs +1 -1
  116. package/dist/adapters/http/adapters/oauth2/grant-types/utils/guess.mjs +1 -1
  117. package/dist/adapters/http/adapters/oauth2/grant-types/utils/index.d.ts +1 -0
  118. package/dist/adapters/http/adapters/oauth2/grant-types/utils/index.d.ts.map +1 -1
  119. package/dist/adapters/http/adapters/oauth2/grant-types/utils/index.mjs +2 -1
  120. package/dist/adapters/http/adapters/oauth2/index.mjs +2 -1
  121. package/dist/adapters/http/controllers/entities/consent/index.d.ts +2 -0
  122. package/dist/adapters/http/controllers/entities/consent/index.d.ts.map +1 -0
  123. package/dist/adapters/http/controllers/entities/consent/index.mjs +5 -0
  124. package/dist/adapters/http/controllers/entities/consent/module.d.ts +15 -0
  125. package/dist/adapters/http/controllers/entities/consent/module.d.ts.map +1 -0
  126. package/dist/adapters/http/controllers/entities/consent/module.mjs +82 -0
  127. package/dist/adapters/http/controllers/entities/consent/module.mjs.map +1 -0
  128. package/dist/adapters/http/controllers/entities/event/index.d.ts +2 -0
  129. package/dist/adapters/http/controllers/entities/event/index.d.ts.map +1 -0
  130. package/dist/adapters/http/controllers/entities/event/index.mjs +5 -0
  131. package/dist/adapters/http/controllers/entities/event/module.d.ts +14 -0
  132. package/dist/adapters/http/controllers/entities/event/module.d.ts.map +1 -0
  133. package/dist/adapters/http/controllers/entities/event/module.mjs +68 -0
  134. package/dist/adapters/http/controllers/entities/event/module.mjs.map +1 -0
  135. package/dist/adapters/http/controllers/entities/identity-provider/module.d.ts +4 -1
  136. package/dist/adapters/http/controllers/entities/identity-provider/module.d.ts.map +1 -1
  137. package/dist/adapters/http/controllers/entities/identity-provider/module.mjs +38 -10
  138. package/dist/adapters/http/controllers/entities/identity-provider/module.mjs.map +1 -1
  139. package/dist/adapters/http/controllers/entities/identity-provider/types.d.ts +3 -1
  140. package/dist/adapters/http/controllers/entities/identity-provider/types.d.ts.map +1 -1
  141. package/dist/adapters/http/controllers/entities/index.d.ts +5 -0
  142. package/dist/adapters/http/controllers/entities/index.d.ts.map +1 -1
  143. package/dist/adapters/http/controllers/entities/index.mjs +11 -1
  144. package/dist/adapters/http/controllers/entities/key/index.d.ts +2 -0
  145. package/dist/adapters/http/controllers/entities/key/index.d.ts.map +1 -0
  146. package/dist/adapters/http/controllers/entities/key/index.mjs +5 -0
  147. package/dist/adapters/http/controllers/entities/key/module.d.ts +17 -0
  148. package/dist/adapters/http/controllers/entities/key/module.d.ts.map +1 -0
  149. package/dist/adapters/http/controllers/entities/key/module.mjs +122 -0
  150. package/dist/adapters/http/controllers/entities/key/module.mjs.map +1 -0
  151. package/dist/adapters/http/controllers/entities/policy/utils/validation.mjs +1 -1
  152. package/dist/adapters/http/controllers/entities/realm/module.d.ts +2 -0
  153. package/dist/adapters/http/controllers/entities/realm/module.d.ts.map +1 -1
  154. package/dist/adapters/http/controllers/entities/realm/module.mjs +16 -1
  155. package/dist/adapters/http/controllers/entities/realm/module.mjs.map +1 -1
  156. package/dist/adapters/http/controllers/entities/trust-anchor/index.d.ts +2 -0
  157. package/dist/adapters/http/controllers/entities/trust-anchor/index.d.ts.map +1 -0
  158. package/dist/adapters/http/controllers/entities/trust-anchor/index.mjs +5 -0
  159. package/dist/adapters/http/controllers/entities/trust-anchor/module.d.ts +17 -0
  160. package/dist/adapters/http/controllers/entities/trust-anchor/module.d.ts.map +1 -0
  161. package/dist/adapters/http/controllers/entities/trust-anchor/module.mjs +120 -0
  162. package/dist/adapters/http/controllers/entities/trust-anchor/module.mjs.map +1 -0
  163. package/dist/adapters/http/controllers/entities/user-authenticator/index.d.ts +2 -0
  164. package/dist/adapters/http/controllers/entities/user-authenticator/index.d.ts.map +1 -0
  165. package/dist/adapters/http/controllers/entities/user-authenticator/index.mjs +5 -0
  166. package/dist/adapters/http/controllers/entities/user-authenticator/module.d.ts +21 -0
  167. package/dist/adapters/http/controllers/entities/user-authenticator/module.d.ts.map +1 -0
  168. package/dist/adapters/http/controllers/entities/user-authenticator/module.mjs +154 -0
  169. package/dist/adapters/http/controllers/entities/user-authenticator/module.mjs.map +1 -0
  170. package/dist/adapters/http/controllers/index.mjs +7 -1
  171. package/dist/adapters/http/controllers/workflows/authenticator-challenge/index.d.ts +2 -0
  172. package/dist/adapters/http/controllers/workflows/authenticator-challenge/index.d.ts.map +1 -0
  173. package/dist/adapters/http/controllers/workflows/authenticator-challenge/index.mjs +5 -0
  174. package/dist/adapters/http/controllers/workflows/authenticator-challenge/module.d.ts +46 -0
  175. package/dist/adapters/http/controllers/workflows/authenticator-challenge/module.d.ts.map +1 -0
  176. package/dist/adapters/http/controllers/workflows/authenticator-challenge/module.mjs +132 -0
  177. package/dist/adapters/http/controllers/workflows/authenticator-challenge/module.mjs.map +1 -0
  178. package/dist/adapters/http/controllers/workflows/authorize/module.d.ts.map +1 -1
  179. package/dist/adapters/http/controllers/workflows/authorize/module.mjs +34 -6
  180. package/dist/adapters/http/controllers/workflows/authorize/module.mjs.map +1 -1
  181. package/dist/adapters/http/controllers/workflows/authorize/types.d.ts +17 -1
  182. package/dist/adapters/http/controllers/workflows/authorize/types.d.ts.map +1 -1
  183. package/dist/adapters/http/controllers/workflows/index.d.ts +1 -0
  184. package/dist/adapters/http/controllers/workflows/index.d.ts.map +1 -1
  185. package/dist/adapters/http/controllers/workflows/index.mjs +3 -1
  186. package/dist/adapters/http/controllers/workflows/jwks/handlers/read.d.ts.map +1 -1
  187. package/dist/adapters/http/controllers/workflows/jwks/handlers/read.mjs +28 -14
  188. package/dist/adapters/http/controllers/workflows/jwks/handlers/read.mjs.map +1 -1
  189. package/dist/adapters/http/controllers/workflows/jwks/module.d.ts.map +1 -1
  190. package/dist/adapters/http/controllers/workflows/jwks/module.mjs +28 -14
  191. package/dist/adapters/http/controllers/workflows/jwks/module.mjs.map +1 -1
  192. package/dist/adapters/http/controllers/workflows/token/module.d.ts +2 -1
  193. package/dist/adapters/http/controllers/workflows/token/module.d.ts.map +1 -1
  194. package/dist/adapters/http/controllers/workflows/token/module.mjs +28 -8
  195. package/dist/adapters/http/controllers/workflows/token/module.mjs.map +1 -1
  196. package/dist/adapters/http/controllers/workflows/token/types.d.ts +11 -4
  197. package/dist/adapters/http/controllers/workflows/token/types.d.ts.map +1 -1
  198. package/dist/adapters/http/index.mjs +13 -3
  199. package/dist/adapters/http/middleware/built-in/assets.mjs +1 -1
  200. package/dist/adapters/http/middleware/built-in/authorization/module.d.ts +13 -0
  201. package/dist/adapters/http/middleware/built-in/authorization/module.d.ts.map +1 -1
  202. package/dist/adapters/http/middleware/built-in/authorization/module.mjs +52 -2
  203. package/dist/adapters/http/middleware/built-in/authorization/module.mjs.map +1 -1
  204. package/dist/adapters/http/middleware/built-in/authorization/types.d.ts +2 -0
  205. package/dist/adapters/http/middleware/built-in/authorization/types.d.ts.map +1 -1
  206. package/dist/adapters/http/middleware/built-in/index.mjs +2 -2
  207. package/dist/adapters/http/middleware/built-in/prometheus.d.ts +12 -1
  208. package/dist/adapters/http/middleware/built-in/prometheus.d.ts.map +1 -1
  209. package/dist/adapters/http/middleware/built-in/prometheus.mjs +75 -6
  210. package/dist/adapters/http/middleware/built-in/prometheus.mjs.map +1 -1
  211. package/dist/adapters/http/middleware/index.mjs +2 -2
  212. package/dist/adapters/http/request/client-certificate.d.ts +5 -0
  213. package/dist/adapters/http/request/client-certificate.d.ts.map +1 -0
  214. package/dist/adapters/http/request/client-certificate.mjs +88 -0
  215. package/dist/adapters/http/request/client-certificate.mjs.map +1 -0
  216. package/dist/adapters/http/request/constants.d.ts +1 -0
  217. package/dist/adapters/http/request/constants.d.ts.map +1 -1
  218. package/dist/adapters/http/request/constants.mjs +6 -1
  219. package/dist/adapters/http/request/constants.mjs.map +1 -1
  220. package/dist/adapters/http/request/event-context.d.ts +19 -0
  221. package/dist/adapters/http/request/event-context.d.ts.map +1 -0
  222. package/dist/adapters/http/request/event-context.mjs +37 -0
  223. package/dist/adapters/http/request/event-context.mjs.map +1 -0
  224. package/dist/adapters/http/request/helpers/index.d.ts +1 -0
  225. package/dist/adapters/http/request/helpers/index.d.ts.map +1 -1
  226. package/dist/adapters/http/request/helpers/index.mjs +2 -1
  227. package/dist/adapters/http/request/helpers/mfa-login-ticket.d.ts +16 -0
  228. package/dist/adapters/http/request/helpers/mfa-login-ticket.d.ts.map +1 -0
  229. package/dist/adapters/http/request/helpers/mfa-login-ticket.mjs +15 -0
  230. package/dist/adapters/http/request/helpers/mfa-login-ticket.mjs.map +1 -0
  231. package/dist/adapters/http/request/index.d.ts +3 -0
  232. package/dist/adapters/http/request/index.d.ts.map +1 -1
  233. package/dist/adapters/http/request/index.mjs +5 -2
  234. package/dist/adapters/http/request/types.d.ts +3 -0
  235. package/dist/adapters/http/request/types.d.ts.map +1 -0
  236. package/dist/adapters/http/ui/render.mjs +2 -2
  237. package/dist/app/index.mjs +11 -5
  238. package/dist/app/modules/components/module.d.ts.map +1 -1
  239. package/dist/app/modules/components/module.mjs +22 -2
  240. package/dist/app/modules/components/module.mjs.map +1 -1
  241. package/dist/app/modules/config/constants.d.ts +14 -0
  242. package/dist/app/modules/config/constants.d.ts.map +1 -1
  243. package/dist/app/modules/config/constants.mjs +14 -0
  244. package/dist/app/modules/config/constants.mjs.map +1 -1
  245. package/dist/app/modules/config/normalize.d.ts.map +1 -1
  246. package/dist/app/modules/config/normalize.mjs +30 -2
  247. package/dist/app/modules/config/normalize.mjs.map +1 -1
  248. package/dist/app/modules/config/read/env.d.ts.map +1 -1
  249. package/dist/app/modules/config/read/env.mjs +57 -0
  250. package/dist/app/modules/config/read/env.mjs.map +1 -1
  251. package/dist/app/modules/config/types.d.ts +101 -0
  252. package/dist/app/modules/config/types.d.ts.map +1 -1
  253. package/dist/app/modules/config/validator.d.ts.map +1 -1
  254. package/dist/app/modules/config/validator.mjs +16 -0
  255. package/dist/app/modules/config/validator.mjs.map +1 -1
  256. package/dist/app/modules/database/constants.d.ts +3 -0
  257. package/dist/app/modules/database/constants.d.ts.map +1 -1
  258. package/dist/app/modules/database/constants.mjs +3 -1
  259. package/dist/app/modules/database/constants.mjs.map +1 -1
  260. package/dist/app/modules/database/index.mjs +7 -3
  261. package/dist/app/modules/database/module.d.ts +1 -0
  262. package/dist/app/modules/database/module.d.ts.map +1 -1
  263. package/dist/app/modules/database/module.mjs +32 -1
  264. package/dist/app/modules/database/module.mjs.map +1 -1
  265. package/dist/app/modules/database/repositories/client/repository.d.ts.map +1 -1
  266. package/dist/app/modules/database/repositories/client/repository.mjs +8 -4
  267. package/dist/app/modules/database/repositories/client/repository.mjs.map +1 -1
  268. package/dist/app/modules/database/repositories/event/index.d.ts.map +1 -0
  269. package/dist/app/modules/database/repositories/event/index.mjs +5 -0
  270. package/dist/app/modules/database/repositories/event/repository.d.ts +15 -0
  271. package/dist/app/modules/database/repositories/event/repository.d.ts.map +1 -0
  272. package/dist/app/modules/database/repositories/event/repository.mjs +113 -0
  273. package/dist/app/modules/database/repositories/event/repository.mjs.map +1 -0
  274. package/dist/app/modules/database/repositories/helpers.d.ts +4 -2
  275. package/dist/app/modules/database/repositories/helpers.d.ts.map +1 -1
  276. package/dist/app/modules/database/repositories/helpers.mjs +7 -3
  277. package/dist/app/modules/database/repositories/helpers.mjs.map +1 -1
  278. package/dist/app/modules/database/repositories/index.d.ts +4 -0
  279. package/dist/app/modules/database/repositories/index.d.ts.map +1 -1
  280. package/dist/app/modules/database/repositories/index.mjs +9 -1
  281. package/dist/app/modules/database/repositories/key/index.d.ts +2 -0
  282. package/dist/app/modules/database/repositories/key/index.d.ts.map +1 -0
  283. package/dist/app/modules/database/repositories/key/index.mjs +5 -0
  284. package/dist/app/modules/database/repositories/key/repository.d.ts +50 -0
  285. package/dist/app/modules/database/repositories/key/repository.d.ts.map +1 -0
  286. package/dist/app/modules/database/repositories/key/repository.mjs +273 -0
  287. package/dist/app/modules/database/repositories/key/repository.mjs.map +1 -0
  288. package/dist/app/modules/database/repositories/permission-provider/module.mjs +1 -1
  289. package/dist/app/modules/database/repositories/trust-anchor/index.d.ts +2 -0
  290. package/dist/app/modules/database/repositories/trust-anchor/index.d.ts.map +1 -0
  291. package/dist/app/modules/database/repositories/trust-anchor/index.mjs +5 -0
  292. package/dist/app/modules/database/repositories/trust-anchor/repository.d.ts +24 -0
  293. package/dist/app/modules/database/repositories/trust-anchor/repository.d.ts.map +1 -0
  294. package/dist/app/modules/database/repositories/trust-anchor/repository.mjs +113 -0
  295. package/dist/app/modules/database/repositories/trust-anchor/repository.mjs.map +1 -0
  296. package/dist/app/modules/database/repositories/user-authenticator/index.d.ts +2 -0
  297. package/dist/app/modules/database/repositories/user-authenticator/index.d.ts.map +1 -0
  298. package/dist/app/modules/database/repositories/user-authenticator/index.mjs +5 -0
  299. package/dist/app/modules/database/repositories/user-authenticator/repository.d.ts +19 -0
  300. package/dist/app/modules/database/repositories/user-authenticator/repository.d.ts.map +1 -0
  301. package/dist/app/modules/database/repositories/user-authenticator/repository.mjs +92 -0
  302. package/dist/app/modules/database/repositories/user-authenticator/repository.mjs.map +1 -0
  303. package/dist/app/modules/http/module.d.ts +8 -0
  304. package/dist/app/modules/http/module.d.ts.map +1 -1
  305. package/dist/app/modules/http/module.mjs +19 -1
  306. package/dist/app/modules/http/module.mjs.map +1 -1
  307. package/dist/app/modules/http/modules/controller.d.ts +16 -3
  308. package/dist/app/modules/http/modules/controller.d.ts.map +1 -1
  309. package/dist/app/modules/http/modules/controller.mjs +186 -15
  310. package/dist/app/modules/http/modules/controller.mjs.map +1 -1
  311. package/dist/app/modules/http/modules/middleware.d.ts +1 -0
  312. package/dist/app/modules/http/modules/middleware.d.ts.map +1 -1
  313. package/dist/app/modules/http/modules/middleware.mjs +10 -4
  314. package/dist/app/modules/http/modules/middleware.mjs.map +1 -1
  315. package/dist/app/modules/identity/module.mjs +2 -2
  316. package/dist/app/modules/index.d.ts +1 -0
  317. package/dist/app/modules/index.d.ts.map +1 -1
  318. package/dist/app/modules/index.mjs +13 -6
  319. package/dist/app/modules/mail/module.d.ts.map +1 -1
  320. package/dist/app/modules/mail/module.mjs +2 -1
  321. package/dist/app/modules/mail/module.mjs.map +1 -1
  322. package/dist/app/modules/metrics/constants.d.ts +4 -0
  323. package/dist/app/modules/metrics/constants.d.ts.map +1 -0
  324. package/dist/app/modules/metrics/constants.mjs +10 -0
  325. package/dist/app/modules/metrics/constants.mjs.map +1 -0
  326. package/dist/app/modules/metrics/index.d.ts +3 -0
  327. package/dist/app/modules/metrics/index.d.ts.map +1 -0
  328. package/dist/app/modules/metrics/index.mjs +6 -0
  329. package/dist/app/modules/metrics/prom.d.ts +15 -0
  330. package/dist/app/modules/metrics/prom.d.ts.map +1 -0
  331. package/dist/app/modules/metrics/prom.mjs +42 -0
  332. package/dist/app/modules/metrics/prom.mjs.map +1 -0
  333. package/dist/app/modules/oauth2/constants.d.ts +9 -2
  334. package/dist/app/modules/oauth2/constants.d.ts.map +1 -1
  335. package/dist/app/modules/oauth2/constants.mjs +7 -1
  336. package/dist/app/modules/oauth2/constants.mjs.map +1 -1
  337. package/dist/app/modules/oauth2/module.d.ts.map +1 -1
  338. package/dist/app/modules/oauth2/module.mjs +23 -4
  339. package/dist/app/modules/oauth2/module.mjs.map +1 -1
  340. package/dist/app/modules/oauth2/repositories/consent/index.d.ts +2 -0
  341. package/dist/app/modules/oauth2/repositories/consent/index.d.ts.map +1 -0
  342. package/dist/app/modules/oauth2/repositories/consent/index.mjs +5 -0
  343. package/dist/app/modules/oauth2/repositories/consent/repository.d.ts +20 -0
  344. package/dist/app/modules/oauth2/repositories/consent/repository.d.ts.map +1 -0
  345. package/dist/app/modules/oauth2/repositories/consent/repository.mjs +116 -0
  346. package/dist/app/modules/oauth2/repositories/consent/repository.mjs.map +1 -0
  347. package/dist/app/modules/oauth2/repositories/index.d.ts +1 -1
  348. package/dist/app/modules/oauth2/repositories/index.d.ts.map +1 -1
  349. package/dist/app/modules/oauth2/repositories/index.mjs +3 -3
  350. package/dist/app/modules/oauth2/repositories/token/repository.d.ts +1 -0
  351. package/dist/app/modules/oauth2/repositories/token/repository.d.ts.map +1 -1
  352. package/dist/app/modules/oauth2/repositories/token/repository.mjs +8 -0
  353. package/dist/app/modules/oauth2/repositories/token/repository.mjs.map +1 -1
  354. package/dist/app/modules/provisioning/module.d.ts.map +1 -1
  355. package/dist/app/modules/provisioning/module.mjs +16 -5
  356. package/dist/app/modules/provisioning/module.mjs.map +1 -1
  357. package/dist/app/modules/provisioning/sources/default/module.d.ts.map +1 -1
  358. package/dist/app/modules/provisioning/sources/default/module.mjs +22 -7
  359. package/dist/app/modules/provisioning/sources/default/module.mjs.map +1 -1
  360. package/dist/app/modules/provisioning/sources/file/module.d.ts.map +1 -1
  361. package/dist/app/modules/provisioning/sources/file/module.mjs +12 -2
  362. package/dist/app/modules/provisioning/sources/file/module.mjs.map +1 -1
  363. package/dist/components/event-cleaner/index.d.ts +2 -0
  364. package/dist/components/event-cleaner/index.d.ts.map +1 -0
  365. package/dist/components/event-cleaner/index.mjs +5 -0
  366. package/dist/components/event-cleaner/module.d.ts +5 -0
  367. package/dist/components/event-cleaner/module.d.ts.map +1 -0
  368. package/dist/components/event-cleaner/module.mjs +30 -0
  369. package/dist/components/event-cleaner/module.mjs.map +1 -0
  370. package/dist/components/index.d.ts +1 -0
  371. package/dist/components/index.d.ts.map +1 -1
  372. package/dist/components/index.mjs +3 -1
  373. package/dist/components/oauth2-cleaner/module.d.ts +2 -1
  374. package/dist/components/oauth2-cleaner/module.d.ts.map +1 -1
  375. package/dist/components/oauth2-cleaner/module.mjs +9 -4
  376. package/dist/components/oauth2-cleaner/module.mjs.map +1 -1
  377. package/dist/core/authentication/credential/entities/client/module.d.ts +1 -1
  378. package/dist/core/authentication/credential/entities/client/module.d.ts.map +1 -1
  379. package/dist/core/authentication/credential/entities/client/module.mjs +2 -1
  380. package/dist/core/authentication/credential/entities/client/module.mjs.map +1 -1
  381. package/dist/core/authentication/entities/client/module.mjs +2 -2
  382. package/dist/core/authentication/entities/client/module.mjs.map +1 -1
  383. package/dist/core/authentication/index.d.ts +1 -0
  384. package/dist/core/authentication/index.d.ts.map +1 -1
  385. package/dist/core/authentication/index.mjs +3 -1
  386. package/dist/core/authentication/login-throttle/index.d.ts +3 -0
  387. package/dist/core/authentication/login-throttle/index.d.ts.map +1 -0
  388. package/dist/core/authentication/login-throttle/index.mjs +5 -0
  389. package/dist/core/authentication/login-throttle/service.d.ts +13 -0
  390. package/dist/core/authentication/login-throttle/service.d.ts.map +1 -0
  391. package/dist/core/authentication/login-throttle/service.mjs +33 -0
  392. package/dist/core/authentication/login-throttle/service.mjs.map +1 -0
  393. package/dist/core/authentication/login-throttle/types.d.ts +34 -0
  394. package/dist/core/authentication/login-throttle/types.d.ts.map +1 -0
  395. package/dist/core/authentication/session/module.d.ts +1 -0
  396. package/dist/core/authentication/session/module.d.ts.map +1 -1
  397. package/dist/core/authentication/session/module.mjs +4 -0
  398. package/dist/core/authentication/session/module.mjs.map +1 -1
  399. package/dist/core/authentication/session/types.d.ts +6 -0
  400. package/dist/core/authentication/session/types.d.ts.map +1 -1
  401. package/dist/core/authentication/session/types.mjs.map +1 -1
  402. package/dist/core/client-certificate/index.d.ts +3 -0
  403. package/dist/core/client-certificate/index.d.ts.map +1 -0
  404. package/dist/core/client-certificate/index.mjs +5 -0
  405. package/dist/core/client-certificate/module.d.ts +18 -0
  406. package/dist/core/client-certificate/module.d.ts.map +1 -0
  407. package/dist/core/client-certificate/module.mjs +195 -0
  408. package/dist/core/client-certificate/module.mjs.map +1 -0
  409. package/dist/core/client-certificate/types.d.ts +22 -0
  410. package/dist/core/client-certificate/types.d.ts.map +1 -0
  411. package/dist/core/client-certificate/types.mjs +4 -0
  412. package/dist/core/entities/client/service.d.ts.map +1 -1
  413. package/dist/core/entities/client/service.mjs +15 -7
  414. package/dist/core/entities/client/service.mjs.map +1 -1
  415. package/dist/core/entities/client/web-client.d.ts.map +1 -1
  416. package/dist/core/entities/client/web-client.mjs +3 -2
  417. package/dist/core/entities/client/web-client.mjs.map +1 -1
  418. package/dist/core/entities/consent/index.d.ts +3 -0
  419. package/dist/core/entities/consent/index.d.ts.map +1 -0
  420. package/dist/core/entities/consent/index.mjs +6 -0
  421. package/dist/core/entities/consent/service.d.ts +19 -0
  422. package/dist/core/entities/consent/service.d.ts.map +1 -0
  423. package/dist/core/entities/consent/service.mjs +122 -0
  424. package/dist/core/entities/consent/service.mjs.map +1 -0
  425. package/dist/core/entities/consent/types.d.ts +97 -0
  426. package/dist/core/entities/consent/types.d.ts.map +1 -0
  427. package/dist/core/entities/consent/types.mjs +25 -0
  428. package/dist/core/entities/consent/types.mjs.map +1 -0
  429. package/dist/core/entities/event/constants.d.ts +7 -0
  430. package/dist/core/entities/event/constants.d.ts.map +1 -0
  431. package/dist/core/entities/event/constants.mjs +13 -0
  432. package/dist/core/entities/event/constants.mjs.map +1 -0
  433. package/dist/core/entities/event/diff.d.ts +20 -0
  434. package/dist/core/entities/event/diff.d.ts.map +1 -0
  435. package/dist/core/entities/event/diff.mjs +45 -0
  436. package/dist/core/entities/event/diff.mjs.map +1 -0
  437. package/dist/core/entities/event/entity-event-handler.d.ts +19 -0
  438. package/dist/core/entities/event/entity-event-handler.d.ts.map +1 -0
  439. package/dist/core/entities/event/entity-event-handler.mjs +100 -0
  440. package/dist/core/entities/event/entity-event-handler.mjs.map +1 -0
  441. package/dist/core/entities/event/index.d.ts +7 -0
  442. package/dist/core/entities/event/index.d.ts.map +1 -0
  443. package/dist/core/entities/event/index.mjs +9 -0
  444. package/dist/core/entities/event/sanitize.d.ts +2 -0
  445. package/dist/core/entities/event/sanitize.d.ts.map +1 -0
  446. package/dist/core/entities/event/sanitize.mjs +83 -0
  447. package/dist/core/entities/event/sanitize.mjs.map +1 -0
  448. package/dist/core/entities/event/service.d.ts +22 -0
  449. package/dist/core/entities/event/service.d.ts.map +1 -0
  450. package/dist/core/entities/event/service.mjs +169 -0
  451. package/dist/core/entities/event/service.mjs.map +1 -0
  452. package/dist/core/entities/event/types.d.ts +124 -0
  453. package/dist/core/entities/event/types.d.ts.map +1 -0
  454. package/dist/core/entities/event/types.mjs +4 -0
  455. package/dist/core/entities/identity-provider-role-mapping/service.mjs +2 -2
  456. package/dist/core/entities/identity-provider-role-mapping/service.mjs.map +1 -1
  457. package/dist/core/entities/index.d.ts +5 -0
  458. package/dist/core/entities/index.d.ts.map +1 -1
  459. package/dist/core/entities/index.mjs +20 -1
  460. package/dist/core/entities/key/index.d.ts +3 -0
  461. package/dist/core/entities/key/index.d.ts.map +1 -0
  462. package/dist/core/entities/key/index.mjs +5 -0
  463. package/dist/core/entities/key/service.d.ts +55 -0
  464. package/dist/core/entities/key/service.d.ts.map +1 -0
  465. package/dist/core/entities/key/service.mjs +301 -0
  466. package/dist/core/entities/key/service.mjs.map +1 -0
  467. package/dist/core/entities/key/types.d.ts +33 -0
  468. package/dist/core/entities/key/types.d.ts.map +1 -0
  469. package/dist/core/entities/key/types.mjs +4 -0
  470. package/dist/core/entities/permission/service.mjs +3 -3
  471. package/dist/core/entities/permission/service.mjs.map +1 -1
  472. package/dist/core/entities/policy/service.mjs +4 -4
  473. package/dist/core/entities/policy/service.mjs.map +1 -1
  474. package/dist/core/entities/realm/service.d.ts +3 -0
  475. package/dist/core/entities/realm/service.d.ts.map +1 -1
  476. package/dist/core/entities/realm/service.mjs +6 -3
  477. package/dist/core/entities/realm/service.mjs.map +1 -1
  478. package/dist/core/entities/role/service.mjs +2 -2
  479. package/dist/core/entities/role/service.mjs.map +1 -1
  480. package/dist/core/entities/role-attribute/service.mjs +3 -3
  481. package/dist/core/entities/role-attribute/service.mjs.map +1 -1
  482. package/dist/core/entities/session/service.mjs +5 -2
  483. package/dist/core/entities/session/service.mjs.map +1 -1
  484. package/dist/core/entities/trust-anchor/index.d.ts +3 -0
  485. package/dist/core/entities/trust-anchor/index.d.ts.map +1 -0
  486. package/dist/core/entities/trust-anchor/index.mjs +5 -0
  487. package/dist/core/entities/trust-anchor/service.d.ts +33 -0
  488. package/dist/core/entities/trust-anchor/service.d.ts.map +1 -0
  489. package/dist/core/entities/trust-anchor/service.mjs +175 -0
  490. package/dist/core/entities/trust-anchor/service.mjs.map +1 -0
  491. package/dist/core/entities/trust-anchor/types.d.ts +14 -0
  492. package/dist/core/entities/trust-anchor/types.d.ts.map +1 -0
  493. package/dist/core/entities/trust-anchor/types.mjs +4 -0
  494. package/dist/core/entities/user/service.mjs +2 -2
  495. package/dist/core/entities/user/service.mjs.map +1 -1
  496. package/dist/core/entities/user-attribute/service.mjs +4 -4
  497. package/dist/core/entities/user-attribute/service.mjs.map +1 -1
  498. package/dist/core/entities/user-authenticator/constants.d.ts +26 -0
  499. package/dist/core/entities/user-authenticator/constants.d.ts.map +1 -0
  500. package/dist/core/entities/user-authenticator/constants.mjs +32 -0
  501. package/dist/core/entities/user-authenticator/constants.mjs.map +1 -0
  502. package/dist/core/entities/user-authenticator/helpers.d.ts +10 -0
  503. package/dist/core/entities/user-authenticator/helpers.d.ts.map +1 -0
  504. package/dist/core/entities/user-authenticator/helpers.mjs +35 -0
  505. package/dist/core/entities/user-authenticator/helpers.mjs.map +1 -0
  506. package/dist/core/entities/user-authenticator/index.d.ts +6 -0
  507. package/dist/core/entities/user-authenticator/index.d.ts.map +1 -0
  508. package/dist/core/entities/user-authenticator/index.mjs +9 -0
  509. package/dist/core/entities/user-authenticator/service.d.ts +89 -0
  510. package/dist/core/entities/user-authenticator/service.d.ts.map +1 -0
  511. package/dist/core/entities/user-authenticator/service.mjs +709 -0
  512. package/dist/core/entities/user-authenticator/service.mjs.map +1 -0
  513. package/dist/core/entities/user-authenticator/types.d.ts +221 -0
  514. package/dist/core/entities/user-authenticator/types.d.ts.map +1 -0
  515. package/dist/core/entities/user-authenticator/types.mjs +15 -0
  516. package/dist/core/entities/user-authenticator/types.mjs.map +1 -0
  517. package/dist/core/entities/user-authenticator/webauthn.d.ts +28 -0
  518. package/dist/core/entities/user-authenticator/webauthn.d.ts.map +1 -0
  519. package/dist/core/entities/user-authenticator/webauthn.mjs +88 -0
  520. package/dist/core/entities/user-authenticator/webauthn.mjs.map +1 -0
  521. package/dist/core/identity/index.mjs +2 -1
  522. package/dist/core/identity/password-recovery/disabled.d.ts +2 -2
  523. package/dist/core/identity/password-recovery/disabled.d.ts.map +1 -1
  524. package/dist/core/identity/password-recovery/disabled.mjs +2 -2
  525. package/dist/core/identity/password-recovery/disabled.mjs.map +1 -1
  526. package/dist/core/identity/password-recovery/email-verification-required.d.ts +2 -2
  527. package/dist/core/identity/password-recovery/email-verification-required.d.ts.map +1 -1
  528. package/dist/core/identity/password-recovery/email-verification-required.mjs +2 -2
  529. package/dist/core/identity/password-recovery/email-verification-required.mjs.map +1 -1
  530. package/dist/core/identity/password-recovery/service.d.ts +2 -1
  531. package/dist/core/identity/password-recovery/service.d.ts.map +1 -1
  532. package/dist/core/identity/password-recovery/service.mjs +26 -4
  533. package/dist/core/identity/password-recovery/service.mjs.map +1 -1
  534. package/dist/core/identity/password-recovery/token-expired.d.ts +2 -2
  535. package/dist/core/identity/password-recovery/token-expired.d.ts.map +1 -1
  536. package/dist/core/identity/password-recovery/token-expired.mjs +2 -2
  537. package/dist/core/identity/password-recovery/token-expired.mjs.map +1 -1
  538. package/dist/core/identity/password-recovery/types.d.ts +2 -1
  539. package/dist/core/identity/password-recovery/types.d.ts.map +1 -1
  540. package/dist/core/identity/permission/index.d.ts +1 -0
  541. package/dist/core/identity/permission/index.d.ts.map +1 -1
  542. package/dist/core/identity/permission/index.mjs +2 -1
  543. package/dist/core/identity/policy/checker/service.mjs +1 -1
  544. package/dist/core/identity/policy/checker/service.mjs.map +1 -1
  545. package/dist/core/identity/provider/authentication/protocols/oauth2/module.mjs +2 -2
  546. package/dist/core/identity/provider/authentication/protocols/oauth2/module.mjs.map +1 -1
  547. package/dist/core/identity/registration/error.d.ts +2 -2
  548. package/dist/core/identity/registration/error.d.ts.map +1 -1
  549. package/dist/core/identity/registration/error.mjs +2 -2
  550. package/dist/core/identity/registration/error.mjs.map +1 -1
  551. package/dist/core/identity/registration/service.d.ts +2 -1
  552. package/dist/core/identity/registration/service.d.ts.map +1 -1
  553. package/dist/core/identity/registration/service.mjs +26 -4
  554. package/dist/core/identity/registration/service.mjs.map +1 -1
  555. package/dist/core/identity/registration/types.d.ts +2 -1
  556. package/dist/core/identity/registration/types.d.ts.map +1 -1
  557. package/dist/core/index.d.ts +3 -0
  558. package/dist/core/index.d.ts.map +1 -1
  559. package/dist/core/index.mjs +39 -8
  560. package/dist/core/key/certificate-error.d.ts +10 -0
  561. package/dist/core/key/certificate-error.d.ts.map +1 -0
  562. package/dist/core/key/certificate-error.mjs +19 -0
  563. package/dist/core/key/certificate-error.mjs.map +1 -0
  564. package/dist/core/key/certificate.d.ts +15 -0
  565. package/dist/core/key/certificate.d.ts.map +1 -0
  566. package/dist/core/key/certificate.mjs +72 -0
  567. package/dist/core/key/certificate.mjs.map +1 -0
  568. package/dist/core/key/check.d.ts +3 -0
  569. package/dist/core/key/check.d.ts.map +1 -0
  570. package/dist/core/key/check.mjs +13 -0
  571. package/dist/core/key/check.mjs.map +1 -0
  572. package/dist/core/key/constants.d.ts +10 -0
  573. package/dist/core/key/constants.d.ts.map +1 -0
  574. package/dist/core/key/constants.mjs +15 -0
  575. package/dist/core/key/constants.mjs.map +1 -0
  576. package/dist/core/key/error.d.ts +14 -0
  577. package/dist/core/key/error.d.ts.map +1 -0
  578. package/dist/core/key/error.mjs +23 -0
  579. package/dist/core/key/error.mjs.map +1 -0
  580. package/dist/core/key/index.d.ts +10 -0
  581. package/dist/core/key/index.d.ts.map +1 -0
  582. package/dist/core/key/index.mjs +12 -0
  583. package/dist/core/key/provisioner.d.ts +22 -0
  584. package/dist/core/key/provisioner.d.ts.map +1 -0
  585. package/dist/core/key/provisioner.mjs +30 -0
  586. package/dist/core/key/provisioner.mjs.map +1 -0
  587. package/dist/core/key/realm-cipher.d.ts +20 -0
  588. package/dist/core/key/realm-cipher.d.ts.map +1 -0
  589. package/dist/core/key/realm-cipher.mjs +60 -0
  590. package/dist/core/key/realm-cipher.mjs.map +1 -0
  591. package/dist/core/key/types.d.ts +59 -0
  592. package/dist/core/key/types.d.ts.map +1 -0
  593. package/dist/core/key/types.mjs +4 -0
  594. package/dist/core/key/wrap.d.ts +5 -0
  595. package/dist/core/key/wrap.d.ts.map +1 -0
  596. package/dist/core/key/wrap.mjs +21 -0
  597. package/dist/core/key/wrap.mjs.map +1 -0
  598. package/dist/core/mail/template/registry.d.ts.map +1 -1
  599. package/dist/core/mail/template/registry.mjs +3 -1
  600. package/dist/core/mail/template/registry.mjs.map +1 -1
  601. package/dist/core/mail/template/templates/mfa-email-otp.d.ts +3 -0
  602. package/dist/core/mail/template/templates/mfa-email-otp.d.ts.map +1 -0
  603. package/dist/core/mail/template/templates/mfa-email-otp.mjs +34 -0
  604. package/dist/core/mail/template/templates/mfa-email-otp.mjs.map +1 -0
  605. package/dist/core/mail/template/types.d.ts +6 -1
  606. package/dist/core/mail/template/types.d.ts.map +1 -1
  607. package/dist/core/mail/template/types.mjs +1 -0
  608. package/dist/core/mail/template/types.mjs.map +1 -1
  609. package/dist/core/metrics/index.d.ts +3 -0
  610. package/dist/core/metrics/index.d.ts.map +1 -0
  611. package/dist/core/metrics/index.mjs +5 -0
  612. package/dist/core/metrics/noop.d.ts +8 -0
  613. package/dist/core/metrics/noop.d.ts.map +1 -0
  614. package/dist/core/metrics/noop.mjs +14 -0
  615. package/dist/core/metrics/noop.mjs.map +1 -0
  616. package/dist/core/metrics/types.d.ts +19 -0
  617. package/dist/core/metrics/types.d.ts.map +1 -0
  618. package/dist/core/metrics/types.mjs +4 -0
  619. package/dist/core/oauth2/access-policy/index.d.ts +3 -0
  620. package/dist/core/oauth2/access-policy/index.d.ts.map +1 -0
  621. package/dist/core/oauth2/access-policy/index.mjs +5 -0
  622. package/dist/core/oauth2/access-policy/module.d.ts +12 -0
  623. package/dist/core/oauth2/access-policy/module.d.ts.map +1 -0
  624. package/dist/core/oauth2/access-policy/module.mjs +32 -0
  625. package/dist/core/oauth2/access-policy/module.mjs.map +1 -0
  626. package/dist/core/oauth2/access-policy/types.d.ts +19 -0
  627. package/dist/core/oauth2/access-policy/types.d.ts.map +1 -0
  628. package/dist/core/oauth2/access-policy/types.mjs +4 -0
  629. package/dist/core/oauth2/authorization/code/issuer/module.d.ts.map +1 -1
  630. package/dist/core/oauth2/authorization/code/issuer/module.mjs +2 -0
  631. package/dist/core/oauth2/authorization/code/issuer/module.mjs.map +1 -1
  632. package/dist/core/oauth2/authorization/code/issuer/types.d.ts +6 -1
  633. package/dist/core/oauth2/authorization/code/issuer/types.d.ts.map +1 -1
  634. package/dist/core/oauth2/authorization/code/verifier/module.mjs.map +1 -1
  635. package/dist/core/oauth2/authorization/code-request/validator.d.ts.map +1 -1
  636. package/dist/core/oauth2/authorization/code-request/validator.mjs +1 -0
  637. package/dist/core/oauth2/authorization/code-request/validator.mjs.map +1 -1
  638. package/dist/core/oauth2/authorization/code-request/verifier/module.mjs +3 -3
  639. package/dist/core/oauth2/authorization/code-request/verifier/module.mjs.map +1 -1
  640. package/dist/core/oauth2/authorization/helpers.d.ts +10 -1
  641. package/dist/core/oauth2/authorization/helpers.d.ts.map +1 -1
  642. package/dist/core/oauth2/authorization/helpers.mjs +28 -2
  643. package/dist/core/oauth2/authorization/helpers.mjs.map +1 -1
  644. package/dist/core/oauth2/authorization/index.mjs +2 -2
  645. package/dist/core/oauth2/authorization/module.d.ts +9 -0
  646. package/dist/core/oauth2/authorization/module.d.ts.map +1 -1
  647. package/dist/core/oauth2/authorization/module.mjs +80 -3
  648. package/dist/core/oauth2/authorization/module.mjs.map +1 -1
  649. package/dist/core/oauth2/authorization/types.d.ts +36 -0
  650. package/dist/core/oauth2/authorization/types.d.ts.map +1 -1
  651. package/dist/core/oauth2/client/authenticator.d.ts +16 -7
  652. package/dist/core/oauth2/client/authenticator.d.ts.map +1 -1
  653. package/dist/core/oauth2/client/authenticator.mjs +49 -12
  654. package/dist/core/oauth2/client/authenticator.mjs.map +1 -1
  655. package/dist/core/oauth2/end-session/service.d.ts +2 -1
  656. package/dist/core/oauth2/end-session/service.d.ts.map +1 -1
  657. package/dist/core/oauth2/end-session/service.mjs +13 -0
  658. package/dist/core/oauth2/end-session/service.mjs.map +1 -1
  659. package/dist/core/oauth2/end-session/types.d.ts +2 -1
  660. package/dist/core/oauth2/end-session/types.d.ts.map +1 -1
  661. package/dist/core/oauth2/grant-types/authorize.d.ts +2 -2
  662. package/dist/core/oauth2/grant-types/authorize.d.ts.map +1 -1
  663. package/dist/core/oauth2/grant-types/authorize.mjs +12 -8
  664. package/dist/core/oauth2/grant-types/authorize.mjs.map +1 -1
  665. package/dist/core/oauth2/grant-types/client-credentials.d.ts.map +1 -1
  666. package/dist/core/oauth2/grant-types/client-credentials.mjs +5 -3
  667. package/dist/core/oauth2/grant-types/client-credentials.mjs.map +1 -1
  668. package/dist/core/oauth2/grant-types/identity.d.ts.map +1 -1
  669. package/dist/core/oauth2/grant-types/identity.mjs +10 -3
  670. package/dist/core/oauth2/grant-types/identity.mjs.map +1 -1
  671. package/dist/core/oauth2/grant-types/password.d.ts +9 -0
  672. package/dist/core/oauth2/grant-types/password.d.ts.map +1 -1
  673. package/dist/core/oauth2/grant-types/password.mjs +32 -4
  674. package/dist/core/oauth2/grant-types/password.mjs.map +1 -1
  675. package/dist/core/oauth2/grant-types/refresh-token.d.ts +4 -0
  676. package/dist/core/oauth2/grant-types/refresh-token.d.ts.map +1 -1
  677. package/dist/core/oauth2/grant-types/refresh-token.mjs +17 -1
  678. package/dist/core/oauth2/grant-types/refresh-token.mjs.map +1 -1
  679. package/dist/core/oauth2/grant-types/robot-credentials.d.ts.map +1 -1
  680. package/dist/core/oauth2/grant-types/robot-credentials.mjs +3 -2
  681. package/dist/core/oauth2/grant-types/robot-credentials.mjs.map +1 -1
  682. package/dist/core/oauth2/grant-types/types.d.ts +10 -3
  683. package/dist/core/oauth2/grant-types/types.d.ts.map +1 -1
  684. package/dist/core/oauth2/index.d.ts +2 -1
  685. package/dist/core/oauth2/index.d.ts.map +1 -1
  686. package/dist/core/oauth2/index.mjs +7 -2
  687. package/dist/core/oauth2/mfa-login/index.d.ts +3 -0
  688. package/dist/core/oauth2/mfa-login/index.d.ts.map +1 -0
  689. package/dist/core/oauth2/mfa-login/index.mjs +5 -0
  690. package/dist/core/oauth2/mfa-login/module.d.ts +19 -0
  691. package/dist/core/oauth2/mfa-login/module.d.ts.map +1 -0
  692. package/dist/core/oauth2/mfa-login/module.mjs +109 -0
  693. package/dist/core/oauth2/mfa-login/module.mjs.map +1 -0
  694. package/dist/core/oauth2/mfa-login/types.d.ts +64 -0
  695. package/dist/core/oauth2/mfa-login/types.d.ts.map +1 -0
  696. package/dist/core/oauth2/mfa-login/types.mjs +4 -0
  697. package/dist/core/oauth2/token/index.mjs +2 -1
  698. package/dist/core/oauth2/token/issuer/index.d.ts +1 -0
  699. package/dist/core/oauth2/token/issuer/index.d.ts.map +1 -1
  700. package/dist/core/oauth2/token/issuer/index.mjs +3 -1
  701. package/dist/core/oauth2/token/issuer/mfa/index.d.ts +2 -0
  702. package/dist/core/oauth2/token/issuer/mfa/index.d.ts.map +1 -0
  703. package/dist/core/oauth2/token/issuer/mfa/index.mjs +5 -0
  704. package/dist/core/oauth2/token/issuer/mfa/module.d.ts +18 -0
  705. package/dist/core/oauth2/token/issuer/mfa/module.d.ts.map +1 -0
  706. package/dist/core/oauth2/token/issuer/mfa/module.mjs +36 -0
  707. package/dist/core/oauth2/token/issuer/mfa/module.mjs.map +1 -0
  708. package/dist/core/oauth2/token/repository/types.d.ts +10 -0
  709. package/dist/core/oauth2/token/repository/types.d.ts.map +1 -1
  710. package/dist/core/oauth2/token/revoker/module.d.ts.map +1 -1
  711. package/dist/core/oauth2/token/revoker/module.mjs +1 -0
  712. package/dist/core/oauth2/token/revoker/module.mjs.map +1 -1
  713. package/dist/core/oauth2/token/signer/module.d.ts +3 -3
  714. package/dist/core/oauth2/token/signer/module.d.ts.map +1 -1
  715. package/dist/core/oauth2/token/signer/module.mjs +5 -6
  716. package/dist/core/oauth2/token/signer/module.mjs.map +1 -1
  717. package/dist/core/oauth2/token/verifier/module.d.ts +3 -3
  718. package/dist/core/oauth2/token/verifier/module.d.ts.map +1 -1
  719. package/dist/core/oauth2/token/verifier/module.mjs +8 -5
  720. package/dist/core/oauth2/token/verifier/module.mjs.map +1 -1
  721. package/dist/index.mjs +52 -30
  722. package/dist/swagger.json +5431 -2952
  723. package/dist/ui/client/.vite/ssr-manifest.json +3888 -864
  724. package/dist/ui/client/assets/index-BmWsoQro.css +2 -0
  725. package/dist/ui/client/assets/{index-CP9HCHoS.js → index-CT0Nq5pA.js} +18 -17
  726. package/dist/ui/client/index.html +2 -2
  727. package/dist/ui/server/server.js +19470 -18436
  728. package/package.json +22 -16
  729. package/dist/app/modules/oauth2/repositories/key/index.d.ts.map +0 -1
  730. package/dist/app/modules/oauth2/repositories/key/index.mjs +0 -5
  731. package/dist/app/modules/oauth2/repositories/key/repository.d.ts +0 -14
  732. package/dist/app/modules/oauth2/repositories/key/repository.d.ts.map +0 -1
  733. package/dist/app/modules/oauth2/repositories/key/repository.mjs +0 -51
  734. package/dist/app/modules/oauth2/repositories/key/repository.mjs.map +0 -1
  735. package/dist/core/oauth2/key/index.d.ts +0 -2
  736. package/dist/core/oauth2/key/index.d.ts.map +0 -1
  737. package/dist/core/oauth2/key/types.d.ts +0 -16
  738. package/dist/core/oauth2/key/types.d.ts.map +0 -1
  739. package/dist/ui/client/assets/index-VM4JXBXw.css +0 -2
  740. /package/dist/{core/oauth2/key → adapters/http/request}/types.mjs +0 -0
  741. /package/dist/app/modules/{oauth2/repositories/key → database/repositories/event}/index.d.ts +0 -0
  742. /package/dist/core/{oauth2/key/index.mjs → authentication/login-throttle/types.mjs} +0 -0
@@ -0,0 +1,60 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { RealmCipherBlobError } from "./error.mjs";
5
+ import "./constants.mjs";
6
+ import { KeyStatus } from "@authup/core-kit";
7
+ import { SymmetricCipher } from "@authup/server-kit";
8
+ import { AuthupError } from "@authup/errors";
9
+ import { JWKUse } from "@authup/specs";
10
+ //#region src/core/key/realm-cipher.ts
11
+ var RealmCipher = class {
12
+ keyStore;
13
+ /**
14
+ * Imported ciphers by key id — key MATERIAL is immutable, so entries
15
+ * never invalidate. Status and realm binding are deliberately NOT
16
+ * cached: decrypt re-resolves the key row every call so disabling a
17
+ * key acts as an immediate, reversible kill switch.
18
+ */ ciphers;
19
+ constructor(ctx) {
20
+ this.keyStore = ctx.keyStore;
21
+ this.ciphers = /* @__PURE__ */ new Map();
22
+ }
23
+ async encrypt(plain, realmId) {
24
+ const key = await this.keyStore.resolveOrCreate(realmId, JWKUse.ENCRYPTION);
25
+ if (!key.decryption_key) throw new AuthupError(`An encryption key could not be resolved for realm ${realmId}.`);
26
+ const cipher = this.resolveCipher(key.id, key.decryption_key);
27
+ return [
28
+ "v1",
29
+ key.id,
30
+ await cipher.encrypt(plain)
31
+ ].join(".");
32
+ }
33
+ async decrypt(blob, realmId) {
34
+ const parts = blob.split(".");
35
+ if (parts.length !== 3 || parts[0] !== "v1") throw new RealmCipherBlobError("The cipher blob is malformed.");
36
+ const [, keyId, payload] = parts;
37
+ const key = await this.keyStore.resolveById(keyId);
38
+ if (!key || key.use !== JWKUse.ENCRYPTION || !key.decryption_key) throw new RealmCipherBlobError(`The cipher blob references an unknown encryption key (${keyId}).`);
39
+ if (key.status === KeyStatus.DISABLED) throw new RealmCipherBlobError(`The cipher blob references a disabled encryption key (${keyId}).`);
40
+ if (key.realm_id !== realmId) throw new RealmCipherBlobError(`The cipher blob references a foreign realm's encryption key (${keyId}).`);
41
+ const cipher = this.resolveCipher(key.id, key.decryption_key);
42
+ try {
43
+ return await cipher.decrypt(payload);
44
+ } catch {
45
+ throw new RealmCipherBlobError(`The cipher blob could not be decrypted (${keyId}).`);
46
+ }
47
+ }
48
+ resolveCipher(keyId, material) {
49
+ let cipher = this.ciphers.get(keyId);
50
+ if (!cipher) {
51
+ cipher = new SymmetricCipher(material);
52
+ this.ciphers.set(keyId, cipher);
53
+ }
54
+ return cipher;
55
+ }
56
+ };
57
+ //#endregion
58
+ export { RealmCipher };
59
+
60
+ //# sourceMappingURL=realm-cipher.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"realm-cipher.mjs","names":["AuthupError","KeyStatus","SymmetricCipher","JWKUse","REALM_CIPHER_BLOB_VERSION","RealmCipherBlobError","RealmCipher","keyStore","ciphers","ctx","Map","encrypt","plain","realmId","key","resolveOrCreate","ENCRYPTION","decryption_key","cipher","resolveCipher","id","join","decrypt","blob","parts","split","length","keyId","payload","resolveById","use","status","DISABLED","realm_id","material","get","set"],"sources":["../../../src/core/key/realm-cipher.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\nimport { AuthupError } from '@authup/errors';\nimport { KeyStatus } from '@authup/core-kit';\nimport type { ISymmetricCipher } from '@authup/server-kit';\nimport { SymmetricCipher } from '@authup/server-kit';\nimport { JWKUse } from '@authup/specs';\nimport { REALM_CIPHER_BLOB_VERSION } from './constants.ts';\nimport { RealmCipherBlobError } from './error.ts';\nimport type { IKeyStore, IRealmCipher } from './types.ts';\n\nexport type RealmCipherContext = {\n keyStore: IKeyStore,\n};\n\nexport class RealmCipher implements IRealmCipher {\n protected keyStore : IKeyStore;\n\n /**\n * Imported ciphers by key id — key MATERIAL is immutable, so entries\n * never invalidate. Status and realm binding are deliberately NOT\n * cached: decrypt re-resolves the key row every call so disabling a\n * key acts as an immediate, reversible kill switch.\n */\n protected ciphers : Map<string, ISymmetricCipher>;\n\n constructor(ctx: RealmCipherContext) {\n this.keyStore = ctx.keyStore;\n this.ciphers = new Map();\n }\n\n async encrypt(plain: string, realmId: string) : Promise<string> {\n const key = await this.keyStore.resolveOrCreate(realmId, JWKUse.ENCRYPTION);\n if (!key.decryption_key) {\n throw new AuthupError(`An encryption key could not be resolved for realm ${realmId}.`);\n }\n\n const cipher = this.resolveCipher(key.id, key.decryption_key);\n\n return [\n REALM_CIPHER_BLOB_VERSION,\n key.id,\n await cipher.encrypt(plain),\n ].join('.');\n }\n\n async decrypt(blob: string, realmId: string) : Promise<string> {\n const parts = blob.split('.');\n if (parts.length !== 3 || parts[0] !== REALM_CIPHER_BLOB_VERSION) {\n throw new RealmCipherBlobError('The cipher blob is malformed.');\n }\n\n const [, keyId, payload] = parts;\n\n const key = await this.keyStore.resolveById(keyId);\n if (\n !key ||\n key.use !== JWKUse.ENCRYPTION ||\n !key.decryption_key\n ) {\n throw new RealmCipherBlobError(`The cipher blob references an unknown encryption key (${keyId}).`);\n }\n\n if (key.status === KeyStatus.DISABLED) {\n throw new RealmCipherBlobError(`The cipher blob references a disabled encryption key (${keyId}).`);\n }\n\n if (key.realm_id !== realmId) {\n throw new RealmCipherBlobError(`The cipher blob references a foreign realm's encryption key (${keyId}).`);\n }\n\n const cipher = this.resolveCipher(key.id, key.decryption_key);\n\n try {\n return await cipher.decrypt(payload);\n } catch {\n // failed GCM authentication / corrupt payload — blob semantics,\n // not infrastructure.\n throw new RealmCipherBlobError(`The cipher blob could not be decrypted (${keyId}).`);\n }\n }\n\n protected resolveCipher(\n keyId: string,\n material: string,\n ) : ISymmetricCipher {\n let cipher = this.ciphers.get(keyId);\n if (!cipher) {\n cipher = new SymmetricCipher(material);\n this.ciphers.set(keyId, cipher);\n }\n\n return cipher;\n }\n}\n"],"mappings":";;;;;;;;;;AAoBA,IAAaM,cAAb,MAAaA;CACCC;;;;;;IAQV;CAEA,YAAYE,KAAyB;EACjC,KAAKF,WAAWE,IAAIF;EACpB,KAAKC,0BAAU,IAAIE,IAAAA;CACvB;CAEA,MAAMC,QAAQC,OAAeC,SAAmC;EAC5D,MAAMC,MAAM,MAAM,KAAKP,SAASQ,gBAAgBF,SAASV,OAAOa,UAAU;EAC1E,IAAI,CAACF,IAAIG,gBACL,MAAM,IAAIjB,YAAY,qDAAqDa,QAAQ,EAAE;EAGzF,MAAMK,SAAS,KAAKC,cAAcL,IAAIM,IAAIN,IAAIG,cAAc;EAE5D,OAAO;;GAEHH,IAAIM;GACJ,MAAMF,OAAOP,QAAQC,KAAAA;GACxB,CAACS,KAAK,GAAA;CACX;CAEA,MAAMC,QAAQC,MAAcV,SAAmC;EAC3D,MAAMW,QAAQD,KAAKE,MAAM,GAAA;EACzB,IAAID,MAAME,WAAW,KAAKF,MAAM,OAAA,MAC5B,MAAM,IAAInB,qBAAqB,+BAAA;EAGnC,MAAM,GAAGsB,OAAOC,WAAWJ;EAE3B,MAAMV,MAAM,MAAM,KAAKP,SAASsB,YAAYF,KAAAA;EAC5C,IACI,CAACb,OACDA,IAAIgB,QAAQ3B,OAAOa,cACnB,CAACF,IAAIG,gBAEL,MAAM,IAAIZ,qBAAqB,yDAAyDsB,MAAM,GAAG;EAGrG,IAAIb,IAAIiB,WAAW9B,UAAU+B,UACzB,MAAM,IAAI3B,qBAAqB,yDAAyDsB,MAAM,GAAG;EAGrG,IAAIb,IAAImB,aAAapB,SACjB,MAAM,IAAIR,qBAAqB,gEAAgEsB,MAAM,GAAG;EAG5G,MAAMT,SAAS,KAAKC,cAAcL,IAAIM,IAAIN,IAAIG,cAAc;EAE5D,IAAI;GACA,OAAO,MAAMC,OAAOI,QAAQM,OAAAA;EAChC,QAAQ;GAGJ,MAAM,IAAIvB,qBAAqB,2CAA2CsB,MAAM,GAAG;EACvF;CACJ;CAEUR,cACNQ,OACAO,UACiB;EACjB,IAAIhB,SAAS,KAAKV,QAAQ2B,IAAIR,KAAAA;EAC9B,IAAI,CAACT,QAAQ;GACTA,SAAS,IAAIhB,gBAAgBgC,QAAAA;GAC7B,KAAK1B,QAAQ4B,IAAIT,OAAOT,MAAAA;EAC5B;EAEA,OAAOA;CACX;AACJ"}
@@ -0,0 +1,59 @@
1
+ import type { Key } from '@authup/core-kit';
2
+ import type { JWKUse } from '@authup/specs';
3
+ export interface IKeyProvisioner {
4
+ /**
5
+ * Ensure the realm holds at least one sig and one enc key row.
6
+ * Idempotent; never throws (provisioning must not fail realm creation
7
+ * or startup).
8
+ *
9
+ * @param realm
10
+ */
11
+ ensureForRealm(realm: {
12
+ id: string;
13
+ }): Promise<void>;
14
+ }
15
+ export interface IKeyStore {
16
+ /**
17
+ * Resolve the realm's highest-priority ACTIVE key for the given use,
18
+ * with usable (unwrapped) material. Mints one iff ZERO rows exist for
19
+ * (realm, use) — the self-healing zero-config backstop (provisioning
20
+ * mints eagerly). Rows existing but none active fails loud: an admin
21
+ * who disabled every key meant it.
22
+ *
23
+ * @param realmId
24
+ * @param use
25
+ */
26
+ resolveOrCreate(realmId: string, use: `${JWKUse}`): Promise<Key>;
27
+ /**
28
+ * Resolve a key by explicit id with usable (unwrapped) material.
29
+ * Read-only; status enforcement is the consumer's concern.
30
+ *
31
+ * @param id
32
+ */
33
+ resolveById(id: string): Promise<Key | null>;
34
+ }
35
+ /**
36
+ * Realm-scoped at-rest encryption over the key store's enc keys.
37
+ * Blobs are self-describing (v1.&lt;key_id&gt;.&lt;payload&gt;), so decryption
38
+ * resolves its key by id — concurrent key creation and future key
39
+ * rotation never orphan a blob.
40
+ */
41
+ export interface IRealmCipher {
42
+ /**
43
+ * Encrypt under the realm's current enc key (created on first use).
44
+ *
45
+ * @param plain
46
+ * @param realmId
47
+ */
48
+ encrypt(plain: string, realmId: string): Promise<string>;
49
+ /**
50
+ * Decrypt a blob via the key id it carries. The referenced key must
51
+ * belong to the given realm — the binding assert is mandatory, so a
52
+ * foreign realm's blob can never decrypt.
53
+ *
54
+ * @param blob
55
+ * @param realmId
56
+ */
57
+ decrypt(blob: string, realmId: string): Promise<string>;
58
+ }
59
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/key/types.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,WAAW,eAAe;IAC5B;;;;;;OAMG;IACH,cAAc,CAAC,KAAK,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxD;AAED,MAAM,WAAW,SAAS;IACtB;;;;;;;;;OASG;IACH,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,EAAE,GAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IAElE;;;;;OAKG;IACH,WAAW,CAAC,EAAE,EAAE,MAAM,GAAI,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC;CACjD;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IACzB;;;;;OAKG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAE1D;;;;;;;OAOG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CAC5D"}
@@ -0,0 +1,4 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ export {};
@@ -0,0 +1,5 @@
1
+ import type { ISymmetricCipher } from '@authup/server-kit';
2
+ export declare function isWrappedKeyMaterial(value: string): boolean;
3
+ export declare function wrapKeyMaterial(cipher: ISymmetricCipher, value: string): Promise<string>;
4
+ export declare function unwrapKeyMaterial(cipher: ISymmetricCipher | null | undefined, value: string): Promise<string>;
5
+ //# sourceMappingURL=wrap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wrap.d.ts","sourceRoot":"","sources":["../../../src/core/key/wrap.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAG3D,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAI,OAAO,CAE5D;AAED,wBAAsB,eAAe,CACjC,MAAM,EAAE,gBAAgB,EACxB,KAAK,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,CAAC,CAElB;AAED,wBAAsB,iBAAiB,CACnC,MAAM,EAAE,gBAAgB,GAAG,IAAI,GAAG,SAAS,EAC3C,KAAK,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,CAAC,CAalB"}
@@ -0,0 +1,21 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { WRAPPED_KEY_MATERIAL_PREFIX } from "./constants.mjs";
5
+ import { AuthupError } from "@authup/errors";
6
+ //#region src/core/key/wrap.ts
7
+ function isWrappedKeyMaterial(value) {
8
+ return value.startsWith(WRAPPED_KEY_MATERIAL_PREFIX);
9
+ }
10
+ async function wrapKeyMaterial(cipher, value) {
11
+ return `${WRAPPED_KEY_MATERIAL_PREFIX}${await cipher.encrypt(value)}`;
12
+ }
13
+ async function unwrapKeyMaterial(cipher, value) {
14
+ if (!isWrappedKeyMaterial(value)) return value;
15
+ if (!cipher) throw new AuthupError("The key store holds wrapped key material, but no secretsEncryptionKey (SECRETS_ENCRYPTION_KEY) is configured.");
16
+ return cipher.decrypt(value.substring(WRAPPED_KEY_MATERIAL_PREFIX.length));
17
+ }
18
+ //#endregion
19
+ export { isWrappedKeyMaterial, unwrapKeyMaterial, wrapKeyMaterial };
20
+
21
+ //# sourceMappingURL=wrap.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wrap.mjs","names":["AuthupError","WRAPPED_KEY_MATERIAL_PREFIX","isWrappedKeyMaterial","value","startsWith","wrapKeyMaterial","cipher","encrypt","unwrapKeyMaterial","decrypt","substring","length"],"sources":["../../../src/core/key/wrap.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\nimport { AuthupError } from '@authup/errors';\nimport type { ISymmetricCipher } from '@authup/server-kit';\nimport { WRAPPED_KEY_MATERIAL_PREFIX } from './constants.ts';\n\nexport function isWrappedKeyMaterial(value: string) : boolean {\n return value.startsWith(WRAPPED_KEY_MATERIAL_PREFIX);\n}\n\nexport async function wrapKeyMaterial(\n cipher: ISymmetricCipher,\n value: string,\n) : Promise<string> {\n return `${WRAPPED_KEY_MATERIAL_PREFIX}${await cipher.encrypt(value)}`;\n}\n\nexport async function unwrapKeyMaterial(\n cipher: ISymmetricCipher | null | undefined,\n value: string,\n) : Promise<string> {\n if (!isWrappedKeyMaterial(value)) {\n return value;\n }\n\n if (!cipher) {\n throw new AuthupError(\n 'The key store holds wrapped key material, ' +\n 'but no secretsEncryptionKey (SECRETS_ENCRYPTION_KEY) is configured.',\n );\n }\n\n return cipher.decrypt(value.substring(WRAPPED_KEY_MATERIAL_PREFIX.length));\n}\n"],"mappings":";;;;;;AAWA,SAAgBE,qBAAqBC,OAAa;CAC9C,OAAOA,MAAMC,WAAWH,2BAAAA;AAC5B;AAEA,eAAsBI,gBAClBC,QACAH,OAAa;CAEb,OAAO,GAAGF,8BAA8B,MAAMK,OAAOC,QAAQJ,KAAAA;AACjE;AAEA,eAAsBK,kBAClBF,QACAH,OAAa;CAEb,IAAI,CAACD,qBAAqBC,KAAAA,GACtB,OAAOA;CAGX,IAAI,CAACG,QACD,MAAM,IAAIN,YACN,+GACA;CAIR,OAAOM,OAAOG,QAAQN,MAAMO,UAAUT,4BAA4BU,MAAM,CAAA;AAC5E"}
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../src/core/mail/template/registry.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,eAAO,MAAM,sBAAsB,EAAE;KAAG,CAAC,IAAI,gBAAgB,GAAG,YAAY,CAAC,CAAC,CAAC;CAG9E,CAAC"}
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../src/core/mail/template/registry.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,eAAO,MAAM,sBAAsB,EAAE;KAAG,CAAC,IAAI,gBAAgB,GAAG,YAAY,CAAC,CAAC,CAAC;CAI9E,CAAC"}
@@ -2,12 +2,14 @@ import "node:path";
2
2
  import "node:url";
3
3
  import.meta.url;
4
4
  import { MailTemplateName } from "./types.mjs";
5
+ import { mfaEmailOtpMailTemplate } from "./templates/mfa-email-otp.mjs";
5
6
  import { passwordResetMailTemplate } from "./templates/password-reset.mjs";
6
7
  import { registrationActivationMailTemplate } from "./templates/registration-activation.mjs";
7
8
  //#region src/core/mail/template/registry.ts
8
9
  const MAIL_TEMPLATE_REGISTRY = {
9
10
  [MailTemplateName.REGISTRATION_ACTIVATION]: registrationActivationMailTemplate,
10
- [MailTemplateName.PASSWORD_RESET]: passwordResetMailTemplate
11
+ [MailTemplateName.PASSWORD_RESET]: passwordResetMailTemplate,
12
+ [MailTemplateName.MFA_EMAIL_OTP]: mfaEmailOtpMailTemplate
11
13
  };
12
14
  //#endregion
13
15
  export { MAIL_TEMPLATE_REGISTRY };
@@ -1 +1 @@
1
- {"version":3,"file":"registry.mjs","names":["passwordResetMailTemplate","registrationActivationMailTemplate","MailTemplateName","MAIL_TEMPLATE_REGISTRY","REGISTRATION_ACTIVATION","PASSWORD_RESET"],"sources":["../../../../src/core/mail/template/registry.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\nimport { passwordResetMailTemplate } from './templates/password-reset.ts';\nimport { registrationActivationMailTemplate } from './templates/registration-activation.ts';\nimport type { MailTemplate } from './types.ts';\nimport { MailTemplateName } from './types.ts';\n\nexport const MAIL_TEMPLATE_REGISTRY: { [N in MailTemplateName]: MailTemplate<N> } = {\n [MailTemplateName.REGISTRATION_ACTIVATION]: registrationActivationMailTemplate,\n [MailTemplateName.PASSWORD_RESET]: passwordResetMailTemplate,\n};\n"],"mappings":";;;;;;;AAYA,MAAaG,yBAAuE;EAC/ED,iBAAiBE,0BAA0BH;EAC3CC,iBAAiBG,iBAAiBL;AACvC"}
1
+ {"version":3,"file":"registry.mjs","names":["mfaEmailOtpMailTemplate","passwordResetMailTemplate","registrationActivationMailTemplate","MailTemplateName","MAIL_TEMPLATE_REGISTRY","REGISTRATION_ACTIVATION","PASSWORD_RESET","MFA_EMAIL_OTP"],"sources":["../../../../src/core/mail/template/registry.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\nimport { mfaEmailOtpMailTemplate } from './templates/mfa-email-otp.ts';\nimport { passwordResetMailTemplate } from './templates/password-reset.ts';\nimport { registrationActivationMailTemplate } from './templates/registration-activation.ts';\nimport type { MailTemplate } from './types.ts';\nimport { MailTemplateName } from './types.ts';\n\nexport const MAIL_TEMPLATE_REGISTRY: { [N in MailTemplateName]: MailTemplate<N> } = {\n [MailTemplateName.REGISTRATION_ACTIVATION]: registrationActivationMailTemplate,\n [MailTemplateName.PASSWORD_RESET]: passwordResetMailTemplate,\n [MailTemplateName.MFA_EMAIL_OTP]: mfaEmailOtpMailTemplate,\n};\n"],"mappings":";;;;;;;;AAaA,MAAaI,yBAAuE;EAC/ED,iBAAiBE,0BAA0BH;EAC3CC,iBAAiBG,iBAAiBL;EAClCE,iBAAiBI,gBAAgBP;AACtC"}
@@ -0,0 +1,3 @@
1
+ import { MailTemplateName } from '../types.ts';
2
+ export declare const mfaEmailOtpMailTemplate: import("../types.ts").MailTemplate<MailTemplateName.MFA_EMAIL_OTP>;
3
+ //# sourceMappingURL=mfa-email-otp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mfa-email-otp.d.ts","sourceRoot":"","sources":["../../../../../src/core/mail/template/templates/mfa-email-otp.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,eAAO,MAAM,uBAAuB,oEAyBlC,CAAC"}
@@ -0,0 +1,34 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { code, note, paragraph } from "../../format/blocks.mjs";
5
+ import { defineMailTemplate } from "../define.mjs";
6
+ import { MailTemplateName } from "../types.mjs";
7
+ import { TranslatorTranslationMailKey } from "@authup/i18n";
8
+ //#region src/core/mail/template/templates/mfa-email-otp.ts
9
+ const mfaEmailOtpMailTemplate = defineMailTemplate({
10
+ name: MailTemplateName.MFA_EMAIL_OTP,
11
+ build: async (params, t) => {
12
+ const [subject, intro, codeLabel, hint] = await Promise.all([
13
+ t(TranslatorTranslationMailKey.MFA_EMAIL_OTP_SUBJECT),
14
+ t(TranslatorTranslationMailKey.MFA_EMAIL_OTP_INTRO),
15
+ t(TranslatorTranslationMailKey.CODE),
16
+ t(TranslatorTranslationMailKey.MFA_EMAIL_OTP_HINT)
17
+ ]);
18
+ const expiry = params.expiresInMinutes ? await t(TranslatorTranslationMailKey.MFA_EMAIL_OTP_EXPIRY, { minutes: params.expiresInMinutes }) : void 0;
19
+ return {
20
+ subject,
21
+ preview: intro,
22
+ blocks: [
23
+ paragraph(intro),
24
+ code(codeLabel, params.code),
25
+ ...expiry ? [note(expiry)] : [],
26
+ note(hint)
27
+ ]
28
+ };
29
+ }
30
+ });
31
+ //#endregion
32
+ export { mfaEmailOtpMailTemplate };
33
+
34
+ //# sourceMappingURL=mfa-email-otp.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mfa-email-otp.mjs","names":["TranslatorTranslationMailKey","code","note","paragraph","defineMailTemplate","MailTemplateName","mfaEmailOtpMailTemplate","name","MFA_EMAIL_OTP","build","params","t","subject","intro","codeLabel","hint","Promise","all","MFA_EMAIL_OTP_SUBJECT","MFA_EMAIL_OTP_INTRO","CODE","MFA_EMAIL_OTP_HINT","expiry","expiresInMinutes","MFA_EMAIL_OTP_EXPIRY","minutes","undefined","preview","blocks"],"sources":["../../../../../src/core/mail/template/templates/mfa-email-otp.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\nimport { TranslatorTranslationMailKey } from '@authup/i18n';\nimport { code, note, paragraph } from '../../format/blocks.ts';\nimport { defineMailTemplate } from '../define.ts';\nimport { MailTemplateName } from '../types.ts';\n\nexport const mfaEmailOtpMailTemplate = defineMailTemplate({\n name: MailTemplateName.MFA_EMAIL_OTP,\n build: async (params, t) => {\n const [subject, intro, codeLabel, hint] = await Promise.all([\n t(TranslatorTranslationMailKey.MFA_EMAIL_OTP_SUBJECT),\n t(TranslatorTranslationMailKey.MFA_EMAIL_OTP_INTRO),\n t(TranslatorTranslationMailKey.CODE),\n t(TranslatorTranslationMailKey.MFA_EMAIL_OTP_HINT),\n ]);\n\n const expiry = params.expiresInMinutes ?\n await t(TranslatorTranslationMailKey.MFA_EMAIL_OTP_EXPIRY, { minutes: params.expiresInMinutes }) :\n undefined;\n\n return {\n subject,\n preview: intro,\n blocks: [\n paragraph(intro),\n code(codeLabel, params.code),\n ...(expiry ? [note(expiry)] : []),\n note(hint),\n ],\n };\n },\n});\n"],"mappings":";;;;;;;;AAYA,MAAaM,0BAA0BF,mBAAmB;CACtDG,MAAMF,iBAAiBG;CACvBC,OAAO,OAAOC,QAAQC,MAAAA;EAClB,MAAM,CAACC,SAASC,OAAOC,WAAWC,QAAQ,MAAMC,QAAQC,IAAI;GACxDN,EAAEX,6BAA6BkB,qBAAqB;GACpDP,EAAEX,6BAA6BmB,mBAAmB;GAClDR,EAAEX,6BAA6BoB,IAAI;GACnCT,EAAEX,6BAA6BqB,kBAAkB;GACpD;EAED,MAAMC,SAASZ,OAAOa,mBAClB,MAAMZ,EAAEX,6BAA6BwB,sBAAsB,EAAEC,SAASf,OAAOa,iBAAiB,CAAA,IAC9FG,KAAAA;EAEJ,OAAO;GACHd;GACAe,SAASd;GACTe,QAAQ;IACJzB,UAAUU,KAAAA;IACVZ,KAAKa,WAAWJ,OAAOT,IAAI;OACvBqB,SAAS,CAACpB,KAAKoB,MAAAA,CAAAA,IAAW,CAAA;IAC9BpB,KAAKa,IAAAA;;EAEb;CACJ;AACJ,CAAA"}
@@ -2,7 +2,8 @@ import type { TranslatorTranslationMailKey } from '@authup/i18n';
2
2
  import type { MailBlock } from '../format/types.ts';
3
3
  export declare enum MailTemplateName {
4
4
  REGISTRATION_ACTIVATION = "registration-activation",
5
- PASSWORD_RESET = "password-reset"
5
+ PASSWORD_RESET = "password-reset",
6
+ MFA_EMAIL_OTP = "mfa-email-otp"
6
7
  }
7
8
  export type MailTemplateParamsMap = {
8
9
  [MailTemplateName.REGISTRATION_ACTIVATION]: {
@@ -14,6 +15,10 @@ export type MailTemplateParamsMap = {
14
15
  url?: string;
15
16
  expiresInMinutes?: number;
16
17
  };
18
+ [MailTemplateName.MFA_EMAIL_OTP]: {
19
+ code: string;
20
+ expiresInMinutes?: number;
21
+ };
17
22
  };
18
23
  /**
19
24
  * Locale-bound translator handed to a template's `build`. Resolves a key
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/core/mail/template/types.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,oBAAY,gBAAgB;IACxB,uBAAuB,4BAA4B;IACnD,cAAc,mBAAmB;CACpC;AAED,MAAM,MAAM,qBAAqB,GAAG;IAChC,CAAC,gBAAgB,CAAC,uBAAuB,CAAC,EAAE;QACxC,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,CAAC,gBAAgB,CAAC,cAAc,CAAC,EAAE;QAC/B,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,gBAAgB,CAAC,EAAE,MAAM,CAAC;KAC7B,CAAC;CACL,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,sBAAsB,GAAG,CACjC,GAAG,EAAE,GAAG,4BAA4B,EAAE,EACtC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KACzB,OAAO,CAAC,MAAM,CAAC,CAAC;AAErB,MAAM,MAAM,uBAAuB,GAAG;IAClC,OAAO,EAAE,MAAM,CAAC;IAEhB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,SAAS,EAAE,CAAC;CACvB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,gBAAgB,GAAG,gBAAgB,IAAI;IACtE,IAAI,EAAE,CAAC,CAAC;IACR,KAAK,CACD,MAAM,EAAE,qBAAqB,CAAC,CAAC,CAAC,EAChC,CAAC,EAAE,sBAAsB,GAC1B,OAAO,CAAC,uBAAuB,CAAC,CAAC;CACvC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/core/mail/template/types.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,oBAAY,gBAAgB;IACxB,uBAAuB,4BAA4B;IACnD,cAAc,mBAAmB;IACjC,aAAa,kBAAkB;CAClC;AAED,MAAM,MAAM,qBAAqB,GAAG;IAChC,CAAC,gBAAgB,CAAC,uBAAuB,CAAC,EAAE;QACxC,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,CAAC,gBAAgB,CAAC,cAAc,CAAC,EAAE;QAC/B,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,gBAAgB,CAAC,EAAE,MAAM,CAAC;KAC7B,CAAC;IACF,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE;QAC9B,IAAI,EAAE,MAAM,CAAC;QACb,gBAAgB,CAAC,EAAE,MAAM,CAAC;KAC7B,CAAC;CACL,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,sBAAsB,GAAG,CACjC,GAAG,EAAE,GAAG,4BAA4B,EAAE,EACtC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KACzB,OAAO,CAAC,MAAM,CAAC,CAAC;AAErB,MAAM,MAAM,uBAAuB,GAAG;IAClC,OAAO,EAAE,MAAM,CAAC;IAEhB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,SAAS,EAAE,CAAC;CACvB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,gBAAgB,GAAG,gBAAgB,IAAI;IACtE,IAAI,EAAE,CAAC,CAAC;IACR,KAAK,CACD,MAAM,EAAE,qBAAqB,CAAC,CAAC,CAAC,EAChC,CAAC,EAAE,sBAAsB,GAC1B,OAAO,CAAC,uBAAuB,CAAC,CAAC;CACvC,CAAC"}
@@ -5,6 +5,7 @@ import.meta.url;
5
5
  var MailTemplateName = /*#__PURE__*/ function(MailTemplateName) {
6
6
  MailTemplateName["REGISTRATION_ACTIVATION"] = "registration-activation";
7
7
  MailTemplateName["PASSWORD_RESET"] = "password-reset";
8
+ MailTemplateName["MFA_EMAIL_OTP"] = "mfa-email-otp";
8
9
  return MailTemplateName;
9
10
  }({});
10
11
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"types.mjs","names":["MailTemplateName"],"sources":["../../../../src/core/mail/template/types.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\nimport type { TranslatorTranslationMailKey } from '@authup/i18n';\nimport type { MailBlock } from '../format/types.ts';\n\nexport enum MailTemplateName {\n REGISTRATION_ACTIVATION = 'registration-activation',\n PASSWORD_RESET = 'password-reset',\n}\n\nexport type MailTemplateParamsMap = {\n [MailTemplateName.REGISTRATION_ACTIVATION]: {\n code: string,\n url?: string,\n },\n [MailTemplateName.PASSWORD_RESET]: {\n code: string,\n url?: string,\n expiresInMinutes?: number,\n },\n};\n\n/**\n * Locale-bound translator handed to a template's `build`. Resolves a key\n * of the `authupMail` namespace (`@authup/i18n`) through ilingo — `data`\n * feeds `{{var}}` interpolation. Async so file- or remote-backed override\n * stores can slot in behind the same contract.\n */\nexport type MailTemplateTranslator = (\n key: `${TranslatorTranslationMailKey}`,\n data?: Record<string, any>,\n) => Promise<string>;\n\nexport type MailTemplateBuildOutput = {\n subject: string,\n // Hidden preheader shown by mail clients as the preview line.\n preview?: string,\n blocks: MailBlock[],\n};\n\n/**\n * A mail template composes its body from blocks; subject, html and text\n * all derive from the same build output. Copy is not embedded — it is\n * resolved per locale through the supplied translator.\n */\nexport type MailTemplate<N extends MailTemplateName = MailTemplateName> = {\n name: N,\n build(\n params: MailTemplateParamsMap[N],\n t: MailTemplateTranslator,\n ): Promise<MailTemplateBuildOutput>,\n};\n"],"mappings":";;;;AAUA,IAAO,mBAAKA,uBAAAA,kBAAAA;;;QAAAA"}
1
+ {"version":3,"file":"types.mjs","names":["MailTemplateName"],"sources":["../../../../src/core/mail/template/types.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\nimport type { TranslatorTranslationMailKey } from '@authup/i18n';\nimport type { MailBlock } from '../format/types.ts';\n\nexport enum MailTemplateName {\n REGISTRATION_ACTIVATION = 'registration-activation',\n PASSWORD_RESET = 'password-reset',\n MFA_EMAIL_OTP = 'mfa-email-otp',\n}\n\nexport type MailTemplateParamsMap = {\n [MailTemplateName.REGISTRATION_ACTIVATION]: {\n code: string,\n url?: string,\n },\n [MailTemplateName.PASSWORD_RESET]: {\n code: string,\n url?: string,\n expiresInMinutes?: number,\n },\n [MailTemplateName.MFA_EMAIL_OTP]: {\n code: string,\n expiresInMinutes?: number,\n },\n};\n\n/**\n * Locale-bound translator handed to a template's `build`. Resolves a key\n * of the `authupMail` namespace (`@authup/i18n`) through ilingo — `data`\n * feeds `{{var}}` interpolation. Async so file- or remote-backed override\n * stores can slot in behind the same contract.\n */\nexport type MailTemplateTranslator = (\n key: `${TranslatorTranslationMailKey}`,\n data?: Record<string, any>,\n) => Promise<string>;\n\nexport type MailTemplateBuildOutput = {\n subject: string,\n // Hidden preheader shown by mail clients as the preview line.\n preview?: string,\n blocks: MailBlock[],\n};\n\n/**\n * A mail template composes its body from blocks; subject, html and text\n * all derive from the same build output. Copy is not embedded — it is\n * resolved per locale through the supplied translator.\n */\nexport type MailTemplate<N extends MailTemplateName = MailTemplateName> = {\n name: N,\n build(\n params: MailTemplateParamsMap[N],\n t: MailTemplateTranslator,\n ): Promise<MailTemplateBuildOutput>,\n};\n"],"mappings":";;;;AAUA,IAAO,mBAAKA,uBAAAA,kBAAAA;;;;QAAAA"}
@@ -0,0 +1,3 @@
1
+ export * from './noop.ts';
2
+ export * from './types.ts';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/metrics/index.ts"],"names":[],"mappings":"AAOA,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
@@ -0,0 +1,5 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { NoopAuthFlowMetrics } from "./noop.mjs";
5
+ export { NoopAuthFlowMetrics };
@@ -0,0 +1,8 @@
1
+ import type { IAuthFlowMetrics } from './types.ts';
2
+ export declare class NoopAuthFlowMetrics implements IAuthFlowMetrics {
3
+ recordLogin(): void;
4
+ recordTokenGrant(): void;
5
+ recordAuthorize(): void;
6
+ recordRefreshReplay(): void;
7
+ }
8
+ //# sourceMappingURL=noop.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"noop.d.ts","sourceRoot":"","sources":["../../../src/core/metrics/noop.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,qBAAa,mBAAoB,YAAW,gBAAgB;IACxD,WAAW,IAAI,IAAI;IAInB,gBAAgB,IAAI,IAAI;IAIxB,eAAe,IAAI,IAAI;IAIvB,mBAAmB,IAAI,IAAI;CAG9B"}
@@ -0,0 +1,14 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ //#region src/core/metrics/noop.ts
5
+ var NoopAuthFlowMetrics = class {
6
+ recordLogin() {}
7
+ recordTokenGrant() {}
8
+ recordAuthorize() {}
9
+ recordRefreshReplay() {}
10
+ };
11
+ //#endregion
12
+ export { NoopAuthFlowMetrics };
13
+
14
+ //# sourceMappingURL=noop.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"noop.mjs","names":["NoopAuthFlowMetrics","recordLogin","recordTokenGrant","recordAuthorize","recordRefreshReplay"],"sources":["../../../src/core/metrics/noop.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\nimport type { IAuthFlowMetrics } from './types.ts';\n\nexport class NoopAuthFlowMetrics implements IAuthFlowMetrics {\n recordLogin(): void {\n // noop\n }\n\n recordTokenGrant(): void {\n // noop\n }\n\n recordAuthorize(): void {\n // noop\n }\n\n recordRefreshReplay(): void {\n // noop\n }\n}\n"],"mappings":";;;;AASA,IAAaA,sBAAb,MAAaA;CACTC,cAAoB,CAEpB;CAEAC,mBAAyB,CAEzB;CAEAC,kBAAwB,CAExB;CAEAC,sBAA4B,CAE5B;AACJ"}
@@ -0,0 +1,19 @@
1
+ import type { OAuth2TokenGrant } from '@authup/specs';
2
+ export type AuthFlowLoginResult = 'success' | 'failure';
3
+ /**
4
+ * `denied` is reserved — dead until an application-access policy (plan 052)
5
+ * can deny an authorize; emitted in the label domain from day one so
6
+ * dashboards stay stable when it turns live.
7
+ */
8
+ export type AuthFlowAuthorizeOutcome = 'issued' | 'denied' | 'login_required' | 'mfa_required' | 'error';
9
+ export interface IAuthFlowMetrics {
10
+ recordLogin(result: AuthFlowLoginResult): void;
11
+ /**
12
+ * Successful token grants only — failures appear in the generic
13
+ * per-route status-code histogram on /token.
14
+ */
15
+ recordTokenGrant(grantType: `${OAuth2TokenGrant}`): void;
16
+ recordAuthorize(outcome: AuthFlowAuthorizeOutcome): void;
17
+ recordRefreshReplay(): void;
18
+ }
19
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/metrics/types.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,SAAS,CAAC;AAExD;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,GAAG,QAAQ,GAAG,QAAQ,GAAG,gBAAgB,GAAG,cAAc,GAAG,OAAO,CAAC;AAEzG,MAAM,WAAW,gBAAgB;IAC7B,WAAW,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAE/C;;;OAGG;IACH,gBAAgB,CAAC,SAAS,EAAE,GAAG,gBAAgB,EAAE,GAAG,IAAI,CAAC;IAEzD,eAAe,CAAC,OAAO,EAAE,wBAAwB,GAAG,IAAI,CAAC;IAEzD,mBAAmB,IAAI,IAAI,CAAC;CAC/B"}
@@ -0,0 +1,4 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ export {};
@@ -0,0 +1,3 @@
1
+ export * from './module.ts';
2
+ export * from './types.ts';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/oauth2/access-policy/index.ts"],"names":[],"mappings":"AAOA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
@@ -0,0 +1,5 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { OAuth2AccessPolicyEvaluator } from "./module.mjs";
5
+ export { OAuth2AccessPolicyEvaluator };
@@ -0,0 +1,12 @@
1
+ import type { IdentityPolicyData } from '@authup/access';
2
+ import type { Logger } from '@authup/server-kit';
3
+ import { PolicyEngine } from '../../security/policy/engine.ts';
4
+ import type { IOAuth2AccessPolicyEvaluator, IOAuth2AccessPolicyProvider, OAuth2AccessPolicyEvaluatorContext } from './types.ts';
5
+ export declare class OAuth2AccessPolicyEvaluator implements IOAuth2AccessPolicyEvaluator {
6
+ protected policyProvider: IOAuth2AccessPolicyProvider;
7
+ protected engine: PolicyEngine;
8
+ protected logger?: Logger;
9
+ constructor(ctx: OAuth2AccessPolicyEvaluatorContext);
10
+ evaluate(policyId: string, subject: IdentityPolicyData): Promise<boolean>;
11
+ }
12
+ //# sourceMappingURL=module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../src/core/oauth2/access-policy/module.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAc,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,KAAK,EACR,4BAA4B,EAC5B,2BAA2B,EAC3B,kCAAkC,EACrC,MAAM,YAAY,CAAC;AAEpB,qBAAa,2BAA4B,YAAW,4BAA4B;IAC5E,SAAS,CAAC,cAAc,EAAG,2BAA2B,CAAC;IAEvD,SAAS,CAAC,MAAM,EAAG,YAAY,CAAC;IAEhC,SAAS,CAAC,MAAM,CAAC,EAAG,MAAM,CAAC;gBAEf,GAAG,EAAE,kCAAkC;IAM7C,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC;CAoBlF"}
@@ -0,0 +1,32 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { PolicyEngine as PolicyEngine$1 } from "../../security/policy/engine.mjs";
5
+ import { BuiltInPolicyType, PolicyData, definePolicyEvaluationContext } from "@authup/access";
6
+ //#region src/core/oauth2/access-policy/module.ts
7
+ var OAuth2AccessPolicyEvaluator = class {
8
+ policyProvider;
9
+ engine;
10
+ logger;
11
+ constructor(ctx) {
12
+ this.policyProvider = ctx.policyProvider;
13
+ this.engine = new PolicyEngine$1(ctx.identityPermissionProvider);
14
+ this.logger = ctx.logger;
15
+ }
16
+ async evaluate(policyId, subject) {
17
+ let tree;
18
+ try {
19
+ tree = await this.policyProvider.findDescendantsTreeById(policyId);
20
+ } catch (e) {
21
+ this.logger?.warn(`Loading the access policy ${policyId} failed.`, { error: e });
22
+ return false;
23
+ }
24
+ if (!tree) return false;
25
+ const ctx = definePolicyEvaluationContext({ data: new PolicyData({ [BuiltInPolicyType.IDENTITY]: subject }) });
26
+ return (await this.engine.evaluate(tree, ctx)).success;
27
+ }
28
+ };
29
+ //#endregion
30
+ export { OAuth2AccessPolicyEvaluator };
31
+
32
+ //# sourceMappingURL=module.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.mjs","names":["BuiltInPolicyType","PolicyData","definePolicyEvaluationContext","PolicyEngine","OAuth2AccessPolicyEvaluator","policyProvider","engine","logger","ctx","identityPermissionProvider","evaluate","policyId","subject","tree","findDescendantsTreeById","e","warn","error","data","IDENTITY","result","success"],"sources":["../../../../src/core/oauth2/access-policy/module.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\nimport {\n BuiltInPolicyType,\n PolicyData,\n definePolicyEvaluationContext,\n} from '@authup/access';\nimport type { BasePolicy, IdentityPolicyData } from '@authup/access';\nimport type { Logger } from '@authup/server-kit';\nimport { PolicyEngine } from '../../security/policy/engine.ts';\nimport type {\n IOAuth2AccessPolicyEvaluator,\n IOAuth2AccessPolicyProvider,\n OAuth2AccessPolicyEvaluatorContext,\n} from './types.ts';\n\nexport class OAuth2AccessPolicyEvaluator implements IOAuth2AccessPolicyEvaluator {\n protected policyProvider : IOAuth2AccessPolicyProvider;\n\n protected engine : PolicyEngine;\n\n protected logger? : Logger;\n\n constructor(ctx: OAuth2AccessPolicyEvaluatorContext) {\n this.policyProvider = ctx.policyProvider;\n this.engine = new PolicyEngine(ctx.identityPermissionProvider);\n this.logger = ctx.logger;\n }\n\n async evaluate(policyId: string, subject: IdentityPolicyData): Promise<boolean> {\n let tree : BasePolicy | null;\n\n try {\n tree = await this.policyProvider.findDescendantsTreeById(policyId);\n } catch (e) {\n this.logger?.warn(`Loading the access policy ${policyId} failed.`, { error: e });\n return false;\n }\n\n if (!tree) {\n return false;\n }\n\n const ctx = definePolicyEvaluationContext({ data: new PolicyData({ [BuiltInPolicyType.IDENTITY]: subject }) });\n\n const result = await this.engine.evaluate(tree, ctx);\n\n return result.success;\n }\n}\n"],"mappings":";;;;;;AAqBA,IAAaI,8BAAb,MAAaA;CACCC;CAEAC;CAEAC;CAEV,YAAYC,KAAyC;EACjD,KAAKH,iBAAiBG,IAAIH;EAC1B,KAAKC,SAAS,IAAIH,eAAaK,IAAIC,0BAA0B;EAC7D,KAAKF,SAASC,IAAID;CACtB;CAEA,MAAMG,SAASC,UAAkBC,SAA+C;EAC5E,IAAIC;EAEJ,IAAI;GACAA,OAAO,MAAM,KAAKR,eAAeS,wBAAwBH,QAAAA;EAC7D,SAASI,GAAG;GACR,KAAKR,QAAQS,KAAK,6BAA6BL,SAAS,WAAW,EAAEM,OAAOF,EAAE,CAAA;GAC9E,OAAO;EACX;EAEA,IAAI,CAACF,MACD,OAAO;EAGX,MAAML,MAAMN,8BAA8B,EAAEgB,MAAM,IAAIjB,WAAW,GAAGD,kBAAkBmB,WAAWP,QAAQ,CAAA,EAAG,CAAA;EAI5G,QAAOQ,MAFc,KAAKd,OAAOI,SAASG,MAAML,GAAAA,EAAAA,CAElCa;CAClB;AACJ"}
@@ -0,0 +1,19 @@
1
+ import type { BasePolicy, IdentityPolicyData } from '@authup/access';
2
+ import type { Logger } from '@authup/server-kit';
3
+ import type { IIdentityPermissionProvider } from '../../identity/permission/types.ts';
4
+ export interface IOAuth2AccessPolicyEvaluator {
5
+ /**
6
+ * true = access permitted. A present-but-unresolvable policy id,
7
+ * a load failure, or an evaluation failure all yield false (fail closed).
8
+ */
9
+ evaluate(policyId: string, subject: IdentityPolicyData): Promise<boolean>;
10
+ }
11
+ export interface IOAuth2AccessPolicyProvider {
12
+ findDescendantsTreeById(id: string): Promise<BasePolicy | null>;
13
+ }
14
+ export type OAuth2AccessPolicyEvaluatorContext = {
15
+ policyProvider: IOAuth2AccessPolicyProvider;
16
+ identityPermissionProvider: IIdentityPermissionProvider;
17
+ logger?: Logger;
18
+ };
19
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/core/oauth2/access-policy/types.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AAEtF,MAAM,WAAW,4BAA4B;IACzC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC7E;AAED,MAAM,WAAW,2BAA2B;IACxC,uBAAuB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;CACnE;AAED,MAAM,MAAM,kCAAkC,GAAG;IAC7C,cAAc,EAAE,2BAA2B,CAAC;IAC5C,0BAA0B,EAAE,2BAA2B,CAAC;IACxD,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ export {};
@@ -1 +1 @@
1
- {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../../src/core/oauth2/authorization/code/issuer/module.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,QAAQ,EAAE,uBAAuB,EAAE,8BAA8B,EAAE,MAAM,kBAAkB,CAAC;AAE1G,OAAO,KAAK,EAAE,kCAAkC,EAAgC,MAAM,wBAAwB,CAAC;AAC/G,OAAO,KAAK,EAAE,8BAA8B,EAAE,oCAAoC,EAAE,MAAM,YAAY,CAAC;AAEvG,qBAAa,6BAA8B,YAAW,8BAA8B;IAChF,SAAS,CAAC,UAAU,EAAE,kCAAkC,CAAC;IAEzD,SAAS,CAAC,OAAO,EAAE,oCAAoC,CAAC;gBAGpD,UAAU,EAAE,kCAAkC,EAC9C,OAAO,GAAE,oCAAyC;IAMhD,KAAK,CACP,KAAK,EAAE,8BAA8B,EACrC,QAAQ,EAAE,QAAQ,EAClB,OAAO,GAAE,oCAAyC,GAClD,OAAO,CAAC,uBAAuB,CAAC;CA+BvC"}
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../../src/core/oauth2/authorization/code/issuer/module.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,QAAQ,EAAE,uBAAuB,EAAE,8BAA8B,EAAE,MAAM,kBAAkB,CAAC;AAE1G,OAAO,KAAK,EAAE,kCAAkC,EAAgC,MAAM,wBAAwB,CAAC;AAC/G,OAAO,KAAK,EAAE,8BAA8B,EAAE,oCAAoC,EAAE,MAAM,YAAY,CAAC;AAEvG,qBAAa,6BAA8B,YAAW,8BAA8B;IAChF,SAAS,CAAC,UAAU,EAAE,kCAAkC,CAAC;IAEzD,SAAS,CAAC,OAAO,EAAE,oCAAoC,CAAC;gBAGpD,UAAU,EAAE,kCAAkC,EAC9C,OAAO,GAAE,oCAAyC;IAMhD,KAAK,CACP,KAAK,EAAE,8BAA8B,EACrC,QAAQ,EAAE,QAAQ,EAClB,OAAO,GAAE,oCAAyC,GAClD,OAAO,CAAC,uBAAuB,CAAC;CAiCvC"}
@@ -20,7 +20,9 @@ var OAuth2AuthorizationCodeIssuer = class {
20
20
  nonce: input.nonce,
21
21
  code_challenge: input.code_challenge,
22
22
  code_challenge_method: input.code_challenge_method,
23
+ acr_values: input.acr_values ?? null,
23
24
  auth_time: options.authTime ?? Math.floor(Date.now() / 1e3),
25
+ auth_method: options.authMethod ?? null,
24
26
  realm_id: realm.id,
25
27
  realm_name: realm.name,
26
28
  sub: identity.data.id,
@@ -1 +1 @@
1
- {"version":3,"file":"module.mjs","names":["OAuth2RequestError","OAuth2AuthorizationCodeIssuer","repository","options","issue","input","identity","realm","data","identityInvalid","entity","redirect_uri","client_id","scope","nonce","code_challenge","code_challenge_method","auth_time","authTime","Math","floor","Date","now","realm_id","id","realm_name","name","sub","sub_kind","type","sessionId","session_id","save","maxAge"],"sources":["../../../../../../src/core/oauth2/authorization/code/issuer/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 { Identity, OAuth2AuthorizationCode, OAuth2AuthorizationCodeRequest } from '@authup/core-kit';\nimport { OAuth2RequestError } from '@authup/specs';\nimport type { IOAuth2AuthorizationCodeRepository, OAuth2AuthorizationCodeInput } from '../repository/index.ts';\nimport type { IOAuth2AuthorizationCodeIssuer, OAuth2AuthorizationCodeIssuerOptions } from './types.ts';\n\nexport class OAuth2AuthorizationCodeIssuer implements IOAuth2AuthorizationCodeIssuer {\n protected repository: IOAuth2AuthorizationCodeRepository;\n\n protected options: OAuth2AuthorizationCodeIssuerOptions;\n\n constructor(\n repository: IOAuth2AuthorizationCodeRepository,\n options: OAuth2AuthorizationCodeIssuerOptions = {},\n ) {\n this.repository = repository;\n this.options = options;\n }\n\n async issue(\n input: OAuth2AuthorizationCodeRequest,\n identity: Identity,\n options: OAuth2AuthorizationCodeIssuerOptions = {},\n ) : Promise<OAuth2AuthorizationCode> {\n // The code carries the identity's realm id + name. A dangling realm\n // relation (realm row deleted without cascade) must fail closed as a\n // clean OAuth2 error — never a TypeError → 500.\n const { realm } = identity.data;\n if (!realm) {\n throw OAuth2RequestError.identityInvalid();\n }\n\n const entity: OAuth2AuthorizationCodeInput = {\n redirect_uri: input.redirect_uri,\n client_id: input.client_id,\n scope: input.scope,\n nonce: input.nonce,\n code_challenge: input.code_challenge,\n code_challenge_method: input.code_challenge_method,\n\n auth_time: options.authTime ?? Math.floor(Date.now() / 1000),\n\n realm_id: realm.id,\n realm_name: realm.name,\n sub: identity.data.id,\n sub_kind: identity.type,\n };\n\n if (options.sessionId) {\n entity.session_id = options.sessionId;\n }\n\n return this.repository.save(entity, { maxAge: options.maxAge ?? this.options.maxAge });\n }\n}\n"],"mappings":";;;;;AAYA,IAAaC,gCAAb,MAAaA;CACCC;CAEAC;CAEV,YACID,YACAC,UAAgD,CAAC,GACnD;EACE,KAAKD,aAAaA;EAClB,KAAKC,UAAUA;CACnB;CAEA,MAAMC,MACFC,OACAC,UACAH,UAAgD,CAAC,GAChB;EAIjC,MAAM,EAAEI,UAAUD,SAASE;EAC3B,IAAI,CAACD,OACD,MAAMP,mBAAmBS,gBAAe;EAG5C,MAAMC,SAAuC;GACzCC,cAAcN,MAAMM;GACpBC,WAAWP,MAAMO;GACjBC,OAAOR,MAAMQ;GACbC,OAAOT,MAAMS;GACbC,gBAAgBV,MAAMU;GACtBC,uBAAuBX,MAAMW;GAE7BC,WAAWd,QAAQe,YAAYC,KAAKC,MAAMC,KAAKC,IAAG,IAAK,GAAA;GAEvDC,UAAUhB,MAAMiB;GAChBC,YAAYlB,MAAMmB;GAClBC,KAAKrB,SAASE,KAAKgB;GACnBI,UAAUtB,SAASuB;EACvB;EAEA,IAAI1B,QAAQ2B,WACRpB,OAAOqB,aAAa5B,QAAQ2B;EAGhC,OAAO,KAAK5B,WAAW8B,KAAKtB,QAAQ,EAAEuB,QAAQ9B,QAAQ8B,UAAU,KAAK9B,QAAQ8B,OAAO,CAAA;CACxF;AACJ"}
1
+ {"version":3,"file":"module.mjs","names":["OAuth2RequestError","OAuth2AuthorizationCodeIssuer","repository","options","issue","input","identity","realm","data","identityInvalid","entity","redirect_uri","client_id","scope","nonce","code_challenge","code_challenge_method","acr_values","auth_time","authTime","Math","floor","Date","now","auth_method","authMethod","realm_id","id","realm_name","name","sub","sub_kind","type","sessionId","session_id","save","maxAge"],"sources":["../../../../../../src/core/oauth2/authorization/code/issuer/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 { Identity, OAuth2AuthorizationCode, OAuth2AuthorizationCodeRequest } from '@authup/core-kit';\nimport { OAuth2RequestError } from '@authup/specs';\nimport type { IOAuth2AuthorizationCodeRepository, OAuth2AuthorizationCodeInput } from '../repository/index.ts';\nimport type { IOAuth2AuthorizationCodeIssuer, OAuth2AuthorizationCodeIssuerOptions } from './types.ts';\n\nexport class OAuth2AuthorizationCodeIssuer implements IOAuth2AuthorizationCodeIssuer {\n protected repository: IOAuth2AuthorizationCodeRepository;\n\n protected options: OAuth2AuthorizationCodeIssuerOptions;\n\n constructor(\n repository: IOAuth2AuthorizationCodeRepository,\n options: OAuth2AuthorizationCodeIssuerOptions = {},\n ) {\n this.repository = repository;\n this.options = options;\n }\n\n async issue(\n input: OAuth2AuthorizationCodeRequest,\n identity: Identity,\n options: OAuth2AuthorizationCodeIssuerOptions = {},\n ) : Promise<OAuth2AuthorizationCode> {\n // The code carries the identity's realm id + name. A dangling realm\n // relation (realm row deleted without cascade) must fail closed as a\n // clean OAuth2 error — never a TypeError → 500.\n const { realm } = identity.data;\n if (!realm) {\n throw OAuth2RequestError.identityInvalid();\n }\n\n const entity: OAuth2AuthorizationCodeInput = {\n redirect_uri: input.redirect_uri,\n client_id: input.client_id,\n scope: input.scope,\n nonce: input.nonce,\n code_challenge: input.code_challenge,\n code_challenge_method: input.code_challenge_method,\n acr_values: input.acr_values ?? null,\n\n auth_time: options.authTime ?? Math.floor(Date.now() / 1000),\n auth_method: options.authMethod ?? null,\n\n realm_id: realm.id,\n realm_name: realm.name,\n sub: identity.data.id,\n sub_kind: identity.type,\n };\n\n if (options.sessionId) {\n entity.session_id = options.sessionId;\n }\n\n return this.repository.save(entity, { maxAge: options.maxAge ?? this.options.maxAge });\n }\n}\n"],"mappings":";;;;;AAYA,IAAaC,gCAAb,MAAaA;CACCC;CAEAC;CAEV,YACID,YACAC,UAAgD,CAAC,GACnD;EACE,KAAKD,aAAaA;EAClB,KAAKC,UAAUA;CACnB;CAEA,MAAMC,MACFC,OACAC,UACAH,UAAgD,CAAC,GAChB;EAIjC,MAAM,EAAEI,UAAUD,SAASE;EAC3B,IAAI,CAACD,OACD,MAAMP,mBAAmBS,gBAAe;EAG5C,MAAMC,SAAuC;GACzCC,cAAcN,MAAMM;GACpBC,WAAWP,MAAMO;GACjBC,OAAOR,MAAMQ;GACbC,OAAOT,MAAMS;GACbC,gBAAgBV,MAAMU;GACtBC,uBAAuBX,MAAMW;GAC7BC,YAAYZ,MAAMY,cAAc;GAEhCC,WAAWf,QAAQgB,YAAYC,KAAKC,MAAMC,KAAKC,IAAG,IAAK,GAAA;GACvDC,aAAarB,QAAQsB,cAAc;GAEnCC,UAAUnB,MAAMoB;GAChBC,YAAYrB,MAAMsB;GAClBC,KAAKxB,SAASE,KAAKmB;GACnBI,UAAUzB,SAAS0B;EACvB;EAEA,IAAI7B,QAAQ8B,WACRvB,OAAOwB,aAAa/B,QAAQ8B;EAGhC,OAAO,KAAK/B,WAAWiC,KAAKzB,QAAQ,EAAE0B,QAAQjC,QAAQiC,UAAU,KAAKjC,QAAQiC,OAAO,CAAA;CACxF;AACJ"}
@@ -1,4 +1,4 @@
1
- import type { Identity, OAuth2AuthorizationCode, OAuth2AuthorizationCodeRequest } from '@authup/core-kit';
1
+ import type { Identity, OAuth2AuthorizationCode, OAuth2AuthorizationCodeRequest, SessionAuthMethod } from '@authup/core-kit';
2
2
  export type OAuth2AuthorizationCodeIssuerOptions = {
3
3
  /**
4
4
  * Max duration in seconds
@@ -15,6 +15,11 @@ export type OAuth2AuthorizationCodeIssuerOptions = {
15
15
  * Defaults to the issuance instant (session-less flows authenticate now).
16
16
  */
17
17
  authTime?: number;
18
+ /**
19
+ * How the subject authenticated (SessionAuthMethod) — persisted on the
20
+ * code so a session created at the /token exchange inherits it.
21
+ */
22
+ authMethod?: `${SessionAuthMethod}` | null;
18
23
  };
19
24
  export interface IOAuth2AuthorizationCodeIssuer {
20
25
  issue(input: OAuth2AuthorizationCodeRequest, identity: Identity, options?: OAuth2AuthorizationCodeIssuerOptions): Promise<OAuth2AuthorizationCode>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/core/oauth2/authorization/code/issuer/types.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,QAAQ,EAAE,uBAAuB,EAAE,8BAA8B,EAAE,MAAM,kBAAkB,CAAC;AAE1G,MAAM,MAAM,oCAAoC,GAAG;IAC/C;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,WAAW,8BAA8B;IAC3C,KAAK,CACD,KAAK,EAAE,8BAA8B,EACrC,QAAQ,EAAE,QAAQ,EAClB,OAAO,CAAC,EAAE,oCAAoC,GAC9C,OAAO,CAAC,uBAAuB,CAAC,CAAC;CACxC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/core/oauth2/authorization/code/issuer/types.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACR,QAAQ,EACR,uBAAuB,EACvB,8BAA8B,EAC9B,iBAAiB,EACpB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,MAAM,oCAAoC,GAAG;IAC/C;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,UAAU,CAAC,EAAE,GAAG,iBAAiB,EAAE,GAAG,IAAI,CAAC;CAC9C,CAAC;AAEF,MAAM,WAAW,8BAA8B;IAC3C,KAAK,CACD,KAAK,EAAE,8BAA8B,EACrC,QAAQ,EAAE,QAAQ,EAClB,OAAO,CAAC,EAAE,oCAAoC,GAC9C,OAAO,CAAC,uBAAuB,CAAC,CAAC;CACxC"}
@@ -1 +1 @@
1
- {"version":3,"file":"module.mjs","names":["OAuth2AuthorizationCodeChallengeMethod","OAuth2GrantError","buildOAuth2CodeChallenge","OAuth2AuthorizationCodeVerifier","repository","verify","code","options","entity","popOneById","invalid","client_id","clientId","realmId","realm_id","redirect_uri","redirectUri","redirectUriMismatch","clientIsPublic","code_challenge","codeVerifier","code_challenge_method","SHA_256","codeVerifierHash"],"sources":["../../../../../../src/core/oauth2/authorization/code/verifier/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 { OAuth2AuthorizationCode } from '@authup/core-kit';\nimport { OAuth2AuthorizationCodeChallengeMethod, OAuth2GrantError } from '@authup/specs';\nimport { buildOAuth2CodeChallenge } from '../../helpers.ts';\n\nimport type { IOAuth2AuthorizationCodeRepository } from '../repository/index.ts';\nimport type { IOAuth2AuthorizationCodeVerifier, IOAuth2AuthorizationCodeVerifyOptions } from './types.ts';\n\nexport class OAuth2AuthorizationCodeVerifier implements IOAuth2AuthorizationCodeVerifier {\n protected repository : IOAuth2AuthorizationCodeRepository;\n\n constructor(repository: IOAuth2AuthorizationCodeRepository) {\n this.repository = repository;\n }\n\n async verify(code: string, options: IOAuth2AuthorizationCodeVerifyOptions) : Promise<OAuth2AuthorizationCode> {\n const entity = await this.repository.popOneById(code);\n if (!entity) {\n throw OAuth2GrantError.invalid();\n }\n\n // RFC 6749 §4.1.3: if the client was issued a client_id, verify the\n // authorization code was issued to the authenticated client. Always\n // require a clientId to be supplied so a malformed token request can't\n // bypass the binding by omitting it.\n if (entity.client_id) {\n if (!options.clientId || options.clientId !== entity.client_id) {\n throw OAuth2GrantError.invalid();\n }\n }\n\n // Realm binding (defense in depth): the code's realm (the authorizing\n // identity's realm) must match the authenticated client's realm. Blocks\n // redeeming a realm-A identity's code against a realm-B client — covers\n // codes minted outside OAuth2Authorization.authorize() (identity-provider\n // callback) and any in-flight codes issued before the authorize-side gate.\n if (options.realmId && entity.realm_id && entity.realm_id !== options.realmId) {\n throw OAuth2GrantError.invalid();\n }\n\n if (entity.redirect_uri) {\n if (!options.redirectUri || entity.redirect_uri !== options.redirectUri) {\n throw OAuth2GrantError.redirectUriMismatch();\n }\n }\n\n // Public clients MUST use PKCE (RFC 7636). Defense in depth in case\n // the authorize-side check was bypassed or the client's\n // is_confidential flag changed between authorize and token.\n if (options.clientIsPublic && !entity.code_challenge) {\n throw OAuth2GrantError.invalid('PKCE is required for public clients.');\n }\n\n if (entity.code_challenge) {\n if (!options.codeVerifier) {\n throw OAuth2GrantError.invalid('Code verifier invalid.');\n }\n\n // RFC 7636 §4.3: code_challenge_method defaults to \"plain\" when\n // absent. Only treat the challenge as S256 when the client\n // explicitly sent code_challenge_method=S256.\n if (entity.code_challenge_method === OAuth2AuthorizationCodeChallengeMethod.SHA_256) {\n const codeVerifierHash = await buildOAuth2CodeChallenge(options.codeVerifier);\n if (codeVerifierHash !== entity.code_challenge) {\n throw OAuth2GrantError.invalid('PKCE code_verifier mismatch.');\n }\n } else if (options.codeVerifier !== entity.code_challenge) {\n throw OAuth2GrantError.invalid('PKCE code_verifier mismatch.');\n }\n }\n\n return entity;\n }\n}\n"],"mappings":";;;;;;AAcA,IAAaG,kCAAb,MAAaA;CACCC;CAEV,YAAYA,YAAgD;EACxD,KAAKA,aAAaA;CACtB;CAEA,MAAMC,OAAOC,MAAcC,SAAmF;EAC1G,MAAMC,SAAS,MAAM,KAAKJ,WAAWK,WAAWH,IAAAA;EAChD,IAAI,CAACE,QACD,MAAMP,iBAAiBS,QAAO;EAOlC,IAAIF,OAAOG;OACH,CAACJ,QAAQK,YAAYL,QAAQK,aAAaJ,OAAOG,WACjD,MAAMV,iBAAiBS,QAAO;EAAA;EAStC,IAAIH,QAAQM,WAAWL,OAAOM,YAAYN,OAAOM,aAAaP,QAAQM,SAClE,MAAMZ,iBAAiBS,QAAO;EAGlC,IAAIF,OAAOO;OACH,CAACR,QAAQS,eAAeR,OAAOO,iBAAiBR,QAAQS,aACxD,MAAMf,iBAAiBgB,oBAAmB;EAAA;EAOlD,IAAIV,QAAQW,kBAAkB,CAACV,OAAOW,gBAClC,MAAMlB,iBAAiBS,QAAQ,sCAAA;EAGnC,IAAIF,OAAOW,gBAAgB;GACvB,IAAI,CAACZ,QAAQa,cACT,MAAMnB,iBAAiBS,QAAQ,wBAAA;GAMnC,IAAIF,OAAOa,0BAA0BrB,uCAAuCsB;QAEpEC,MAD2BrB,yBAAyBK,QAAQa,YAAY,MACnDZ,OAAOW,gBAC5B,MAAMlB,iBAAiBS,QAAQ,8BAAA;GAAA,OAEhC,IAAIH,QAAQa,iBAAiBZ,OAAOW,gBACvC,MAAMlB,iBAAiBS,QAAQ,8BAAA;EAEvC;EAEA,OAAOF;CACX;AACJ"}
1
+ {"version":3,"file":"module.mjs","names":["OAuth2AuthorizationCodeChallengeMethod","OAuth2GrantError","buildOAuth2CodeChallenge","OAuth2AuthorizationCodeVerifier","repository","verify","code","options","entity","popOneById","invalid","client_id","clientId","realmId","realm_id","redirect_uri","redirectUri","redirectUriMismatch","clientIsPublic","code_challenge","codeVerifier","code_challenge_method","SHA_256","codeVerifierHash"],"sources":["../../../../../../src/core/oauth2/authorization/code/verifier/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 { OAuth2AuthorizationCode } from '@authup/core-kit';\nimport { OAuth2AuthorizationCodeChallengeMethod, OAuth2GrantError } from '@authup/specs';\nimport { buildOAuth2CodeChallenge } from '../../helpers.ts';\n\nimport type { IOAuth2AuthorizationCodeRepository } from '../repository/index.ts';\nimport type { IOAuth2AuthorizationCodeVerifier, IOAuth2AuthorizationCodeVerifyOptions } from './types.ts';\n\nexport class OAuth2AuthorizationCodeVerifier implements IOAuth2AuthorizationCodeVerifier {\n protected repository : IOAuth2AuthorizationCodeRepository;\n\n constructor(repository: IOAuth2AuthorizationCodeRepository) {\n this.repository = repository;\n }\n\n async verify(code: string, options: IOAuth2AuthorizationCodeVerifyOptions) : Promise<OAuth2AuthorizationCode> {\n const entity = await this.repository.popOneById(code);\n if (!entity) {\n throw OAuth2GrantError.invalid();\n }\n\n // RFC 6749 §4.1.3: if the client was issued a client_id, verify the\n // authorization code was issued to the authenticated client. Always\n // require a clientId to be supplied so a malformed token request can't\n // bypass the binding by omitting it.\n if (entity.client_id) {\n if (!options.clientId || options.clientId !== entity.client_id) {\n throw OAuth2GrantError.invalid();\n }\n }\n\n // Realm binding (defense in depth): the code's realm (the authorizing\n // identity's realm) must match the authenticated client's realm. Blocks\n // redeeming a realm-A identity's code against a realm-B client — covers\n // codes minted outside OAuth2Authorization.authorize() (identity-provider\n // callback) and any in-flight codes issued before the authorize-side gate.\n if (options.realmId && entity.realm_id && entity.realm_id !== options.realmId) {\n throw OAuth2GrantError.invalid();\n }\n\n if (entity.redirect_uri) {\n if (!options.redirectUri || entity.redirect_uri !== options.redirectUri) {\n throw OAuth2GrantError.redirectUriMismatch();\n }\n }\n\n // Public clients MUST use PKCE (RFC 7636). Defense in depth in case\n // the authorize-side check was bypassed or the client's\n // auth_method changed between authorize and token.\n if (options.clientIsPublic && !entity.code_challenge) {\n throw OAuth2GrantError.invalid('PKCE is required for public clients.');\n }\n\n if (entity.code_challenge) {\n if (!options.codeVerifier) {\n throw OAuth2GrantError.invalid('Code verifier invalid.');\n }\n\n // RFC 7636 §4.3: code_challenge_method defaults to \"plain\" when\n // absent. Only treat the challenge as S256 when the client\n // explicitly sent code_challenge_method=S256.\n if (entity.code_challenge_method === OAuth2AuthorizationCodeChallengeMethod.SHA_256) {\n const codeVerifierHash = await buildOAuth2CodeChallenge(options.codeVerifier);\n if (codeVerifierHash !== entity.code_challenge) {\n throw OAuth2GrantError.invalid('PKCE code_verifier mismatch.');\n }\n } else if (options.codeVerifier !== entity.code_challenge) {\n throw OAuth2GrantError.invalid('PKCE code_verifier mismatch.');\n }\n }\n\n return entity;\n }\n}\n"],"mappings":";;;;;;AAcA,IAAaG,kCAAb,MAAaA;CACCC;CAEV,YAAYA,YAAgD;EACxD,KAAKA,aAAaA;CACtB;CAEA,MAAMC,OAAOC,MAAcC,SAAmF;EAC1G,MAAMC,SAAS,MAAM,KAAKJ,WAAWK,WAAWH,IAAAA;EAChD,IAAI,CAACE,QACD,MAAMP,iBAAiBS,QAAO;EAOlC,IAAIF,OAAOG;OACH,CAACJ,QAAQK,YAAYL,QAAQK,aAAaJ,OAAOG,WACjD,MAAMV,iBAAiBS,QAAO;EAAA;EAStC,IAAIH,QAAQM,WAAWL,OAAOM,YAAYN,OAAOM,aAAaP,QAAQM,SAClE,MAAMZ,iBAAiBS,QAAO;EAGlC,IAAIF,OAAOO;OACH,CAACR,QAAQS,eAAeR,OAAOO,iBAAiBR,QAAQS,aACxD,MAAMf,iBAAiBgB,oBAAmB;EAAA;EAOlD,IAAIV,QAAQW,kBAAkB,CAACV,OAAOW,gBAClC,MAAMlB,iBAAiBS,QAAQ,sCAAA;EAGnC,IAAIF,OAAOW,gBAAgB;GACvB,IAAI,CAACZ,QAAQa,cACT,MAAMnB,iBAAiBS,QAAQ,wBAAA;GAMnC,IAAIF,OAAOa,0BAA0BrB,uCAAuCsB;QAEpEC,MAD2BrB,yBAAyBK,QAAQa,YAAY,MACnDZ,OAAOW,gBAC5B,MAAMlB,iBAAiBS,QAAQ,8BAAA;GAAA,OAEhC,IAAIH,QAAQa,iBAAiBZ,OAAOW,gBACvC,MAAMlB,iBAAiBS,QAAQ,8BAAA;EAEvC;EAEA,OAAOF;CACX;AACJ"}