@authup/server-core 1.0.0-beta.57 → 1.0.0-beta.59

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 (416) hide show
  1. package/dist/adapters/database/logger/module.mjs +2 -4
  2. package/dist/adapters/database/logger/module.mjs.map +1 -1
  3. package/dist/adapters/http/controllers/entities/identity-provider/module.d.ts.map +1 -1
  4. package/dist/adapters/http/controllers/entities/identity-provider/module.mjs +1 -1
  5. package/dist/adapters/http/controllers/entities/identity-provider/module.mjs.map +1 -1
  6. package/dist/adapters/http/controllers/index.mjs +2 -1
  7. package/dist/adapters/http/controllers/workflows/account/index.d.ts +2 -0
  8. package/dist/adapters/http/controllers/workflows/account/index.d.ts.map +1 -0
  9. package/dist/adapters/http/controllers/workflows/account/index.mjs +5 -0
  10. package/dist/adapters/http/controllers/workflows/account/module.d.ts +24 -0
  11. package/dist/adapters/http/controllers/workflows/account/module.d.ts.map +1 -0
  12. package/dist/adapters/http/controllers/workflows/account/module.mjs +63 -0
  13. package/dist/adapters/http/controllers/workflows/account/module.mjs.map +1 -0
  14. package/dist/adapters/http/controllers/workflows/activate/module.mjs +1 -1
  15. package/dist/adapters/http/controllers/workflows/authorize/module.mjs +2 -2
  16. package/dist/adapters/http/controllers/workflows/authorize/module.mjs.map +1 -1
  17. package/dist/adapters/http/controllers/workflows/index.d.ts +1 -0
  18. package/dist/adapters/http/controllers/workflows/index.d.ts.map +1 -1
  19. package/dist/adapters/http/controllers/workflows/index.mjs +3 -1
  20. package/dist/adapters/http/controllers/workflows/logout/module.mjs +2 -2
  21. package/dist/adapters/http/controllers/workflows/logout/module.mjs.map +1 -1
  22. package/dist/adapters/http/controllers/workflows/password-forgot/module.mjs +1 -1
  23. package/dist/adapters/http/controllers/workflows/password-reset/module.mjs +1 -1
  24. package/dist/adapters/http/controllers/workflows/register/module.mjs +1 -1
  25. package/dist/adapters/http/controllers/workflows/userinfo/module.d.ts.map +1 -1
  26. package/dist/adapters/http/controllers/workflows/userinfo/module.mjs +5 -1
  27. package/dist/adapters/http/controllers/workflows/userinfo/module.mjs.map +1 -1
  28. package/dist/adapters/http/index.mjs +3 -1
  29. package/dist/adapters/http/middleware/built-in/assets.d.ts +8 -1
  30. package/dist/adapters/http/middleware/built-in/assets.d.ts.map +1 -1
  31. package/dist/adapters/http/middleware/built-in/assets.mjs +48 -4
  32. package/dist/adapters/http/middleware/built-in/assets.mjs.map +1 -1
  33. package/dist/adapters/http/middleware/built-in/authorization/module.mjs +2 -1
  34. package/dist/adapters/http/middleware/built-in/authorization/module.mjs.map +1 -1
  35. package/dist/adapters/http/middleware/built-in/index.d.ts +2 -0
  36. package/dist/adapters/http/middleware/built-in/index.d.ts.map +1 -1
  37. package/dist/adapters/http/middleware/built-in/index.mjs +2 -1
  38. package/dist/adapters/http/middleware/built-in/rate-limit.mjs +2 -2
  39. package/dist/adapters/http/middleware/built-in/rate-limit.mjs.map +1 -1
  40. package/dist/adapters/http/middleware/built-in/theme.d.ts +15 -0
  41. package/dist/adapters/http/middleware/built-in/theme.d.ts.map +1 -0
  42. package/dist/adapters/http/middleware/built-in/theme.mjs +27 -0
  43. package/dist/adapters/http/middleware/built-in/theme.mjs.map +1 -0
  44. package/dist/adapters/http/middleware/built-in/types.d.ts +14 -0
  45. package/dist/adapters/http/middleware/built-in/types.d.ts.map +1 -0
  46. package/dist/adapters/http/middleware/built-in/ui-http-client.d.ts +1 -1
  47. package/dist/adapters/http/middleware/built-in/ui-http-client.mjs +1 -1
  48. package/dist/adapters/http/middleware/built-in/ui-http-client.mjs.map +1 -1
  49. package/dist/adapters/http/middleware/index.mjs +2 -1
  50. package/dist/adapters/http/request/client-certificate.mjs +1 -1
  51. package/dist/adapters/http/request/client-certificate.mjs.map +1 -1
  52. package/dist/adapters/http/request/helpers/locations.mjs +1 -3
  53. package/dist/adapters/http/request/helpers/locations.mjs.map +1 -1
  54. package/dist/adapters/http/ui/account-console/index.d.ts +4 -0
  55. package/dist/adapters/http/ui/account-console/index.d.ts.map +1 -0
  56. package/dist/adapters/http/ui/account-console/index.mjs +6 -0
  57. package/dist/adapters/http/ui/account-console/module.d.ts +28 -0
  58. package/dist/adapters/http/ui/account-console/module.d.ts.map +1 -0
  59. package/dist/adapters/http/ui/account-console/module.mjs +80 -0
  60. package/dist/adapters/http/ui/account-console/module.mjs.map +1 -0
  61. package/dist/adapters/http/ui/account-console/ref.d.ts +30 -0
  62. package/dist/adapters/http/ui/account-console/ref.d.ts.map +1 -0
  63. package/dist/adapters/http/ui/account-console/ref.mjs +50 -0
  64. package/dist/adapters/http/ui/account-console/ref.mjs.map +1 -0
  65. package/dist/adapters/http/ui/account-console/types.d.ts +11 -0
  66. package/dist/adapters/http/ui/account-console/types.d.ts.map +1 -0
  67. package/dist/adapters/http/ui/account-console/types.mjs +4 -0
  68. package/dist/adapters/http/ui/{internal-http-client.d.ts → auth-console/http-client.d.ts} +1 -1
  69. package/dist/adapters/http/ui/auth-console/http-client.d.ts.map +1 -0
  70. package/dist/adapters/http/ui/{internal-http-client.mjs → auth-console/http-client.mjs} +2 -2
  71. package/dist/adapters/http/ui/auth-console/http-client.mjs.map +1 -0
  72. package/dist/adapters/http/ui/auth-console/index.d.ts +6 -0
  73. package/dist/adapters/http/ui/auth-console/index.d.ts.map +1 -0
  74. package/dist/adapters/http/ui/auth-console/index.mjs +8 -0
  75. package/dist/adapters/http/ui/auth-console/module.d.ts +4 -0
  76. package/dist/adapters/http/ui/auth-console/module.d.ts.map +1 -0
  77. package/dist/adapters/http/ui/auth-console/module.mjs +73 -0
  78. package/dist/adapters/http/ui/auth-console/module.mjs.map +1 -0
  79. package/dist/adapters/http/ui/auth-console/resolve.d.ts +21 -0
  80. package/dist/adapters/http/ui/auth-console/resolve.d.ts.map +1 -0
  81. package/dist/adapters/http/ui/auth-console/resolve.mjs +53 -0
  82. package/dist/adapters/http/ui/auth-console/resolve.mjs.map +1 -0
  83. package/dist/adapters/http/ui/{serve.d.ts → auth-console/serve.d.ts} +1 -8
  84. package/dist/adapters/http/ui/auth-console/serve.d.ts.map +1 -0
  85. package/dist/adapters/http/ui/{serve.mjs → auth-console/serve.mjs} +5 -5
  86. package/dist/adapters/http/ui/auth-console/serve.mjs.map +1 -0
  87. package/dist/adapters/http/ui/auth-console/types.d.ts +26 -0
  88. package/dist/adapters/http/ui/auth-console/types.d.ts.map +1 -0
  89. package/dist/adapters/http/ui/auth-console/types.mjs +4 -0
  90. package/dist/adapters/http/ui/console-packages/index.d.ts +3 -0
  91. package/dist/adapters/http/ui/console-packages/index.d.ts.map +1 -0
  92. package/dist/adapters/http/ui/console-packages/index.mjs +5 -0
  93. package/dist/adapters/http/ui/console-packages/module.d.ts +33 -0
  94. package/dist/adapters/http/ui/console-packages/module.d.ts.map +1 -0
  95. package/dist/adapters/http/ui/console-packages/module.mjs +70 -0
  96. package/dist/adapters/http/ui/console-packages/module.mjs.map +1 -0
  97. package/dist/adapters/http/ui/console-packages/types.d.ts +12 -0
  98. package/dist/adapters/http/ui/console-packages/types.d.ts.map +1 -0
  99. package/dist/adapters/http/ui/console-packages/types.mjs +4 -0
  100. package/dist/adapters/http/ui/index.d.ts +5 -5
  101. package/dist/adapters/http/ui/index.d.ts.map +1 -1
  102. package/dist/adapters/http/ui/index.mjs +22 -5
  103. package/dist/adapters/http/ui/shared/html.d.ts +76 -0
  104. package/dist/adapters/http/ui/shared/html.d.ts.map +1 -0
  105. package/dist/adapters/http/ui/shared/html.mjs +103 -0
  106. package/dist/adapters/http/ui/shared/html.mjs.map +1 -0
  107. package/dist/adapters/http/ui/shared/index.d.ts +2 -0
  108. package/dist/adapters/http/ui/shared/index.d.ts.map +1 -0
  109. package/dist/adapters/http/ui/shared/index.mjs +5 -0
  110. package/dist/adapters/http/ui/theme/apply.d.ts +12 -0
  111. package/dist/adapters/http/ui/theme/apply.d.ts.map +1 -0
  112. package/dist/adapters/http/ui/theme/apply.mjs +29 -0
  113. package/dist/adapters/http/ui/theme/apply.mjs.map +1 -0
  114. package/dist/adapters/http/ui/theme/assets.d.ts +20 -0
  115. package/dist/adapters/http/ui/theme/assets.d.ts.map +1 -0
  116. package/dist/adapters/http/ui/theme/assets.mjs +86 -0
  117. package/dist/adapters/http/ui/theme/assets.mjs.map +1 -0
  118. package/dist/adapters/http/ui/theme/constants.d.ts +16 -0
  119. package/dist/adapters/http/ui/theme/constants.d.ts.map +1 -0
  120. package/dist/adapters/http/ui/theme/constants.mjs +20 -0
  121. package/dist/adapters/http/ui/theme/constants.mjs.map +1 -0
  122. package/dist/adapters/http/ui/theme/contract/constants.d.ts +120 -0
  123. package/dist/adapters/http/ui/theme/contract/constants.d.ts.map +1 -0
  124. package/dist/adapters/http/ui/theme/contract/constants.mjs +136 -0
  125. package/dist/adapters/http/ui/theme/contract/constants.mjs.map +1 -0
  126. package/dist/adapters/http/ui/theme/contract/head.d.ts +12 -0
  127. package/dist/adapters/http/ui/theme/contract/head.d.ts.map +1 -0
  128. package/dist/adapters/http/ui/theme/contract/head.mjs +61 -0
  129. package/dist/adapters/http/ui/theme/contract/head.mjs.map +1 -0
  130. package/dist/adapters/http/ui/theme/contract/index.d.ts +6 -0
  131. package/dist/adapters/http/ui/theme/contract/index.d.ts.map +1 -0
  132. package/dist/adapters/http/ui/theme/contract/index.mjs +8 -0
  133. package/dist/adapters/http/ui/theme/contract/manifest.d.ts +25 -0
  134. package/dist/adapters/http/ui/theme/contract/manifest.d.ts.map +1 -0
  135. package/dist/adapters/http/ui/theme/contract/manifest.mjs +77 -0
  136. package/dist/adapters/http/ui/theme/contract/manifest.mjs.map +1 -0
  137. package/dist/adapters/http/ui/theme/contract/types.d.ts +26 -0
  138. package/dist/adapters/http/ui/theme/contract/types.d.ts.map +1 -0
  139. package/dist/adapters/http/ui/theme/contract/types.mjs +4 -0
  140. package/dist/adapters/http/ui/theme/contract/utils.d.ts +11 -0
  141. package/dist/adapters/http/ui/theme/contract/utils.d.ts.map +1 -0
  142. package/dist/adapters/http/ui/theme/contract/utils.mjs +22 -0
  143. package/dist/adapters/http/ui/theme/contract/utils.mjs.map +1 -0
  144. package/dist/adapters/http/ui/theme/index.d.ts +7 -0
  145. package/dist/adapters/http/ui/theme/index.d.ts.map +1 -0
  146. package/dist/adapters/http/ui/theme/index.mjs +13 -0
  147. package/dist/adapters/http/ui/theme/module.d.ts +79 -0
  148. package/dist/adapters/http/ui/theme/module.d.ts.map +1 -0
  149. package/dist/adapters/http/ui/theme/module.mjs +206 -0
  150. package/dist/adapters/http/ui/theme/module.mjs.map +1 -0
  151. package/dist/adapters/http/ui/theme/types.d.ts +42 -0
  152. package/dist/adapters/http/ui/theme/types.d.ts.map +1 -0
  153. package/dist/adapters/http/ui/theme/types.mjs +4 -0
  154. package/dist/app/index.mjs +3 -1
  155. package/dist/app/modules/authentication/module.mjs +6 -3
  156. package/dist/app/modules/authentication/module.mjs.map +1 -1
  157. package/dist/app/modules/config/constants.d.ts +5 -0
  158. package/dist/app/modules/config/constants.d.ts.map +1 -1
  159. package/dist/app/modules/config/constants.mjs +5 -0
  160. package/dist/app/modules/config/constants.mjs.map +1 -1
  161. package/dist/app/modules/config/helpers.mjs +3 -2
  162. package/dist/app/modules/config/helpers.mjs.map +1 -1
  163. package/dist/app/modules/config/normalize.d.ts.map +1 -1
  164. package/dist/app/modules/config/normalize.mjs +8 -0
  165. package/dist/app/modules/config/normalize.mjs.map +1 -1
  166. package/dist/app/modules/config/origins.d.ts.map +1 -1
  167. package/dist/app/modules/config/origins.mjs +2 -0
  168. package/dist/app/modules/config/origins.mjs.map +1 -1
  169. package/dist/app/modules/config/read/env.d.ts.map +1 -1
  170. package/dist/app/modules/config/read/env.mjs +10 -0
  171. package/dist/app/modules/config/read/env.mjs.map +1 -1
  172. package/dist/app/modules/config/read/module.mjs +8 -3
  173. package/dist/app/modules/config/read/module.mjs.map +1 -1
  174. package/dist/app/modules/config/types.d.ts +63 -3
  175. package/dist/app/modules/config/types.d.ts.map +1 -1
  176. package/dist/app/modules/config/validator.d.ts.map +1 -1
  177. package/dist/app/modules/config/validator.mjs +5 -0
  178. package/dist/app/modules/config/validator.mjs.map +1 -1
  179. package/dist/app/modules/database/module.mjs +2 -1
  180. package/dist/app/modules/database/module.mjs.map +1 -1
  181. package/dist/app/modules/http/module.d.ts.map +1 -1
  182. package/dist/app/modules/http/module.mjs +7 -1
  183. package/dist/app/modules/http/module.mjs.map +1 -1
  184. package/dist/app/modules/http/modules/controller.d.ts +2 -1
  185. package/dist/app/modules/http/modules/controller.d.ts.map +1 -1
  186. package/dist/app/modules/http/modules/controller.mjs +214 -128
  187. package/dist/app/modules/http/modules/controller.mjs.map +1 -1
  188. package/dist/app/modules/http/modules/middleware.d.ts +9 -1
  189. package/dist/app/modules/http/modules/middleware.d.ts.map +1 -1
  190. package/dist/app/modules/http/modules/middleware.mjs +28 -8
  191. package/dist/app/modules/http/modules/middleware.mjs.map +1 -1
  192. package/dist/app/modules/identity/module.mjs +6 -3
  193. package/dist/app/modules/identity/module.mjs.map +1 -1
  194. package/dist/app/modules/index.mjs +3 -1
  195. package/dist/app/modules/oauth2/module.mjs +37 -17
  196. package/dist/app/modules/oauth2/module.mjs.map +1 -1
  197. package/dist/app/modules/oauth2/repositories/authorize/state/repository.mjs +1 -1
  198. package/dist/app/modules/oauth2/repositories/authorize/state/repository.mjs.map +1 -1
  199. package/dist/app/modules/oauth2/repositories/token/repository.mjs +1 -1
  200. package/dist/app/modules/oauth2/repositories/token/repository.mjs.map +1 -1
  201. package/dist/app/modules/provisioning/constants.d.ts +12 -0
  202. package/dist/app/modules/provisioning/constants.d.ts.map +1 -0
  203. package/dist/app/modules/provisioning/constants.mjs +16 -0
  204. package/dist/app/modules/provisioning/constants.mjs.map +1 -0
  205. package/dist/app/modules/provisioning/index.d.ts +2 -0
  206. package/dist/app/modules/provisioning/index.d.ts.map +1 -1
  207. package/dist/app/modules/provisioning/index.mjs +3 -1
  208. package/dist/app/modules/provisioning/lazy-wildcard.d.ts +15 -0
  209. package/dist/app/modules/provisioning/lazy-wildcard.d.ts.map +1 -0
  210. package/dist/app/modules/provisioning/lazy-wildcard.mjs +23 -0
  211. package/dist/app/modules/provisioning/lazy-wildcard.mjs.map +1 -0
  212. package/dist/app/modules/provisioning/module.d.ts.map +1 -1
  213. package/dist/app/modules/provisioning/module.mjs +30 -11
  214. package/dist/app/modules/provisioning/module.mjs.map +1 -1
  215. package/dist/app/modules/provisioning/sources/composite/module.d.ts +0 -19
  216. package/dist/app/modules/provisioning/sources/composite/module.d.ts.map +1 -1
  217. package/dist/app/modules/provisioning/sources/composite/module.mjs +7 -77
  218. package/dist/app/modules/provisioning/sources/composite/module.mjs.map +1 -1
  219. package/dist/app/modules/provisioning/sources/file/module.d.ts.map +1 -1
  220. package/dist/app/modules/provisioning/sources/file/module.mjs +11 -2
  221. package/dist/app/modules/provisioning/sources/file/module.mjs.map +1 -1
  222. package/dist/core/authentication/session/module.mjs +2 -4
  223. package/dist/core/authentication/session/module.mjs.map +1 -1
  224. package/dist/core/entities/client/index.d.ts +1 -1
  225. package/dist/core/entities/client/index.d.ts.map +1 -1
  226. package/dist/core/entities/client/index.mjs +2 -2
  227. package/dist/core/entities/client/service.d.ts.map +1 -1
  228. package/dist/core/entities/client/service.mjs +1 -1
  229. package/dist/core/entities/client/service.mjs.map +1 -1
  230. package/dist/core/entities/client/system-clients.d.ts +95 -0
  231. package/dist/core/entities/client/system-clients.d.ts.map +1 -0
  232. package/dist/core/entities/client/system-clients.mjs +158 -0
  233. package/dist/core/entities/client/system-clients.mjs.map +1 -0
  234. package/dist/core/entities/client/types.d.ts +17 -4
  235. package/dist/core/entities/client/types.d.ts.map +1 -1
  236. package/dist/core/entities/client-permission/service.mjs +12 -9
  237. package/dist/core/entities/client-permission/service.mjs.map +1 -1
  238. package/dist/core/entities/index.mjs +2 -2
  239. package/dist/core/entities/key/service.mjs +4 -2
  240. package/dist/core/entities/key/service.mjs.map +1 -1
  241. package/dist/core/entities/permission/service.d.ts.map +1 -1
  242. package/dist/core/entities/permission/service.mjs +1 -1
  243. package/dist/core/entities/permission/service.mjs.map +1 -1
  244. package/dist/core/entities/policy/service.d.ts.map +1 -1
  245. package/dist/core/entities/policy/service.mjs +3 -2
  246. package/dist/core/entities/policy/service.mjs.map +1 -1
  247. package/dist/core/entities/realm/service.d.ts +8 -6
  248. package/dist/core/entities/realm/service.d.ts.map +1 -1
  249. package/dist/core/entities/realm/service.mjs +6 -9
  250. package/dist/core/entities/realm/service.mjs.map +1 -1
  251. package/dist/core/entities/role/service.d.ts.map +1 -1
  252. package/dist/core/entities/role/service.mjs +1 -1
  253. package/dist/core/entities/role/service.mjs.map +1 -1
  254. package/dist/core/entities/role-permission/service.mjs +12 -9
  255. package/dist/core/entities/role-permission/service.mjs.map +1 -1
  256. package/dist/core/entities/scope/service.d.ts.map +1 -1
  257. package/dist/core/entities/scope/service.mjs +1 -1
  258. package/dist/core/entities/scope/service.mjs.map +1 -1
  259. package/dist/core/entities/user/service.d.ts.map +1 -1
  260. package/dist/core/entities/user/service.mjs +1 -1
  261. package/dist/core/entities/user/service.mjs.map +1 -1
  262. package/dist/core/entities/user-authenticator/helpers.mjs +1 -1
  263. package/dist/core/entities/user-authenticator/helpers.mjs.map +1 -1
  264. package/dist/core/entities/user-authenticator/service.mjs +7 -7
  265. package/dist/core/entities/user-authenticator/service.mjs.map +1 -1
  266. package/dist/core/entities/user-permission/service.mjs +12 -9
  267. package/dist/core/entities/user-permission/service.mjs.map +1 -1
  268. package/dist/core/identity/password-recovery/service.mjs +1 -1
  269. package/dist/core/identity/password-recovery/service.mjs.map +1 -1
  270. package/dist/core/index.mjs +6 -2
  271. package/dist/core/key/types.d.ts +2 -1
  272. package/dist/core/key/types.d.ts.map +1 -1
  273. package/dist/core/oauth2/authorization/code-request/verifier/module.d.ts.map +1 -1
  274. package/dist/core/oauth2/authorization/code-request/verifier/module.mjs +2 -2
  275. package/dist/core/oauth2/authorization/code-request/verifier/module.mjs.map +1 -1
  276. package/dist/core/oauth2/end-session/service.d.ts.map +1 -1
  277. package/dist/core/oauth2/end-session/service.mjs +2 -2
  278. package/dist/core/oauth2/end-session/service.mjs.map +1 -1
  279. package/dist/core/provisioning/constants.d.ts +8 -0
  280. package/dist/core/provisioning/constants.d.ts.map +1 -0
  281. package/dist/core/provisioning/constants.mjs +14 -0
  282. package/dist/core/provisioning/constants.mjs.map +1 -0
  283. package/dist/core/provisioning/entities/index.mjs +2 -1
  284. package/dist/core/provisioning/entities/realm/index.d.ts +1 -0
  285. package/dist/core/provisioning/entities/realm/index.d.ts.map +1 -1
  286. package/dist/core/provisioning/entities/realm/index.mjs +2 -1
  287. package/dist/core/provisioning/entities/realm/validator.d.ts +11 -0
  288. package/dist/core/provisioning/entities/realm/validator.d.ts.map +1 -1
  289. package/dist/core/provisioning/entities/realm/validator.mjs +14 -0
  290. package/dist/core/provisioning/entities/realm/validator.mjs.map +1 -1
  291. package/dist/core/provisioning/entities/realm/wildcard-validator.d.ts +19 -0
  292. package/dist/core/provisioning/entities/realm/wildcard-validator.d.ts.map +1 -0
  293. package/dist/core/provisioning/entities/realm/wildcard-validator.mjs +65 -0
  294. package/dist/core/provisioning/entities/realm/wildcard-validator.mjs.map +1 -0
  295. package/dist/core/provisioning/index.d.ts +3 -0
  296. package/dist/core/provisioning/index.d.ts.map +1 -1
  297. package/dist/core/provisioning/index.mjs +7 -1
  298. package/dist/core/provisioning/merge/index.d.ts +3 -0
  299. package/dist/core/provisioning/merge/index.d.ts.map +1 -0
  300. package/dist/core/provisioning/merge/index.mjs +5 -0
  301. package/dist/core/provisioning/merge/module.d.ts +18 -0
  302. package/dist/core/provisioning/merge/module.d.ts.map +1 -0
  303. package/dist/core/provisioning/merge/module.mjs +82 -0
  304. package/dist/core/provisioning/merge/module.mjs.map +1 -0
  305. package/dist/core/provisioning/merge/types.d.ts +34 -0
  306. package/dist/core/provisioning/merge/types.d.ts.map +1 -0
  307. package/dist/core/provisioning/merge/types.mjs +4 -0
  308. package/dist/core/provisioning/synchronizer/client/module.mjs +0 -1
  309. package/dist/core/provisioning/synchronizer/client/module.mjs.map +1 -1
  310. package/dist/core/provisioning/synchronizer/permission/module.mjs +0 -1
  311. package/dist/core/provisioning/synchronizer/permission/module.mjs.map +1 -1
  312. package/dist/core/provisioning/synchronizer/realm/module.mjs +0 -1
  313. package/dist/core/provisioning/synchronizer/realm/module.mjs.map +1 -1
  314. package/dist/core/provisioning/synchronizer/role/module.mjs +0 -1
  315. package/dist/core/provisioning/synchronizer/role/module.mjs.map +1 -1
  316. package/dist/core/provisioning/synchronizer/scope/module.mjs +0 -1
  317. package/dist/core/provisioning/synchronizer/scope/module.mjs.map +1 -1
  318. package/dist/core/provisioning/synchronizer/user/module.mjs +0 -1
  319. package/dist/core/provisioning/synchronizer/user/module.mjs.map +1 -1
  320. package/dist/core/provisioning/types.d.ts +10 -0
  321. package/dist/core/provisioning/types.d.ts.map +1 -1
  322. package/dist/core/provisioning/wildcard/index.d.ts +3 -0
  323. package/dist/core/provisioning/wildcard/index.d.ts.map +1 -0
  324. package/dist/core/provisioning/wildcard/index.mjs +5 -0
  325. package/dist/core/provisioning/wildcard/module.d.ts +53 -0
  326. package/dist/core/provisioning/wildcard/module.d.ts.map +1 -0
  327. package/dist/core/provisioning/wildcard/module.mjs +91 -0
  328. package/dist/core/provisioning/wildcard/module.mjs.map +1 -0
  329. package/dist/core/provisioning/wildcard/types.d.ts +19 -0
  330. package/dist/core/provisioning/wildcard/types.d.ts.map +1 -0
  331. package/dist/core/provisioning/wildcard/types.mjs +4 -0
  332. package/dist/index.mjs +5 -1
  333. package/dist/path.d.ts +0 -2
  334. package/dist/path.d.ts.map +1 -1
  335. package/dist/path.mjs +1 -3
  336. package/dist/path.mjs.map +1 -1
  337. package/dist/swagger.json +485 -17
  338. package/package.json +26 -63
  339. package/dist/adapters/http/ui/base-path.d.ts +0 -9
  340. package/dist/adapters/http/ui/base-path.d.ts.map +0 -1
  341. package/dist/adapters/http/ui/base-path.mjs +0 -18
  342. package/dist/adapters/http/ui/base-path.mjs.map +0 -1
  343. package/dist/adapters/http/ui/internal-http-client.d.ts.map +0 -1
  344. package/dist/adapters/http/ui/internal-http-client.mjs.map +0 -1
  345. package/dist/adapters/http/ui/render.d.ts +0 -4
  346. package/dist/adapters/http/ui/render.d.ts.map +0 -1
  347. package/dist/adapters/http/ui/render.mjs +0 -63
  348. package/dist/adapters/http/ui/render.mjs.map +0 -1
  349. package/dist/adapters/http/ui/serve.d.ts.map +0 -1
  350. package/dist/adapters/http/ui/serve.mjs.map +0 -1
  351. package/dist/adapters/http/ui/types.d.ts +0 -20
  352. package/dist/adapters/http/ui/types.d.ts.map +0 -1
  353. package/dist/core/entities/client/web-client.d.ts +0 -72
  354. package/dist/core/entities/client/web-client.d.ts.map +0 -1
  355. package/dist/core/entities/client/web-client.mjs +0 -123
  356. package/dist/core/entities/client/web-client.mjs.map +0 -1
  357. package/dist/ui/client/.vite/ssr-manifest.json +0 -54812
  358. package/dist/ui/client/assets/asap-latin-400-normal-Dc37g3Il.woff +0 -0
  359. package/dist/ui/client/assets/asap-latin-400-normal-DnZ1MOsG.woff2 +0 -0
  360. package/dist/ui/client/assets/asap-latin-700-normal-Dqcopq14.woff +0 -0
  361. package/dist/ui/client/assets/asap-latin-700-normal-l2Y8pi-F.woff2 +0 -0
  362. package/dist/ui/client/assets/asap-latin-ext-400-normal-C-fcRdtE.woff +0 -0
  363. package/dist/ui/client/assets/asap-latin-ext-400-normal-DwYtpHbV.woff2 +0 -0
  364. package/dist/ui/client/assets/asap-latin-ext-700-normal-D00OESsZ.woff +0 -0
  365. package/dist/ui/client/assets/asap-latin-ext-700-normal-y8bo5aW5.woff2 +0 -0
  366. package/dist/ui/client/assets/asap-vietnamese-400-normal-DGyJlJLT.woff2 +0 -0
  367. package/dist/ui/client/assets/asap-vietnamese-400-normal-lfLaoF2x.woff +0 -0
  368. package/dist/ui/client/assets/asap-vietnamese-700-normal-B-e19ug5.woff +0 -0
  369. package/dist/ui/client/assets/asap-vietnamese-700-normal-D-SxY94i.woff2 +0 -0
  370. package/dist/ui/client/assets/index-Bk6-OZy9.css +0 -2
  371. package/dist/ui/client/assets/index-DO6_7NTJ.js +0 -106
  372. package/dist/ui/client/assets/nunito-cyrillic-300-normal-BPQV259B.woff2 +0 -0
  373. package/dist/ui/client/assets/nunito-cyrillic-300-normal-g5qSsvc0.woff +0 -0
  374. package/dist/ui/client/assets/nunito-cyrillic-400-normal-D1j0u8EH.woff +0 -0
  375. package/dist/ui/client/assets/nunito-cyrillic-400-normal-xAOo5cBP.woff2 +0 -0
  376. package/dist/ui/client/assets/nunito-cyrillic-600-normal-BUjmtIuu.woff +0 -0
  377. package/dist/ui/client/assets/nunito-cyrillic-600-normal-DJGQ2h05.woff2 +0 -0
  378. package/dist/ui/client/assets/nunito-cyrillic-700-normal-DP36NgGt.woff2 +0 -0
  379. package/dist/ui/client/assets/nunito-cyrillic-700-normal-DfHRUDv-.woff +0 -0
  380. package/dist/ui/client/assets/nunito-cyrillic-ext-300-normal-BDHtqmCR.woff +0 -0
  381. package/dist/ui/client/assets/nunito-cyrillic-ext-300-normal-ChMQLIrm.woff2 +0 -0
  382. package/dist/ui/client/assets/nunito-cyrillic-ext-400-normal-CuPM9foi.woff2 +0 -0
  383. package/dist/ui/client/assets/nunito-cyrillic-ext-400-normal-xaE7D4Sw.woff +0 -0
  384. package/dist/ui/client/assets/nunito-cyrillic-ext-600-normal-CWPPjBOD.woff2 +0 -0
  385. package/dist/ui/client/assets/nunito-cyrillic-ext-600-normal-vnfu4DTE.woff +0 -0
  386. package/dist/ui/client/assets/nunito-cyrillic-ext-700-normal-BuR0mlCG.woff2 +0 -0
  387. package/dist/ui/client/assets/nunito-cyrillic-ext-700-normal-DfoqN4Gs.woff +0 -0
  388. package/dist/ui/client/assets/nunito-latin-300-normal-C3ZIKvzv.woff +0 -0
  389. package/dist/ui/client/assets/nunito-latin-300-normal-COoPE5VN.woff2 +0 -0
  390. package/dist/ui/client/assets/nunito-latin-400-normal-DKg4f3fz.woff +0 -0
  391. package/dist/ui/client/assets/nunito-latin-400-normal-r8SDr6Up.woff2 +0 -0
  392. package/dist/ui/client/assets/nunito-latin-600-normal-Br8yIETf.woff2 +0 -0
  393. package/dist/ui/client/assets/nunito-latin-600-normal-Cd0eNu1l.woff +0 -0
  394. package/dist/ui/client/assets/nunito-latin-700-normal-Dort48En.woff2 +0 -0
  395. package/dist/ui/client/assets/nunito-latin-700-normal-OcDqTBcA.woff +0 -0
  396. package/dist/ui/client/assets/nunito-latin-ext-300-normal-D1SyVuPt.woff2 +0 -0
  397. package/dist/ui/client/assets/nunito-latin-ext-300-normal-DfqbmdMl.woff +0 -0
  398. package/dist/ui/client/assets/nunito-latin-ext-400-normal-CjMJVfGn.woff +0 -0
  399. package/dist/ui/client/assets/nunito-latin-ext-400-normal-i-8OOpdj.woff2 +0 -0
  400. package/dist/ui/client/assets/nunito-latin-ext-600-normal-BKUpuB78.woff +0 -0
  401. package/dist/ui/client/assets/nunito-latin-ext-600-normal-Dd9Zuxh1.woff2 +0 -0
  402. package/dist/ui/client/assets/nunito-latin-ext-700-normal-BWeMsAzO.woff2 +0 -0
  403. package/dist/ui/client/assets/nunito-latin-ext-700-normal-D4woHhbd.woff +0 -0
  404. package/dist/ui/client/assets/nunito-vietnamese-300-normal-DATld5Vw.woff +0 -0
  405. package/dist/ui/client/assets/nunito-vietnamese-300-normal-mLneKULB.woff2 +0 -0
  406. package/dist/ui/client/assets/nunito-vietnamese-400-normal-BHkVbP3T.woff2 +0 -0
  407. package/dist/ui/client/assets/nunito-vietnamese-400-normal-DtOtW02z.woff +0 -0
  408. package/dist/ui/client/assets/nunito-vietnamese-600-normal-BY8O6Cug.woff2 +0 -0
  409. package/dist/ui/client/assets/nunito-vietnamese-600-normal-DO1RqFw5.woff +0 -0
  410. package/dist/ui/client/assets/nunito-vietnamese-700-normal-C9SQsXvj.woff +0 -0
  411. package/dist/ui/client/assets/nunito-vietnamese-700-normal-Ch8EUCfz.woff2 +0 -0
  412. package/dist/ui/client/index.html +0 -22
  413. package/dist/ui/server/assets/multipart-parser-BCMy8Xwv.js +0 -181
  414. package/dist/ui/server/assets/multipart-parser-BVY8pIV2.js +0 -176
  415. package/dist/ui/server/server.js +0 -158420
  416. /package/dist/adapters/http/{ui → middleware/built-in}/types.mjs +0 -0
@@ -39,6 +39,10 @@ async function normalizeConfig(input = {}) {
39
39
  env,
40
40
  rootPath: process.cwd(),
41
41
  writableDirectoryPath,
42
+ themeDirectoryPath: "",
43
+ themeFragmentsEnabled: false,
44
+ authConsolePath: "",
45
+ accountConsolePath: "",
42
46
  logger: true,
43
47
  redis: false,
44
48
  smtp: false,
@@ -64,6 +68,7 @@ async function normalizeConfig(input = {}) {
64
68
  emailVerificationEnabled: false,
65
69
  passwordRecoveryEnabled: false,
66
70
  passwordMinLength: USER_PASSWORD_MIN_LENGTH,
71
+ accountConsoleEnabled: true,
67
72
  eventLogEnabled: true,
68
73
  eventLogRetentionDays: 90,
69
74
  eventLogEntityEnabled: true,
@@ -89,6 +94,9 @@ async function normalizeConfig(input = {}) {
89
94
  ...parsed,
90
95
  trustedOrigins
91
96
  };
97
+ if (config.themeDirectoryPath) config.themeDirectoryPath = path.resolve(config.rootPath, config.themeDirectoryPath);
98
+ if (config.authConsolePath) config.authConsolePath = path.resolve(config.rootPath, config.authConsolePath);
99
+ if (config.accountConsolePath) config.accountConsolePath = path.resolve(config.rootPath, config.accountConsolePath);
92
100
  if (typeof config.trustProxy === "string") config.trustProxy = canonicalizeTrustProxy(config.trustProxy);
93
101
  else if (Array.isArray(config.trustProxy)) config.trustProxy = config.trustProxy.map(canonicalizeTrustProxyListEntry);
94
102
  if (config.loginAttemptThrottleEnabled && !config.eventLogEnabled) throw new AuthupError("loginAttemptThrottleEnabled requires eventLogEnabled.");
@@ -1 +1 @@
1
- {"version":3,"file":"normalize.mjs","names":["read","path","process","USER_PASSWORD_MIN_LENGTH","AuthupError","EnvironmentName","base64ToArrayBuffer","EVENT_LOG_RETENTION_DAYS_DEFAULT","toPublicHost","expandToOrigins","parseConfig","canonicalizeTrustProxy","canonicalizeTrustProxyListEntry","normalizeConfig","input","parsed","writableDirectoryPath","join","cwd","port","host","publicUrl","regex","match","env","DEVELOPMENT","trustedOrigins","value","origin","includes","push","PRODUCTION","devOrigin","config","rootPath","logger","redis","smtp","mtlsPublicUrl","certificateSource","trustProxy","middlewareBody","middlewareCookie","middlewareCors","middlewarePrometheus","middlewareQuery","middlewareRateLimit","middlewareSwagger","tokenRefreshMaxAge","tokenAccessMaxAge","tokenRefreshGracePeriod","promptLoginMaxAge","endSessionHintGracePeriod","registrationEnabled","emailVerificationEnabled","passwordRecoveryEnabled","passwordMinLength","eventLogEnabled","eventLogRetentionDays","eventLogEntityEnabled","eventLogEntityRetentionDays","loginAttemptThrottleEnabled","loginAttemptThreshold","loginAttemptWindow","secretsEncryptionKey","mfaEnabled","mfaRequired","mfaFreshnessMaxAge","mfaTicketMaxAge","clientAuthBasic","clientSystemEnabled","clientSystemSecret","clientSystemSecretReset","userAuthBasic","userAdminEnabled","userAdminPassword","userAdminPasswordReset","permissions","permissionsDefaultPolicyAssignment","Array","isArray","map","byteLength","trim"],"sources":["../../../../src/app/modules/config/normalize.ts"],"sourcesContent":["/*\n * Copyright (c) 2023-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 { read } from 'envix';\nimport path from 'node:path';\nimport process from 'node:process';\nimport { USER_PASSWORD_MIN_LENGTH } from '@authup/core-kit';\nimport { AuthupError } from '@authup/errors';\nimport { EnvironmentName, base64ToArrayBuffer } from '@authup/kit';\nimport { EVENT_LOG_RETENTION_DAYS_DEFAULT } from '../../../core/index.ts';\nimport { toPublicHost } from '../../../utils/host.ts';\nimport { expandToOrigins } from './origins.ts';\nimport { parseConfig } from './parse.ts';\nimport { canonicalizeTrustProxy, canonicalizeTrustProxyListEntry } from './trust-proxy.ts';\nimport type { Config, ConfigInput } from './types.ts';\n\nexport async function normalizeConfig(input: ConfigInput = {}): Promise<Config> {\n const parsed = await parseConfig(input);\n\n const writableDirectoryPath = parsed.writableDirectoryPath ||\n path.join(process.cwd(), 'writable');\n\n const port = parsed.port ?? 3001;\n let host = parsed.host || '0.0.0.0';\n\n let publicUrl : string;\n if (parsed.publicUrl) {\n publicUrl = parsed.publicUrl;\n } else {\n const regex = /^([^:]+)(?::(\\d+))?$/;\n const match = host.match(regex);\n if (match) {\n [, host] = match;\n publicUrl = `http://${toPublicHost(host)}:${match[2] || port}`;\n } else {\n publicUrl = `http://${toPublicHost(host)}:${port}`;\n }\n }\n\n const env = parsed.env || read('NODE_ENV', EnvironmentName.DEVELOPMENT);\n\n // Canonicalize to bare origins (scheme://host[:port]) — a scheme-less\n // entry (e.g. `hub.local`) expands to both its http and https origin.\n // Downstream consumers (redirect allowlist, getAppOrigins) can rely on\n // every entry being a full origin. Building a fresh array also keeps a\n // repeated normalizeConfig() on the same input from accumulating the\n // dev origin into a security-sensitive allowlist.\n const trustedOrigins: string[] = [];\n for (const value of parsed.trustedOrigins ?? []) {\n for (const origin of expandToOrigins(value)) {\n if (!trustedOrigins.includes(origin)) {\n trustedOrigins.push(origin);\n }\n }\n }\n\n // In non-production (development & test) client-web runs on :3000 while\n // the API (publicUrl) runs on :3001. Seed :3000 into the trusted origins\n // so the redirect allowlist (<origin>/**) and CORS accept logins from the\n // dev UI out of the box; otherwise the realm-selection login is dead on\n // first run.\n if (env !== EnvironmentName.PRODUCTION) {\n const devOrigin = 'http://localhost:3000';\n if (!trustedOrigins.includes(devOrigin)) {\n trustedOrigins.push(devOrigin);\n }\n }\n\n const config : Config = {\n env,\n rootPath: process.cwd(),\n writableDirectoryPath,\n\n logger: true,\n redis: false,\n smtp: false,\n\n port,\n host,\n publicUrl,\n mtlsPublicUrl: null,\n certificateSource: 'disabled',\n trustProxy: true,\n\n middlewareBody: true,\n middlewareCookie: true,\n middlewareCors: true,\n middlewarePrometheus: true,\n middlewareQuery: true,\n middlewareRateLimit: true,\n middlewareSwagger: true,\n tokenRefreshMaxAge: 259_200,\n tokenAccessMaxAge: 900,\n tokenRefreshGracePeriod: 0,\n promptLoginMaxAge: 60,\n endSessionHintGracePeriod: 0,\n registrationEnabled: false,\n emailVerificationEnabled: false,\n passwordRecoveryEnabled: false,\n passwordMinLength: USER_PASSWORD_MIN_LENGTH,\n\n eventLogEnabled: true,\n eventLogRetentionDays: EVENT_LOG_RETENTION_DAYS_DEFAULT,\n eventLogEntityEnabled: true,\n eventLogEntityRetentionDays: 7,\n loginAttemptThrottleEnabled: false,\n loginAttemptThreshold: 5,\n loginAttemptWindow: 900,\n\n secretsEncryptionKey: '',\n\n mfaEnabled: false,\n mfaRequired: false,\n mfaFreshnessMaxAge: 60,\n mfaTicketMaxAge: 600,\n\n clientAuthBasic: false,\n clientSystemEnabled: false,\n clientSystemSecret: 'start123',\n clientSystemSecretReset: false,\n\n userAuthBasic: false,\n userAdminEnabled: true,\n userAdminPassword: 'start123',\n userAdminPasswordReset: false,\n\n permissions: [],\n permissionsDefaultPolicyAssignment: true,\n ...parsed,\n\n // After the spread so the canonicalized + dev-seeded list wins over\n // the raw parsed list (parsed.trustedOrigins is merged in above).\n trustedOrigins,\n };\n\n // Canonicalize the string form on EVERY config surface (env, .conf,\n // file, programmatic) — proxy-addr accepts single-integer \"long value\"\n // IPv4 notation, so an un-canonicalized `trustProxy: \"1\"` would silently\n // compile to an allowlist of `0.0.0.1` instead of one trusted hop.\n if (typeof config.trustProxy === 'string') {\n config.trustProxy = canonicalizeTrustProxy(config.trustProxy);\n } else if (Array.isArray(config.trustProxy)) {\n config.trustProxy = config.trustProxy.map(canonicalizeTrustProxyListEntry);\n }\n\n // fail loud at boot: the throttle counts loginFailed rows in\n // auth_events — with the audit log disabled it would silently no-op.\n if (config.loginAttemptThrottleEnabled && !config.eventLogEnabled) {\n throw new AuthupError('loginAttemptThrottleEnabled requires eventLogEnabled.');\n }\n\n if (config.mfaRequired && !config.mfaEnabled) {\n throw new AuthupError('mfaRequired requires mfaEnabled.');\n }\n\n if (config.mtlsPublicUrl && config.certificateSource === 'disabled') {\n throw new AuthupError('mtlsPublicUrl requires certificateSource to be enabled.');\n }\n\n // fail loud at boot rather than at first key-store access: wrapped key\n // material must never be minted under a malformed KEK. Validate the\n // DECODED length here (not just base64 shape) so a whitespace / invalid /\n // wrong-length key fails at config time, not asynchronously inside the\n // cipher at first wrap/unwrap.\n if (config.secretsEncryptionKey) {\n let byteLength = -1;\n try {\n byteLength = base64ToArrayBuffer(config.secretsEncryptionKey.trim()).byteLength;\n } catch {\n // fall through — treated as invalid below\n }\n if (byteLength !== 32) {\n throw new AuthupError('secretsEncryptionKey must decode to exactly 32 bytes (base64).');\n }\n }\n\n return config;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAoBA,eAAsBa,gBAAgBC,QAAqB,CAAC,GAAC;CACzD,MAAMC,SAAS,MAAML,YAAYI,KAAAA;CAEjC,MAAME,wBAAwBD,OAAOC,yBACjCf,KAAKgB,KAAKf,QAAQgB,IAAG,GAAI,UAAA;CAE7B,MAAMC,OAAOJ,OAAOI,QAAQ;CAC5B,IAAIC,OAAOL,OAAOK,QAAQ;CAE1B,IAAIC;CACJ,IAAIN,OAAOM,WACPA,YAAYN,OAAOM;MAChB;EAEH,MAAME,QAAQH,KAAKG,MAAMD,sBAAAA;EACzB,IAAIC,OAAO;GACP,GAAGH,QAAQG;GACXF,YAAY,UAAUb,aAAaY,IAAAA,EAAM,GAAGG,MAAM,MAAMJ;EAC5D,OACIE,YAAY,UAAUb,aAAaY,IAAAA,EAAM,GAAGD;CAEpD;CAEA,MAAMK,MAAMT,OAAOS,OAAOxB,KAAK,YAAYK,gBAAgBoB,WAAW;CAQtE,MAAMC,iBAA2B,CAAA;CACjC,KAAK,MAAMC,SAASZ,OAAOW,kBAAkB,CAAA,GACzC,KAAK,MAAME,UAAUnB,gBAAgBkB,KAAAA,GACjC,IAAI,CAACD,eAAeG,SAASD,MAAAA,GACzBF,eAAeI,KAAKF,MAAAA;CAUhC,IAAIJ,QA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AAI7D,YAAY,kCAAA;CAG1B,IAAI6B,OAAOK,iBAAiBL,OAAOM,sBAAsB,YACrD,MAAM,IAAInC,YAAY,yDAAA;CAQ1B,IAAI6B,OAAO+B,sBAAsB;EAC7B,IAAIkB,aAAa;EACjB,IAAI;GACAA,aAAa5E,oBAAoB2B,OAAO+B,qBAAqBmB,KAAI,CAAA,CAAA,CAAID;EACzE,QAAQ,CAER;EACA,IAAIA,eAAe,IACf,MAAM,IAAI9E,YAAY,gEAAA;CAE9B;CAEA,OAAO6B;AACX"}
1
+ {"version":3,"file":"normalize.mjs","names":["read","path","process","USER_PASSWORD_MIN_LENGTH","AuthupError","EnvironmentName","base64ToArrayBuffer","EVENT_LOG_RETENTION_DAYS_DEFAULT","toPublicHost","expandToOrigins","parseConfig","canonicalizeTrustProxy","canonicalizeTrustProxyListEntry","normalizeConfig","input","parsed","writableDirectoryPath","join","cwd","port","host","publicUrl","regex","match","env","DEVELOPMENT","trustedOrigins","value","origin","includes","push","PRODUCTION","devOrigin","config","rootPath","themeDirectoryPath","themeFragmentsEnabled","authConsolePath","accountConsolePath","logger","redis","smtp","mtlsPublicUrl","certificateSource","trustProxy","middlewareBody","middlewareCookie","middlewareCors","middlewarePrometheus","middlewareQuery","middlewareRateLimit","middlewareSwagger","tokenRefreshMaxAge","tokenAccessMaxAge","tokenRefreshGracePeriod","promptLoginMaxAge","endSessionHintGracePeriod","registrationEnabled","emailVerificationEnabled","passwordRecoveryEnabled","passwordMinLength","accountConsoleEnabled","eventLogEnabled","eventLogRetentionDays","eventLogEntityEnabled","eventLogEntityRetentionDays","loginAttemptThrottleEnabled","loginAttemptThreshold","loginAttemptWindow","secretsEncryptionKey","mfaEnabled","mfaRequired","mfaFreshnessMaxAge","mfaTicketMaxAge","clientAuthBasic","clientSystemEnabled","clientSystemSecret","clientSystemSecretReset","userAuthBasic","userAdminEnabled","userAdminPassword","userAdminPasswordReset","permissions","permissionsDefaultPolicyAssignment","resolve","Array","isArray","map","byteLength","trim"],"sources":["../../../../src/app/modules/config/normalize.ts"],"sourcesContent":["/*\n * Copyright (c) 2023-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 { read } from 'envix';\nimport path from 'node:path';\nimport process from 'node:process';\nimport { USER_PASSWORD_MIN_LENGTH } from '@authup/core-kit';\nimport { AuthupError } from '@authup/errors';\nimport { EnvironmentName, base64ToArrayBuffer } from '@authup/kit';\nimport { EVENT_LOG_RETENTION_DAYS_DEFAULT } from '../../../core/index.ts';\nimport { toPublicHost } from '../../../utils/host.ts';\nimport { expandToOrigins } from './origins.ts';\nimport { parseConfig } from './parse.ts';\nimport { canonicalizeTrustProxy, canonicalizeTrustProxyListEntry } from './trust-proxy.ts';\nimport type { Config, ConfigInput } from './types.ts';\n\nexport async function normalizeConfig(input: ConfigInput = {}): Promise<Config> {\n const parsed = await parseConfig(input);\n\n const writableDirectoryPath = parsed.writableDirectoryPath ||\n path.join(process.cwd(), 'writable');\n\n const port = parsed.port ?? 3001;\n let host = parsed.host || '0.0.0.0';\n\n let publicUrl : string;\n if (parsed.publicUrl) {\n publicUrl = parsed.publicUrl;\n } else {\n const regex = /^([^:]+)(?::(\\d+))?$/;\n const match = host.match(regex);\n if (match) {\n [, host] = match;\n publicUrl = `http://${toPublicHost(host)}:${match[2] || port}`;\n } else {\n publicUrl = `http://${toPublicHost(host)}:${port}`;\n }\n }\n\n const env = parsed.env || read('NODE_ENV', EnvironmentName.DEVELOPMENT);\n\n // Canonicalize to bare origins (scheme://host[:port]) — a scheme-less\n // entry (e.g. `hub.local`) expands to both its http and https origin.\n // Downstream consumers (redirect allowlist, getAppOrigins) can rely on\n // every entry being a full origin. Building a fresh array also keeps a\n // repeated normalizeConfig() on the same input from accumulating the\n // dev origin into a security-sensitive allowlist.\n const trustedOrigins: string[] = [];\n for (const value of parsed.trustedOrigins ?? []) {\n for (const origin of expandToOrigins(value)) {\n if (!trustedOrigins.includes(origin)) {\n trustedOrigins.push(origin);\n }\n }\n }\n\n // In non-production (development & test) client-admin-console runs on :3000 while\n // the API (publicUrl) runs on :3001. Seed :3000 into the trusted origins\n // so the redirect allowlist (<origin>/**) and CORS accept logins from the\n // dev UI out of the box; otherwise the realm-selection login is dead on\n // first run.\n if (env !== EnvironmentName.PRODUCTION) {\n const devOrigin = 'http://localhost:3000';\n if (!trustedOrigins.includes(devOrigin)) {\n trustedOrigins.push(devOrigin);\n }\n }\n\n const config : Config = {\n env,\n rootPath: process.cwd(),\n writableDirectoryPath,\n // '' = theming disabled. Deliberately NOT defaulted under\n // writableDirectoryPath: that directory is process-writable, and\n // pairing \"process-writable\" with \"content injected into the login\n // page\" would turn any write primitive landing there into\n // persistent branding control on the IdP origin.\n themeDirectoryPath: '',\n themeFragmentsEnabled: false,\n authConsolePath: '',\n accountConsolePath: '',\n\n logger: true,\n redis: false,\n smtp: false,\n\n port,\n host,\n publicUrl,\n mtlsPublicUrl: null,\n certificateSource: 'disabled',\n trustProxy: true,\n\n middlewareBody: true,\n middlewareCookie: true,\n middlewareCors: true,\n middlewarePrometheus: true,\n middlewareQuery: true,\n middlewareRateLimit: true,\n middlewareSwagger: true,\n tokenRefreshMaxAge: 259_200,\n tokenAccessMaxAge: 900,\n tokenRefreshGracePeriod: 0,\n promptLoginMaxAge: 60,\n endSessionHintGracePeriod: 0,\n registrationEnabled: false,\n emailVerificationEnabled: false,\n passwordRecoveryEnabled: false,\n passwordMinLength: USER_PASSWORD_MIN_LENGTH,\n accountConsoleEnabled: true,\n\n eventLogEnabled: true,\n eventLogRetentionDays: EVENT_LOG_RETENTION_DAYS_DEFAULT,\n eventLogEntityEnabled: true,\n eventLogEntityRetentionDays: 7,\n loginAttemptThrottleEnabled: false,\n loginAttemptThreshold: 5,\n loginAttemptWindow: 900,\n\n secretsEncryptionKey: '',\n\n mfaEnabled: false,\n mfaRequired: false,\n mfaFreshnessMaxAge: 60,\n mfaTicketMaxAge: 600,\n\n clientAuthBasic: false,\n clientSystemEnabled: false,\n clientSystemSecret: 'start123',\n clientSystemSecretReset: false,\n\n userAuthBasic: false,\n userAdminEnabled: true,\n userAdminPassword: 'start123',\n userAdminPasswordReset: false,\n\n permissions: [],\n permissionsDefaultPolicyAssignment: true,\n ...parsed,\n\n // After the spread so the canonicalized + dev-seeded list wins over\n // the raw parsed list (parsed.trustedOrigins is merged in above).\n trustedOrigins,\n };\n\n // After the spread, so a relative value supplied by any config surface\n // is resolved. Every consumer then receives an absolute path and none\n // of them has to care what the process cwd was.\n if (config.themeDirectoryPath) {\n config.themeDirectoryPath = path.resolve(config.rootPath, config.themeDirectoryPath);\n }\n\n if (config.authConsolePath) {\n config.authConsolePath = path.resolve(config.rootPath, config.authConsolePath);\n }\n\n if (config.accountConsolePath) {\n config.accountConsolePath = path.resolve(config.rootPath, config.accountConsolePath);\n }\n\n // Canonicalize the string form on EVERY config surface (env, .conf,\n // file, programmatic) — proxy-addr accepts single-integer \"long value\"\n // IPv4 notation, so an un-canonicalized `trustProxy: \"1\"` would silently\n // compile to an allowlist of `0.0.0.1` instead of one trusted hop.\n if (typeof config.trustProxy === 'string') {\n config.trustProxy = canonicalizeTrustProxy(config.trustProxy);\n } else if (Array.isArray(config.trustProxy)) {\n config.trustProxy = config.trustProxy.map(canonicalizeTrustProxyListEntry);\n }\n\n // fail loud at boot: the throttle counts loginFailed rows in\n // auth_events — with the audit log disabled it would silently no-op.\n if (config.loginAttemptThrottleEnabled && !config.eventLogEnabled) {\n throw new AuthupError('loginAttemptThrottleEnabled requires eventLogEnabled.');\n }\n\n if (config.mfaRequired && !config.mfaEnabled) {\n throw new AuthupError('mfaRequired requires mfaEnabled.');\n }\n\n if (config.mtlsPublicUrl && config.certificateSource === 'disabled') {\n throw new AuthupError('mtlsPublicUrl requires certificateSource to be enabled.');\n }\n\n // fail loud at boot rather than at first key-store access: wrapped key\n // material must never be minted under a malformed KEK. Validate the\n // DECODED length here (not just base64 shape) so a whitespace / invalid /\n // wrong-length key fails at config time, not asynchronously inside the\n // cipher at first wrap/unwrap.\n if (config.secretsEncryptionKey) {\n let byteLength = -1;\n try {\n byteLength = base64ToArrayBuffer(config.secretsEncryptionKey.trim()).byteLength;\n } catch {\n // fall through — treated as invalid below\n }\n if (byteLength !== 32) {\n throw new AuthupError('secretsEncryptionKey must decode to exactly 32 bytes (base64).');\n }\n }\n\n return config;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAoBA,eAAsBa,gBAAgBC,QAAqB,CAAC,GAAC;CACzD,MAAMC,SAAS,MAAML,YAAYI,KAAAA;CAEjC,MAAME,wBAAwBD,OAAOC,yBACjCf,KAAKgB,KAAKf,QAAQgB,IAAG,GAAI,UAAA;CAE7B,MAAMC,OAAOJ,OAAOI,QAAQ;CAC5B,IAAIC,OAAOL,OAAOK,QAAQ;CAE1B,IAAIC;CACJ,IAAIN,OAAOM,WACPA,YAAYN,OAAOM;MAChB;EAEH,MAAME,QAAQH,KAAKG,MAAMD,sBAAAA;EACzB,IAAIC,OAAO;GACP,GAAGH,QAAQG;GACXF,YAAY,UAAUb,aAAaY,IAAAA,EAAM,GAAGG,MAAM,MAAMJ;EAC5D,OACIE,YAAY,UAAUb,aAAaY,IAAAA,EAAM,GAAGD;CAEpD;CAEA,MAAMK,MAAMT,OAAOS,OAAOxB,KAAK,YAAYK,gBAAgBoB,WAAW;CAQtE,MAAMC,iBAA2B,CAAA;CACjC,KAAK,MAAMC,SAASZ,OAAOW,kBAAkB,CAAA,GACzC,KAAK,MAAME,UAAUnB,gBAAgBkB,KAAAA,GACjC,IAAI,CAACD,eAAeG,SAASD,MAAAA,GACzBF,eAAeI,KAAKF,MAAAA;CAUhC,IAAIJ,QAAQnB,gBAAgB0B,YAAY;EACpC,MAAMC,YAAY;EAClB,IAAI,CAACN,eAAeG,SAASG,SAAAA,GACzBN,eAAeI,KAAKE,SAAAA;CAE5B;CAEA,MAAMC,SAAkB;EACpBT;EACAU,UAAUhC,QAAQgB,IAAG;EACrBF;EAMAmB,oBAAoB;EACpB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E,+BAAAA;CAK9C,IAAIqB,OAAOiC,+BAA+B,CAACjC,OAAO6B,iBAC9C,MAAM,IAAI1D,YAAY,uDAAA;CAG1B,IAAI6B,OAAOsC,eAAe,CAACtC,OAAOqC,YAC9B,MAAM,IAAIlE,YAAY,kCAAA;CAG1B,IAAI6B,OAAOS,iBAAiBT,OAAOU,sBAAsB,YACrD,MAAM,IAAIvC,YAAY,yDAAA;CAQ1B,IAAI6B,OAAOoC,sBAAsB;EAC7B,IAAImB,aAAa;EACjB,IAAI;GACAA,aAAalF,oBAAoB2B,OAAOoC,qBAAqBoB,KAAI,CAAA,CAAA,CAAID;EACzE,QAAQ,CAER;EACA,IAAIA,eAAe,IACf,MAAM,IAAIpF,YAAY,gEAAA;CAE9B;CAEA,OAAO6B;AACX"}
@@ -1 +1 @@
1
- {"version":3,"file":"origins.d.ts","sourceRoot":"","sources":["../../../../src/app/modules/config/origins.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAMzC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAcvD;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,WAAW,GAAG,gBAAgB,CAAC,GAAG,MAAM,EAAE,CAS5F"}
1
+ {"version":3,"file":"origins.d.ts","sourceRoot":"","sources":["../../../../src/app/modules/config/origins.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAMzC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAuBvD;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,WAAW,GAAG,gBAAgB,CAAC,GAAG,MAAM,EAAE,CAS5F"}
@@ -1,6 +1,7 @@
1
1
  import "node:path";
2
2
  import "node:url";
3
3
  import.meta.url;
4
+ import { patternHasGlobstarInAuthority } from "@authup/kit";
4
5
  import { URL } from "node:url";
5
6
  //#region src/app/modules/config/origins.ts
6
7
  const SCHEME_REGEX = /^[a-z][a-z0-9+.-]*:\/\//i;
@@ -19,6 +20,7 @@ const ALLOWED_PROTOCOLS = ["http:", "https:"];
19
20
  *
20
21
  * Throws on values that don't parse as a URL/host or use another scheme.
21
22
  */ function expandToOrigins(value) {
23
+ if (patternHasGlobstarInAuthority(value)) throw new Error(`A trusted origin must not use ** in the host, it would match every origin. Use a single * for a host wildcard, got: ${value}`);
22
24
  if (SCHEME_REGEX.test(value)) {
23
25
  const url = new URL(value);
24
26
  if (!ALLOWED_PROTOCOLS.includes(url.protocol)) throw new Error(`A trusted origin must use the http or https protocol, got: ${url.protocol}`);
@@ -1 +1 @@
1
- {"version":3,"file":"origins.mjs","names":["URL","SCHEME_REGEX","ALLOWED_PROTOCOLS","expandToOrigins","value","test","url","includes","protocol","Error","origin","getAppOrigins","config","origins","Set","add","publicUrl","trustedOrigins","Array","from"],"sources":["../../../../src/app/modules/config/origins.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 { URL } from 'node:url';\nimport type { Config } from './types.ts';\n\nconst SCHEME_REGEX = /^[a-z][a-z0-9+.-]*:\\/\\//i;\n\nconst ALLOWED_PROTOCOLS = ['http:', 'https:'];\n\n/**\n * Expand a configured trusted-origin value to its canonical origin(s).\n *\n * A value with an explicit scheme contributes exactly that origin —\n * the way to restrict a host to https only. A bare host[:port]\n * (e.g. `hub.local`) contributes both the http and https origin.\n *\n * Only http(s) is accepted: other schemes either have no usable web\n * origin (`new URL('myapp://x').origin` is the literal string \"null\")\n * or are meaningless as a redirect target for the web client — letting\n * them through would put garbage into a security-sensitive allowlist.\n *\n * Throws on values that don't parse as a URL/host or use another scheme.\n */\nexport function expandToOrigins(value: string): string[] {\n if (SCHEME_REGEX.test(value)) {\n const url = new URL(value);\n if (!ALLOWED_PROTOCOLS.includes(url.protocol)) {\n throw new Error(`A trusted origin must use the http or https protocol, got: ${url.protocol}`);\n }\n\n return [url.origin];\n }\n\n return [\n new URL(`http://${value}`).origin,\n new URL(`https://${value}`).origin,\n ];\n}\n\n/**\n * Derive the set of trusted application origins (scheme://host[:port]).\n *\n * publicUrl may carry a path, so its origin is extracted; trustedOrigins\n * entries are canonical origins — normalizeConfig owns that invariant\n * (expansion + dedupe via expandToOrigins) — and are merged verbatim.\n */\nexport function getAppOrigins(config: Pick<Config, 'publicUrl' | 'trustedOrigins'>): string[] {\n const origins = new Set<string>();\n origins.add(new URL(config.publicUrl).origin);\n\n for (const origin of config.trustedOrigins ?? []) {\n origins.add(origin);\n }\n\n return Array.from(origins);\n}\n"],"mappings":";;;;;AAUA,MAAMC,eAAe;AAErB,MAAMC,oBAAoB,CAAC,SAAS,QAAS;;;;;;;;;;;;;;GAgB7C,SAAgBC,gBAAgBC,OAAa;CACzC,IAAIH,aAAaI,KAAKD,KAAAA,GAAQ;EAC1B,MAAME,MAAM,IAAIN,IAAII,KAAAA;EACpB,IAAI,CAACF,kBAAkBK,SAASD,IAAIE,QAAQ,GACxC,MAAM,IAAIC,MAAM,8DAA8DH,IAAIE,UAAU;EAGhG,OAAO,CAACF,IAAII,MAAO;CACvB;CAEA,OAAO,CACH,IAAIV,IAAI,UAAUI,OAAO,CAAA,CAAEM,QAC3B,IAAIV,IAAI,WAAWI,OAAO,CAAA,CAAEM,MAC/B;AACL;;;;;;;GASA,SAAgBC,cAAcC,QAAoD;CAC9E,MAAMC,0BAAU,IAAIC,IAAAA;CACpBD,QAAQE,IAAI,IAAIf,IAAIY,OAAOI,SAAS,CAAA,CAAEN,MAAM;CAE5C,KAAK,MAAMA,UAAUE,OAAOK,kBAAkB,CAAA,GAC1CJ,QAAQE,IAAIL,MAAAA;CAGhB,OAAOQ,MAAMC,KAAKN,OAAAA;AACtB"}
1
+ {"version":3,"file":"origins.mjs","names":["URL","patternHasGlobstarInAuthority","SCHEME_REGEX","ALLOWED_PROTOCOLS","expandToOrigins","value","Error","test","url","includes","protocol","origin","getAppOrigins","config","origins","Set","add","publicUrl","trustedOrigins","Array","from"],"sources":["../../../../src/app/modules/config/origins.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 { URL } from 'node:url';\nimport { patternHasGlobstarInAuthority } from '@authup/kit';\nimport type { Config } from './types.ts';\n\nconst SCHEME_REGEX = /^[a-z][a-z0-9+.-]*:\\/\\//i;\n\nconst ALLOWED_PROTOCOLS = ['http:', 'https:'];\n\n/**\n * Expand a configured trusted-origin value to its canonical origin(s).\n *\n * A value with an explicit scheme contributes exactly that origin —\n * the way to restrict a host to https only. A bare host[:port]\n * (e.g. `hub.local`) contributes both the http and https origin.\n *\n * Only http(s) is accepted: other schemes either have no usable web\n * origin (`new URL('myapp://x').origin` is the literal string \"null\")\n * or are meaningless as a redirect target for the web client — letting\n * them through would put garbage into a security-sensitive allowlist.\n *\n * Throws on values that don't parse as a URL/host or use another scheme.\n */\nexport function expandToOrigins(value: string): string[] {\n // `new URL()` accepts `*` and `**` as a hostname, and every trusted origin\n // becomes an `<origin>/**` redirect pattern for the system clients. A `**`\n // there matches the rest of the value outright, so a single typo would\n // turn the redirect allowlist of every realm's console clients into\n // allow-any-origin. A single `*` is a supported host wildcard.\n if (patternHasGlobstarInAuthority(value)) {\n throw new Error(`A trusted origin must not use ** in the host, it would match every origin. Use a single * for a host wildcard, got: ${value}`);\n }\n\n if (SCHEME_REGEX.test(value)) {\n const url = new URL(value);\n if (!ALLOWED_PROTOCOLS.includes(url.protocol)) {\n throw new Error(`A trusted origin must use the http or https protocol, got: ${url.protocol}`);\n }\n\n return [url.origin];\n }\n\n return [\n new URL(`http://${value}`).origin,\n new URL(`https://${value}`).origin,\n ];\n}\n\n/**\n * Derive the set of trusted application origins (scheme://host[:port]).\n *\n * publicUrl may carry a path, so its origin is extracted; trustedOrigins\n * entries are canonical origins — normalizeConfig owns that invariant\n * (expansion + dedupe via expandToOrigins) — and are merged verbatim.\n */\nexport function getAppOrigins(config: Pick<Config, 'publicUrl' | 'trustedOrigins'>): string[] {\n const origins = new Set<string>();\n origins.add(new URL(config.publicUrl).origin);\n\n for (const origin of config.trustedOrigins ?? []) {\n origins.add(origin);\n }\n\n return Array.from(origins);\n}\n"],"mappings":";;;;;;AAWA,MAAME,eAAe;AAErB,MAAMC,oBAAoB,CAAC,SAAS,QAAS;;;;;;;;;;;;;;GAgB7C,SAAgBC,gBAAgBC,OAAa;CAMzC,IAAIJ,8BAA8BI,KAAAA,GAC9B,MAAM,IAAIC,MAAM,uHAAuHD,OAAO;CAGlJ,IAAIH,aAAaK,KAAKF,KAAAA,GAAQ;EAC1B,MAAMG,MAAM,IAAIR,IAAIK,KAAAA;EACpB,IAAI,CAACF,kBAAkBM,SAASD,IAAIE,QAAQ,GACxC,MAAM,IAAIJ,MAAM,8DAA8DE,IAAIE,UAAU;EAGhG,OAAO,CAACF,IAAIG,MAAO;CACvB;CAEA,OAAO,CACH,IAAIX,IAAI,UAAUK,OAAO,CAAA,CAAEM,QAC3B,IAAIX,IAAI,WAAWK,OAAO,CAAA,CAAEM,MAC/B;AACL;;;;;;;GASA,SAAgBC,cAAcC,QAAoD;CAC9E,MAAMC,0BAAU,IAAIC,IAAAA;CACpBD,QAAQE,IAAI,IAAIhB,IAAIa,OAAOI,SAAS,CAAA,CAAEN,MAAM;CAE5C,KAAK,MAAMA,UAAUE,OAAOK,kBAAkB,CAAA,GAC1CJ,QAAQE,IAAIL,MAAAA;CAGhB,OAAOQ,MAAMC,KAAKN,OAAAA;AACtB"}
@@ -1 +1 @@
1
- {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../../../../src/app/modules/config/read/env.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AA4B/C,wBAAgB,oBAAoB,IAAK,WAAW,CAmPnD"}
1
+ {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../../../../src/app/modules/config/read/env.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AA4B/C,wBAAgB,oBAAoB,IAAK,WAAW,CA4QnD"}
@@ -40,6 +40,14 @@ function readConfigRawFromEnv() {
40
40
  if (env) options.env = env;
41
41
  const writableDirectoryPath = read(ConfigEnvironmentVariableName.WRITABLE_DIRECTORY_PATH);
42
42
  if (writableDirectoryPath) options.writableDirectoryPath = writableDirectoryPath;
43
+ const themeDirectoryPath = read(ConfigEnvironmentVariableName.THEME_DIRECTORY_PATH);
44
+ if (themeDirectoryPath) options.themeDirectoryPath = themeDirectoryPath;
45
+ const themeFragmentsEnabled = readBool(ConfigEnvironmentVariableName.THEME_FRAGMENTS_ENABLED);
46
+ if (typeof themeFragmentsEnabled !== "undefined") options.themeFragmentsEnabled = themeFragmentsEnabled;
47
+ const authConsolePath = read(ConfigEnvironmentVariableName.AUTH_CONSOLE_PATH);
48
+ if (authConsolePath) options.authConsolePath = authConsolePath;
49
+ const accountConsolePath = read(ConfigEnvironmentVariableName.ACCOUNT_CONSOLE_PATH);
50
+ if (accountConsolePath) options.accountConsolePath = accountConsolePath;
43
51
  if (hasEnvDataSourceOptions()) options.db = readDataSourceOptionsFromEnv();
44
52
  const redis = oneOf([readBool(ConfigEnvironmentVariableName.REDIS), read(ConfigEnvironmentVariableName.REDIS)]);
45
53
  if (typeof redis !== "undefined") options.redis = redis;
@@ -77,6 +85,8 @@ function readConfigRawFromEnv() {
77
85
  if (typeof passwordRecoveryEnabled !== "undefined") options.passwordRecoveryEnabled = passwordRecoveryEnabled;
78
86
  const passwordMinLength = readInt(ConfigEnvironmentVariableName.PASSWORD_MIN_LENGTH);
79
87
  if (typeof passwordMinLength !== "undefined") options.passwordMinLength = passwordMinLength;
88
+ const accountConsoleEnabled = readBool(ConfigEnvironmentVariableName.ACCOUNT_CONSOLE_ENABLED);
89
+ if (typeof accountConsoleEnabled !== "undefined") options.accountConsoleEnabled = accountConsoleEnabled;
80
90
  const eventLogEnabled = readBoolStrict(ConfigEnvironmentVariableName.EVENT_LOG_ENABLED);
81
91
  if (typeof eventLogEnabled !== "undefined") options.eventLogEnabled = eventLogEnabled;
82
92
  const eventLogRetentionDays = readInt(ConfigEnvironmentVariableName.EVENT_LOG_RETENTION_DAYS);
@@ -1 +1 @@
1
- {"version":3,"file":"env.mjs","names":["oneOf","read","readArray","readBool","readInt","hasEnvDataSourceOptions","readDataSourceOptionsFromEnv","ConfigEnvironmentVariableName","BOOLEAN_TRUE_VALUES","Set","BOOLEAN_FALSE_VALUES","readBoolStrict","name","raw","trim","length","undefined","normalized","toLowerCase","has","Error","readConfigRawFromEnv","options","env","NODE_ENV","writableDirectoryPath","WRITABLE_DIRECTORY_PATH","db","redis","REDIS","smtp","SMTP","host","HOST","port","PORT","publicURL","PUBLIC_URL","publicUrl","mtlsPublicURL","MTLS_PUBLIC_URL","mtlsPublicUrl","certificateSource","CERTIFICATE_SOURCE","trustProxy","TRUST_PROXY","trustedOrigins","TRUSTED_ORIGINS","tokenAccessMaxAge","TOKEN_ACCESS_MAX_AGE","tokenRefreshMaxAge","TOKEN_REFRESH_MAX_AGE","tokenRefreshGracePeriod","TOKEN_REFRESH_GRACE_PERIOD","promptLoginMaxAge","PROMPT_LOGIN_MAX_AGE","endSessionHintGracePeriod","END_SESSION_HINT_GRACE_PERIOD","registrationEnabled","REGISTRATION_ENABLED","emailVerificationEnabled","EMAIL_VERIFICATION_ENABLED","passwordRecoveryEnabled","PASSWORD_RECOVERY_ENABLED","passwordMinLength","PASSWORD_MIN_LENGTH","eventLogEnabled","EVENT_LOG_ENABLED","eventLogRetentionDays","EVENT_LOG_RETENTION_DAYS","eventLogEntityEnabled","EVENT_LOG_ENTITY_ENABLED","eventLogEntityRetentionDays","EVENT_LOG_ENTITY_RETENTION_DAYS","loginAttemptThrottleEnabled","LOGIN_ATTEMPT_THROTTLE_ENABLED","loginAttemptThreshold","LOGIN_ATTEMPT_THRESHOLD","loginAttemptWindow","LOGIN_ATTEMPT_WINDOW","mfaEnabled","MFA_ENABLED","mfaRequired","MFA_REQUIRED","mfaFreshnessMaxAge","MFA_FRESHNESS_MAX_AGE","mfaTicketMaxAge","MFA_TICKET_MAX_AGE","secretsEncryptionKey","SECRETS_ENCRYPTION_KEY","clientBasicAuth","CLIENT_AUTH_BASIC","clientAuthBasic","clientSystemEnabled","CLIENT_SYSTEM_ENABLED","clientAdminSecret","CLIENT_SYSTEM_SECRET","clientSystemSecret","clientAdminSecretReset","CLIENT_SYSTEM_SECRET_RESET","clientSystemSecretReset","userBasicAuth","USER_AUTH_BASIC","userAuthBasic","userAdminEnabled","USER_ADMIN_ENABLED","userAdminPassword","USER_ADMIN_PASSWORD","userAdminPasswordReset","USER_ADMIN_PASSWORD_RESET","permissions","PERMISSIONS","permissionsDefaultPolicyAssignment","PERMISSIONS_DEFAULT_POLICY_ASSIGNMENT"],"sources":["../../../../../src/app/modules/config/read/env.ts"],"sourcesContent":["/*\n * Copyright (c) 2022-2024.\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 oneOf,\n read,\n readArray,\n readBool,\n readInt,\n} from 'envix';\nimport { hasEnvDataSourceOptions, readDataSourceOptionsFromEnv } from 'typeorm-extension';\nimport type { BetterSqlite3DataSourceOptions } from 'typeorm/driver/better-sqlite3/BetterSqlite3DataSourceOptions.js';\nimport type { MysqlDataSourceOptions } from 'typeorm/driver/mysql/MysqlDataSourceOptions.js';\nimport type { PostgresDataSourceOptions } from 'typeorm/driver/postgres/PostgresDataSourceOptions.js';\n\nimport { ConfigEnvironmentVariableName } from '../constants.ts';\nimport type { ConfigInput } from '../types.ts';\n\nconst BOOLEAN_TRUE_VALUES = new Set(['true', 't', '1', 'yes', 'y', 'on']);\nconst BOOLEAN_FALSE_VALUES = new Set(['false', 'f', '0', 'no', 'n', 'off']);\n\n/**\n * Boolean env reader that FAILS LOUD on a set-but-unrecognized value instead\n * of silently falling back to the default (envix's `readBool` swallows e.g.\n * `MFA_REQUIRED=yes`). Reserved for security-relevant toggles where a silent\n * default is a weakened posture. Returns `undefined` when the var is unset.\n */\nfunction readBoolStrict(name: ConfigEnvironmentVariableName) : boolean | undefined {\n const raw = read(name);\n if (typeof raw !== 'string' || raw.trim().length === 0) {\n return undefined;\n }\n\n const normalized = raw.trim().toLowerCase();\n if (BOOLEAN_TRUE_VALUES.has(normalized)) {\n return true;\n }\n if (BOOLEAN_FALSE_VALUES.has(normalized)) {\n return false;\n }\n\n throw new Error(`The environment variable ${name} must be a boolean value (received \"${raw}\").`);\n}\n\nexport function readConfigRawFromEnv() : ConfigInput {\n const options : ConfigInput = {};\n\n const env = read(ConfigEnvironmentVariableName.NODE_ENV);\n if (env) {\n options.env = env;\n }\n\n const writableDirectoryPath = read(ConfigEnvironmentVariableName.WRITABLE_DIRECTORY_PATH);\n if (writableDirectoryPath) {\n options.writableDirectoryPath = writableDirectoryPath;\n }\n\n // -------------------------------------------------------------\n\n if (hasEnvDataSourceOptions()) {\n // todo: type casting should be avoided\n options.db = readDataSourceOptionsFromEnv() as MysqlDataSourceOptions |\n PostgresDataSourceOptions |\n BetterSqlite3DataSourceOptions;\n }\n\n const redis = oneOf([\n readBool(ConfigEnvironmentVariableName.REDIS),\n read(ConfigEnvironmentVariableName.REDIS),\n ]);\n if (typeof redis !== 'undefined') {\n options.redis = redis;\n }\n\n const smtp = oneOf([\n readBool(ConfigEnvironmentVariableName.SMTP),\n read(ConfigEnvironmentVariableName.SMTP),\n ]);\n if (typeof smtp !== 'undefined') {\n options.smtp = smtp;\n }\n\n // -------------------------------------------------------------\n\n const host = read(ConfigEnvironmentVariableName.HOST);\n if (host) {\n options.host = host;\n }\n\n const port = readInt(ConfigEnvironmentVariableName.PORT);\n if (typeof port !== 'undefined') {\n options.port = port;\n }\n\n const publicURL = read(ConfigEnvironmentVariableName.PUBLIC_URL);\n if (publicURL) {\n options.publicUrl = publicURL;\n }\n\n const mtlsPublicURL = read(ConfigEnvironmentVariableName.MTLS_PUBLIC_URL);\n if (mtlsPublicURL) {\n options.mtlsPublicUrl = mtlsPublicURL;\n }\n\n const certificateSource = read(ConfigEnvironmentVariableName.CERTIFICATE_SOURCE);\n if (certificateSource) {\n options.certificateSource = certificateSource as ConfigInput['certificateSource'];\n }\n\n // canonicalized again in normalizeConfig for every config surface; the\n // env read keeps the raw string, the shared canonicalizer decides.\n const trustProxy = read(ConfigEnvironmentVariableName.TRUST_PROXY);\n if (typeof trustProxy === 'string' && trustProxy.trim().length > 0) {\n options.trustProxy = trustProxy;\n }\n\n const trustedOrigins = readArray(ConfigEnvironmentVariableName.TRUSTED_ORIGINS);\n if (trustedOrigins && trustedOrigins.length > 0) {\n options.trustedOrigins = trustedOrigins;\n }\n\n const tokenAccessMaxAge = readInt(ConfigEnvironmentVariableName.TOKEN_ACCESS_MAX_AGE);\n if (typeof tokenAccessMaxAge !== 'undefined') {\n options.tokenAccessMaxAge = tokenAccessMaxAge;\n }\n\n const tokenRefreshMaxAge = readInt(ConfigEnvironmentVariableName.TOKEN_REFRESH_MAX_AGE);\n if (typeof tokenRefreshMaxAge !== 'undefined') {\n options.tokenRefreshMaxAge = tokenRefreshMaxAge;\n }\n\n const tokenRefreshGracePeriod = readInt(ConfigEnvironmentVariableName.TOKEN_REFRESH_GRACE_PERIOD);\n if (typeof tokenRefreshGracePeriod !== 'undefined') {\n options.tokenRefreshGracePeriod = tokenRefreshGracePeriod;\n }\n\n const promptLoginMaxAge = readInt(ConfigEnvironmentVariableName.PROMPT_LOGIN_MAX_AGE);\n if (typeof promptLoginMaxAge !== 'undefined') {\n options.promptLoginMaxAge = promptLoginMaxAge;\n }\n\n const endSessionHintGracePeriod = readInt(ConfigEnvironmentVariableName.END_SESSION_HINT_GRACE_PERIOD);\n if (typeof endSessionHintGracePeriod !== 'undefined') {\n options.endSessionHintGracePeriod = endSessionHintGracePeriod;\n }\n\n const registrationEnabled = readBool(ConfigEnvironmentVariableName.REGISTRATION_ENABLED);\n if (typeof registrationEnabled !== 'undefined') {\n options.registrationEnabled = registrationEnabled;\n }\n\n const emailVerificationEnabled = readBool(ConfigEnvironmentVariableName.EMAIL_VERIFICATION_ENABLED);\n if (typeof emailVerificationEnabled !== 'undefined') {\n options.emailVerificationEnabled = emailVerificationEnabled;\n }\n\n const passwordRecoveryEnabled = readBool(ConfigEnvironmentVariableName.PASSWORD_RECOVERY_ENABLED);\n if (typeof passwordRecoveryEnabled !== 'undefined') {\n options.passwordRecoveryEnabled = passwordRecoveryEnabled;\n }\n\n const passwordMinLength = readInt(ConfigEnvironmentVariableName.PASSWORD_MIN_LENGTH);\n if (typeof passwordMinLength !== 'undefined') {\n options.passwordMinLength = passwordMinLength;\n }\n\n // ---------------------------------------------------------------\n\n const eventLogEnabled = readBoolStrict(ConfigEnvironmentVariableName.EVENT_LOG_ENABLED);\n if (typeof eventLogEnabled !== 'undefined') {\n options.eventLogEnabled = eventLogEnabled;\n }\n\n const eventLogRetentionDays = readInt(ConfigEnvironmentVariableName.EVENT_LOG_RETENTION_DAYS);\n if (typeof eventLogRetentionDays !== 'undefined') {\n options.eventLogRetentionDays = eventLogRetentionDays;\n }\n\n const eventLogEntityEnabled = readBoolStrict(ConfigEnvironmentVariableName.EVENT_LOG_ENTITY_ENABLED);\n if (typeof eventLogEntityEnabled !== 'undefined') {\n options.eventLogEntityEnabled = eventLogEntityEnabled;\n }\n\n const eventLogEntityRetentionDays = readInt(ConfigEnvironmentVariableName.EVENT_LOG_ENTITY_RETENTION_DAYS);\n if (typeof eventLogEntityRetentionDays !== 'undefined') {\n options.eventLogEntityRetentionDays = eventLogEntityRetentionDays;\n }\n\n const loginAttemptThrottleEnabled = readBoolStrict(ConfigEnvironmentVariableName.LOGIN_ATTEMPT_THROTTLE_ENABLED);\n if (typeof loginAttemptThrottleEnabled !== 'undefined') {\n options.loginAttemptThrottleEnabled = loginAttemptThrottleEnabled;\n }\n\n const loginAttemptThreshold = readInt(ConfigEnvironmentVariableName.LOGIN_ATTEMPT_THRESHOLD);\n if (typeof loginAttemptThreshold !== 'undefined') {\n options.loginAttemptThreshold = loginAttemptThreshold;\n }\n\n const loginAttemptWindow = readInt(ConfigEnvironmentVariableName.LOGIN_ATTEMPT_WINDOW);\n if (typeof loginAttemptWindow !== 'undefined') {\n options.loginAttemptWindow = loginAttemptWindow;\n }\n\n // ---------------------------------------------------------------\n\n const mfaEnabled = readBoolStrict(ConfigEnvironmentVariableName.MFA_ENABLED);\n if (typeof mfaEnabled !== 'undefined') {\n options.mfaEnabled = mfaEnabled;\n }\n\n const mfaRequired = readBoolStrict(ConfigEnvironmentVariableName.MFA_REQUIRED);\n if (typeof mfaRequired !== 'undefined') {\n options.mfaRequired = mfaRequired;\n }\n\n const mfaFreshnessMaxAge = readInt(ConfigEnvironmentVariableName.MFA_FRESHNESS_MAX_AGE);\n if (typeof mfaFreshnessMaxAge !== 'undefined') {\n options.mfaFreshnessMaxAge = mfaFreshnessMaxAge;\n }\n\n const mfaTicketMaxAge = readInt(ConfigEnvironmentVariableName.MFA_TICKET_MAX_AGE);\n if (typeof mfaTicketMaxAge !== 'undefined') {\n options.mfaTicketMaxAge = mfaTicketMaxAge;\n }\n\n const secretsEncryptionKey = read(ConfigEnvironmentVariableName.SECRETS_ENCRYPTION_KEY);\n if (secretsEncryptionKey) {\n options.secretsEncryptionKey = secretsEncryptionKey;\n }\n\n // ---------------------------------------------------------------\n\n const clientBasicAuth = readBool(ConfigEnvironmentVariableName.CLIENT_AUTH_BASIC);\n if (typeof clientBasicAuth !== 'undefined') {\n options.clientAuthBasic = clientBasicAuth;\n }\n\n const clientSystemEnabled = readBool(ConfigEnvironmentVariableName.CLIENT_SYSTEM_ENABLED);\n if (typeof clientSystemEnabled !== 'undefined') {\n options.clientSystemEnabled = clientSystemEnabled;\n }\n\n const clientAdminSecret = read(ConfigEnvironmentVariableName.CLIENT_SYSTEM_SECRET);\n if (clientAdminSecret) {\n options.clientSystemSecret = clientAdminSecret;\n }\n\n const clientAdminSecretReset = readBool(ConfigEnvironmentVariableName.CLIENT_SYSTEM_SECRET_RESET);\n if (typeof clientAdminSecretReset !== 'undefined') {\n options.clientSystemSecretReset = clientAdminSecretReset;\n }\n\n // ---------------------------------------------------------------\n\n const userBasicAuth = readBool(ConfigEnvironmentVariableName.USER_AUTH_BASIC);\n if (typeof userBasicAuth !== 'undefined') {\n options.userAuthBasic = userBasicAuth;\n }\n\n const userAdminEnabled = readBool(ConfigEnvironmentVariableName.USER_ADMIN_ENABLED);\n if (typeof userAdminEnabled !== 'undefined') {\n options.userAdminEnabled = userAdminEnabled;\n }\n\n const userAdminPassword = read(ConfigEnvironmentVariableName.USER_ADMIN_PASSWORD);\n if (userAdminPassword) {\n options.userAdminPassword = userAdminPassword;\n }\n\n const userAdminPasswordReset = readBool(ConfigEnvironmentVariableName.USER_ADMIN_PASSWORD_RESET);\n if (typeof userAdminPasswordReset !== 'undefined') {\n options.userAdminPasswordReset = userAdminPasswordReset;\n }\n\n // ---------------------------------------------------------------\n\n const permissions = readArray(ConfigEnvironmentVariableName.PERMISSIONS);\n if (permissions && permissions.length > 0) {\n options.permissions = permissions;\n }\n\n const permissionsDefaultPolicyAssignment = readBool(ConfigEnvironmentVariableName.PERMISSIONS_DEFAULT_POLICY_ASSIGNMENT);\n if (typeof permissionsDefaultPolicyAssignment !== 'undefined') {\n options.permissionsDefaultPolicyAssignment = permissionsDefaultPolicyAssignment;\n }\n\n return options;\n}\n"],"mappings":";;;;;;;AAsBA,MAAMQ,sCAAsB,IAAIC,IAAI;CAAC;CAAQ;CAAK;CAAK;CAAO;CAAK;AAAK,CAAA;AACxE,MAAMC,uCAAuB,IAAID,IAAI;CAAC;CAAS;CAAK;CAAK;CAAM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ataSourceOptions","readDataSourceOptionsFromEnv","ConfigEnvironmentVariableName","BOOLEAN_TRUE_VALUES","Set","BOOLEAN_FALSE_VALUES","readBoolStrict","name","raw","trim","length","undefined","normalized","toLowerCase","has","Error","readConfigRawFromEnv","options","env","NODE_ENV","writableDirectoryPath","WRITABLE_DIRECTORY_PATH","themeDirectoryPath","THEME_DIRECTORY_PATH","themeFragmentsEnabled","THEME_FRAGMENTS_ENABLED","authConsolePath","AUTH_CONSOLE_PATH","accountConsolePath","ACCOUNT_CONSOLE_PATH","db","redis","REDIS","smtp","SMTP","host","HOST","port","PORT","publicURL","PUBLIC_URL","publicUrl","mtlsPublicURL","MTLS_PUBLIC_URL","mtlsPublicUrl","certificateSource","CERTIFICATE_SOURCE","trustProxy","TRUST_PROXY","trustedOrigins","TRUSTED_ORIGINS","tokenAccessMaxAge","TOKEN_ACCESS_MAX_AGE","tokenRefreshMaxAge","TOKEN_REFRESH_MAX_AGE","tokenRefreshGracePeriod","TOKEN_REFRESH_GRACE_PERIOD","promptLoginMaxAge","PROMPT_LOGIN_MAX_AGE","endSessionHintGracePeriod","END_SESSION_HINT_GRACE_PERIOD","registrationEnabled","REGISTRATION_ENABLED","emailVerificationEnabled","EMAIL_VERIFICATION_ENABLED","passwordRecoveryEnabled","PASSWORD_RECOVERY_ENABLED","passwordMinLength","PASSWORD_MIN_LENGTH","accountConsoleEnabled","ACCOUNT_CONSOLE_ENABLED","eventLogEnabled","EVENT_LOG_ENABLED","eventLogRetentionDays","EVENT_LOG_RETENTION_DAYS","eventLogEntityEnabled","EVENT_LOG_ENTITY_ENABLED","eventLogEntityRetentionDays","EVENT_LOG_ENTITY_RETENTION_DAYS","loginAttemptThrottleEnabled","LOGIN_ATTEMPT_THROTTLE_ENABLED","loginAttemptThreshold","LOGIN_ATTEMPT_THRESHOLD","loginAttemptWindow","LOGIN_ATTEMPT_WINDOW","mfaEnabled","MFA_ENABLED","mfaRequired","MFA_REQUIRED","mfaFreshnessMaxAge","MFA_FRESHNESS_MAX_AGE","mfaTicketMaxAge","MFA_TICKET_MAX_AGE","secretsEncryptionKey","SECRETS_ENCRYPTION_KEY","clientBasicAuth","CLIENT_AUTH_BASIC","clientAuthBasic","clientSystemEnabled","CLIENT_SYSTEM_ENABLED","clientAdminSecret","CLIENT_SYSTEM_SECRET","clientSystemSecret","clientAdminSecretReset","CLIENT_SYSTEM_SECRET_RESET","clientSystemSecretReset","userBasicAuth","USER_AUTH_BASIC","userAuthBasic","userAdminEnabled","USER_ADMIN_ENABLED","userAdminPassword","USER_ADMIN_PASSWORD","userAdminPasswordReset","USER_ADMIN_PASSWORD_RESET","permissions","PERMISSIONS","permissionsDefaultPolicyAssignment","PERMISSIONS_DEFAULT_POLICY_ASSIGNMENT"],"sources":["../../../../../src/app/modules/config/read/env.ts"],"sourcesContent":["/*\n * Copyright (c) 2022-2024.\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 oneOf,\n read,\n readArray,\n readBool,\n readInt,\n} from 'envix';\nimport { hasEnvDataSourceOptions, readDataSourceOptionsFromEnv } from 'typeorm-extension';\nimport type { BetterSqlite3DataSourceOptions } from 'typeorm/driver/better-sqlite3/BetterSqlite3DataSourceOptions.js';\nimport type { MysqlDataSourceOptions } from 'typeorm/driver/mysql/MysqlDataSourceOptions.js';\nimport type { PostgresDataSourceOptions } from 'typeorm/driver/postgres/PostgresDataSourceOptions.js';\n\nimport { ConfigEnvironmentVariableName } from '../constants.ts';\nimport type { ConfigInput } from '../types.ts';\n\nconst BOOLEAN_TRUE_VALUES = new Set(['true', 't', '1', 'yes', 'y', 'on']);\nconst BOOLEAN_FALSE_VALUES = new Set(['false', 'f', '0', 'no', 'n', 'off']);\n\n/**\n * Boolean env reader that FAILS LOUD on a set-but-unrecognized value instead\n * of silently falling back to the default (envix's `readBool` swallows e.g.\n * `MFA_REQUIRED=yes`). Reserved for security-relevant toggles where a silent\n * default is a weakened posture. Returns `undefined` when the var is unset.\n */\nfunction readBoolStrict(name: ConfigEnvironmentVariableName) : boolean | undefined {\n const raw = read(name);\n if (typeof raw !== 'string' || raw.trim().length === 0) {\n return undefined;\n }\n\n const normalized = raw.trim().toLowerCase();\n if (BOOLEAN_TRUE_VALUES.has(normalized)) {\n return true;\n }\n if (BOOLEAN_FALSE_VALUES.has(normalized)) {\n return false;\n }\n\n throw new Error(`The environment variable ${name} must be a boolean value (received \"${raw}\").`);\n}\n\nexport function readConfigRawFromEnv() : ConfigInput {\n const options : ConfigInput = {};\n\n const env = read(ConfigEnvironmentVariableName.NODE_ENV);\n if (env) {\n options.env = env;\n }\n\n const writableDirectoryPath = read(ConfigEnvironmentVariableName.WRITABLE_DIRECTORY_PATH);\n if (writableDirectoryPath) {\n options.writableDirectoryPath = writableDirectoryPath;\n }\n\n const themeDirectoryPath = read(ConfigEnvironmentVariableName.THEME_DIRECTORY_PATH);\n if (themeDirectoryPath) {\n options.themeDirectoryPath = themeDirectoryPath;\n }\n\n const themeFragmentsEnabled = readBool(ConfigEnvironmentVariableName.THEME_FRAGMENTS_ENABLED);\n if (typeof themeFragmentsEnabled !== 'undefined') {\n options.themeFragmentsEnabled = themeFragmentsEnabled;\n }\n\n const authConsolePath = read(ConfigEnvironmentVariableName.AUTH_CONSOLE_PATH);\n if (authConsolePath) {\n options.authConsolePath = authConsolePath;\n }\n\n const accountConsolePath = read(ConfigEnvironmentVariableName.ACCOUNT_CONSOLE_PATH);\n if (accountConsolePath) {\n options.accountConsolePath = accountConsolePath;\n }\n\n // -------------------------------------------------------------\n\n if (hasEnvDataSourceOptions()) {\n // todo: type casting should be avoided\n options.db = readDataSourceOptionsFromEnv() as MysqlDataSourceOptions |\n PostgresDataSourceOptions |\n BetterSqlite3DataSourceOptions;\n }\n\n const redis = oneOf([\n readBool(ConfigEnvironmentVariableName.REDIS),\n read(ConfigEnvironmentVariableName.REDIS),\n ]);\n if (typeof redis !== 'undefined') {\n options.redis = redis;\n }\n\n const smtp = oneOf([\n readBool(ConfigEnvironmentVariableName.SMTP),\n read(ConfigEnvironmentVariableName.SMTP),\n ]);\n if (typeof smtp !== 'undefined') {\n options.smtp = smtp;\n }\n\n // -------------------------------------------------------------\n\n const host = read(ConfigEnvironmentVariableName.HOST);\n if (host) {\n options.host = host;\n }\n\n const port = readInt(ConfigEnvironmentVariableName.PORT);\n if (typeof port !== 'undefined') {\n options.port = port;\n }\n\n const publicURL = read(ConfigEnvironmentVariableName.PUBLIC_URL);\n if (publicURL) {\n options.publicUrl = publicURL;\n }\n\n const mtlsPublicURL = read(ConfigEnvironmentVariableName.MTLS_PUBLIC_URL);\n if (mtlsPublicURL) {\n options.mtlsPublicUrl = mtlsPublicURL;\n }\n\n const certificateSource = read(ConfigEnvironmentVariableName.CERTIFICATE_SOURCE);\n if (certificateSource) {\n options.certificateSource = certificateSource as ConfigInput['certificateSource'];\n }\n\n // canonicalized again in normalizeConfig for every config surface; the\n // env read keeps the raw string, the shared canonicalizer decides.\n const trustProxy = read(ConfigEnvironmentVariableName.TRUST_PROXY);\n if (typeof trustProxy === 'string' && trustProxy.trim().length > 0) {\n options.trustProxy = trustProxy;\n }\n\n const trustedOrigins = readArray(ConfigEnvironmentVariableName.TRUSTED_ORIGINS);\n if (trustedOrigins && trustedOrigins.length > 0) {\n options.trustedOrigins = trustedOrigins;\n }\n\n const tokenAccessMaxAge = readInt(ConfigEnvironmentVariableName.TOKEN_ACCESS_MAX_AGE);\n if (typeof tokenAccessMaxAge !== 'undefined') {\n options.tokenAccessMaxAge = tokenAccessMaxAge;\n }\n\n const tokenRefreshMaxAge = readInt(ConfigEnvironmentVariableName.TOKEN_REFRESH_MAX_AGE);\n if (typeof tokenRefreshMaxAge !== 'undefined') {\n options.tokenRefreshMaxAge = tokenRefreshMaxAge;\n }\n\n const tokenRefreshGracePeriod = readInt(ConfigEnvironmentVariableName.TOKEN_REFRESH_GRACE_PERIOD);\n if (typeof tokenRefreshGracePeriod !== 'undefined') {\n options.tokenRefreshGracePeriod = tokenRefreshGracePeriod;\n }\n\n const promptLoginMaxAge = readInt(ConfigEnvironmentVariableName.PROMPT_LOGIN_MAX_AGE);\n if (typeof promptLoginMaxAge !== 'undefined') {\n options.promptLoginMaxAge = promptLoginMaxAge;\n }\n\n const endSessionHintGracePeriod = readInt(ConfigEnvironmentVariableName.END_SESSION_HINT_GRACE_PERIOD);\n if (typeof endSessionHintGracePeriod !== 'undefined') {\n options.endSessionHintGracePeriod = endSessionHintGracePeriod;\n }\n\n const registrationEnabled = readBool(ConfigEnvironmentVariableName.REGISTRATION_ENABLED);\n if (typeof registrationEnabled !== 'undefined') {\n options.registrationEnabled = registrationEnabled;\n }\n\n const emailVerificationEnabled = readBool(ConfigEnvironmentVariableName.EMAIL_VERIFICATION_ENABLED);\n if (typeof emailVerificationEnabled !== 'undefined') {\n options.emailVerificationEnabled = emailVerificationEnabled;\n }\n\n const passwordRecoveryEnabled = readBool(ConfigEnvironmentVariableName.PASSWORD_RECOVERY_ENABLED);\n if (typeof passwordRecoveryEnabled !== 'undefined') {\n options.passwordRecoveryEnabled = passwordRecoveryEnabled;\n }\n\n const passwordMinLength = readInt(ConfigEnvironmentVariableName.PASSWORD_MIN_LENGTH);\n if (typeof passwordMinLength !== 'undefined') {\n options.passwordMinLength = passwordMinLength;\n }\n\n const accountConsoleEnabled = readBool(ConfigEnvironmentVariableName.ACCOUNT_CONSOLE_ENABLED);\n if (typeof accountConsoleEnabled !== 'undefined') {\n options.accountConsoleEnabled = accountConsoleEnabled;\n }\n\n // ---------------------------------------------------------------\n\n const eventLogEnabled = readBoolStrict(ConfigEnvironmentVariableName.EVENT_LOG_ENABLED);\n if (typeof eventLogEnabled !== 'undefined') {\n options.eventLogEnabled = eventLogEnabled;\n }\n\n const eventLogRetentionDays = readInt(ConfigEnvironmentVariableName.EVENT_LOG_RETENTION_DAYS);\n if (typeof eventLogRetentionDays !== 'undefined') {\n options.eventLogRetentionDays = eventLogRetentionDays;\n }\n\n const eventLogEntityEnabled = readBoolStrict(ConfigEnvironmentVariableName.EVENT_LOG_ENTITY_ENABLED);\n if (typeof eventLogEntityEnabled !== 'undefined') {\n options.eventLogEntityEnabled = eventLogEntityEnabled;\n }\n\n const eventLogEntityRetentionDays = readInt(ConfigEnvironmentVariableName.EVENT_LOG_ENTITY_RETENTION_DAYS);\n if (typeof eventLogEntityRetentionDays !== 'undefined') {\n options.eventLogEntityRetentionDays = eventLogEntityRetentionDays;\n }\n\n const loginAttemptThrottleEnabled = readBoolStrict(ConfigEnvironmentVariableName.LOGIN_ATTEMPT_THROTTLE_ENABLED);\n if (typeof loginAttemptThrottleEnabled !== 'undefined') {\n options.loginAttemptThrottleEnabled = loginAttemptThrottleEnabled;\n }\n\n const loginAttemptThreshold = readInt(ConfigEnvironmentVariableName.LOGIN_ATTEMPT_THRESHOLD);\n if (typeof loginAttemptThreshold !== 'undefined') {\n options.loginAttemptThreshold = loginAttemptThreshold;\n }\n\n const loginAttemptWindow = readInt(ConfigEnvironmentVariableName.LOGIN_ATTEMPT_WINDOW);\n if (typeof loginAttemptWindow !== 'undefined') {\n options.loginAttemptWindow = loginAttemptWindow;\n }\n\n // ---------------------------------------------------------------\n\n const mfaEnabled = readBoolStrict(ConfigEnvironmentVariableName.MFA_ENABLED);\n if (typeof mfaEnabled !== 'undefined') {\n options.mfaEnabled = mfaEnabled;\n }\n\n const mfaRequired = readBoolStrict(ConfigEnvironmentVariableName.MFA_REQUIRED);\n if (typeof mfaRequired !== 'undefined') {\n options.mfaRequired = mfaRequired;\n }\n\n const mfaFreshnessMaxAge = readInt(ConfigEnvironmentVariableName.MFA_FRESHNESS_MAX_AGE);\n if (typeof mfaFreshnessMaxAge !== 'undefined') {\n options.mfaFreshnessMaxAge = mfaFreshnessMaxAge;\n }\n\n const mfaTicketMaxAge = readInt(ConfigEnvironmentVariableName.MFA_TICKET_MAX_AGE);\n if (typeof mfaTicketMaxAge !== 'undefined') {\n options.mfaTicketMaxAge = mfaTicketMaxAge;\n }\n\n const secretsEncryptionKey = read(ConfigEnvironmentVariableName.SECRETS_ENCRYPTION_KEY);\n if (secretsEncryptionKey) {\n options.secretsEncryptionKey = secretsEncryptionKey;\n }\n\n // ---------------------------------------------------------------\n\n const clientBasicAuth = readBool(ConfigEnvironmentVariableName.CLIENT_AUTH_BASIC);\n if (typeof clientBasicAuth !== 'undefined') {\n options.clientAuthBasic = clientBasicAuth;\n }\n\n const clientSystemEnabled = readBool(ConfigEnvironmentVariableName.CLIENT_SYSTEM_ENABLED);\n if (typeof clientSystemEnabled !== 'undefined') {\n options.clientSystemEnabled = clientSystemEnabled;\n }\n\n const clientAdminSecret = read(ConfigEnvironmentVariableName.CLIENT_SYSTEM_SECRET);\n if (clientAdminSecret) {\n options.clientSystemSecret = clientAdminSecret;\n }\n\n const clientAdminSecretReset = readBool(ConfigEnvironmentVariableName.CLIENT_SYSTEM_SECRET_RESET);\n if (typeof clientAdminSecretReset !== 'undefined') {\n options.clientSystemSecretReset = clientAdminSecretReset;\n }\n\n // ---------------------------------------------------------------\n\n const userBasicAuth = readBool(ConfigEnvironmentVariableName.USER_AUTH_BASIC);\n if (typeof userBasicAuth !== 'undefined') {\n options.userAuthBasic = userBasicAuth;\n }\n\n const userAdminEnabled = readBool(ConfigEnvironmentVariableName.USER_ADMIN_ENABLED);\n if (typeof userAdminEnabled !== 'undefined') {\n options.userAdminEnabled = userAdminEnabled;\n }\n\n const userAdminPassword = read(ConfigEnvironmentVariableName.USER_ADMIN_PASSWORD);\n if (userAdminPassword) {\n options.userAdminPassword = userAdminPassword;\n }\n\n const userAdminPasswordReset = readBool(ConfigEnvironmentVariableName.USER_ADMIN_PASSWORD_RESET);\n if (typeof userAdminPasswordReset !== 'undefined') {\n options.userAdminPasswordReset = userAdminPasswordReset;\n }\n\n // ---------------------------------------------------------------\n\n const permissions = readArray(ConfigEnvironmentVariableName.PERMISSIONS);\n if (permissions && permissions.length > 0) {\n options.permissions = permissions;\n }\n\n const permissionsDefaultPolicyAssignment = readBool(ConfigEnvironmentVariableName.PERMISSIONS_DEFAULT_POLICY_ASSIGNMENT);\n if (typeof permissionsDefaultPolicyAssignment !== 'undefined') {\n options.permissionsDefaultPolicyAssignment = permissionsDefaultPolicyAssignment;\n }\n\n return options;\n}\n"],"mappings":";;;;;;;AAsBA,MAAMQ,sCAAsB,IAAIC,IAAI;CAAC;CAAQ;CAAK;CAAK;CAAO;CAAK;AAAK,CAAA;AACxE,MAAMC,uCAAuB,IAAID,IAAI;CAAC;CAAS;CAAK;CAAK;CAAM;CAAK;AAAM,CAAA;;;;;;GAQ1E,SAASE,eAAeC,MAAmC;CACvD,MAAMC,MAAMZ,KAAKW,IAAAA;CACjB,IAAI,OAAOC,QAAQ,YAAYA,IAAIC,KAAI,CAAA,CAAGC,WAAW,GACjD;CAGJ,MAAME,aAAaJ,IAAIC,KAAI,CAAA,CAAGI,YAAW;CACzC,IAAIV,oBAAoBW,IAAIF,UAAAA,GACxB,OAAO;CAEX,IAAIP,qBAAqBS,IAAIF,UAAAA,GACzB,OAAO;CAGX,MAAM,IAAIG,MAAM,4BAA4BR,KAAK,sCAAsCC,IAAI,IAAI;AACnG;AAEA,SAAgBQ,uBAAAA;CACZ,MAAMC,UAAwB,CAAC;CAE/B,MAAMC,MAAMtB,KAAKM,8BAA8BiB,QAAQ;CACvD,IAAID,KACAD,QAAQC,MAAMA;CAGlB,MAAME,wBAAwBxB,KAAKM,8BAA8BmB,uBAAuB;CACxF,IAAID,uBACAH,QAAQG,wBAAwBA;CAGpC,MAAME,qBAAqB1B,KAAKM,8BAA8BqB,oBAAoB;CAClF,IAAID,oBACAL,QAAQK,qBAAqBA;CAGjC,MAAME,wBAAwB1B,SAASI,8BAA8BuB,uBAAuB;CAC5F,IAAI,OAAOD,0BAA0B,aACjCP,QAAQO,wBAAwBA;CAGpC,MAAME,kBAAkB9B,KAAKM,8BAA8ByB,iBAAiB;CAC5E,IAAID,iBACAT,QAAQS,kBAAkBA;CAG9B,MAAME,qBAAqBhC,KAAKM,8BAA8B2B,oB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G,yBAAyBzG,SAASI,8BAA8BsG,0BAA0B;CAChG,IAAI,OAAOD,2BAA2B,aAClCtF,QAAQwF,0BAA0BF;CAKtC,MAAMG,gBAAgB5G,SAASI,8BAA8ByG,eAAe;CAC5E,IAAI,OAAOD,kBAAkB,aACzBzF,QAAQ2F,gBAAgBF;CAG5B,MAAMG,mBAAmB/G,SAASI,8BAA8B4G,kBAAkB;CAClF,IAAI,OAAOD,qBAAqB,aAC5B5F,QAAQ4F,mBAAmBA;CAG/B,MAAME,oBAAoBnH,KAAKM,8BAA8B8G,mBAAmB;CAChF,IAAID,mBACA9F,QAAQ8F,oBAAoBA;CAGhC,MAAME,yBAAyBnH,SAASI,8BAA8BgH,yBAAyB;CAC/F,IAAI,OAAOD,2BAA2B,aAClChG,QAAQgG,yBAAyBA;CAKrC,MAAME,cAActH,UAAUK,8BAA8BkH,WAAW;CACvE,IAAID,eAAeA,YAAYzG,SAAS,GACpCO,QAAQkG,cAAcA;CAG1B,MAAME,qCAAqCvH,SAASI,8BAA8BoH,qCAAqC;CACvH,IAAI,OAAOD,uCAAuC,aAC9CpG,QAAQoG,qCAAqCA;CAGjD,OAAOpG;AACX"}
@@ -7,10 +7,15 @@ import { merge } from "smob";
7
7
  //#region src/app/modules/config/read/module.ts
8
8
  async function readConfigRaw(options = {}) {
9
9
  if (options.fs && options.env) {
10
- const fs = await readConfigRawFromFS(boolableToObject(options.fs));
11
- return merge(readConfigRawFromEnv(), fs);
10
+ const fsOptions = boolableToObject(options.fs);
11
+ const fs = await readConfigRawFromFS(fsOptions);
12
+ const env = readConfigRawFromEnv();
13
+ return merge(env, fs);
14
+ }
15
+ if (options.fs) {
16
+ const fsOptions = boolableToObject(options.fs);
17
+ return readConfigRawFromFS(fsOptions);
12
18
  }
13
- if (options.fs) return readConfigRawFromFS(boolableToObject(options.fs));
14
19
  if (options.env) return readConfigRawFromEnv();
15
20
  return {};
16
21
  }
@@ -1 +1 @@
1
- {"version":3,"file":"module.mjs","names":["merge","readConfigRawFromEnv","readConfigRawFromFS","readConfigRaw","options","fs","env","fsOptions","boolableToObject","input"],"sources":["../../../../../src/app/modules/config/read/module.ts"],"sourcesContent":["/*\n * Copyright (c) 2024-2024.\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 { merge } from 'smob';\nimport type { ConfigInput } from '../types.ts';\nimport { readConfigRawFromEnv } from './env.ts';\nimport { readConfigRawFromFS } from './fs.ts';\nimport type { ConfigRawReadOptions } from './types.ts';\n\nexport async function readConfigRaw(options: ConfigRawReadOptions = {}) : Promise<ConfigInput> {\n if (options.fs && options.env) {\n const fsOptions = boolableToObject(options.fs);\n const fs = await readConfigRawFromFS(fsOptions);\n const env = readConfigRawFromEnv();\n\n return merge(env, fs);\n }\n\n if (options.fs) {\n const fsOptions = boolableToObject(options.fs);\n return readConfigRawFromFS(fsOptions);\n }\n\n if (options.env) {\n return readConfigRawFromEnv();\n }\n\n return {};\n}\n\nfunction boolableToObject<T>(input: T | boolean) : T {\n if (typeof input === 'boolean') {\n return {} as T;\n }\n\n return input;\n}\n"],"mappings":";;;;;;;AAaA,eAAsBG,cAAcC,UAAgC,CAAC,GAAC;CAClE,IAAIA,QAAQC,MAAMD,QAAQE,KAAK;EAE3B,MAAMD,KAAK,MAAMH,oBADCM,iBAAiBJ,QAAQC,EACNE,CAAAA;EAGrC,OAAOP,MAFKC,qBAECK,GAAKD,EAAAA;CACtB;CAEA,IAAID,QAAQC,IAER,OAAOH,oBADWM,iBAAiBJ,QAAQC,EAChBE,CAAAA;CAG/B,IAAIH,QAAQE,KACR,OAAOL,qBAAAA;CAGX,OAAO,CAAC;AACZ;AAEA,SAASO,iBAAoBC,OAAkB;CAC3C,IAAI,OAAOA,UAAU,WACjB,OAAO,CAAC;CAGZ,OAAOA;AACX"}
1
+ {"version":3,"file":"module.mjs","names":["merge","readConfigRawFromEnv","readConfigRawFromFS","readConfigRaw","options","fs","env","fsOptions","boolableToObject","input"],"sources":["../../../../../src/app/modules/config/read/module.ts"],"sourcesContent":["/*\n * Copyright (c) 2024-2024.\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 { merge } from 'smob';\nimport type { ConfigInput } from '../types.ts';\nimport { readConfigRawFromEnv } from './env.ts';\nimport { readConfigRawFromFS } from './fs.ts';\nimport type { ConfigRawReadOptions } from './types.ts';\n\nexport async function readConfigRaw(options: ConfigRawReadOptions = {}) : Promise<ConfigInput> {\n if (options.fs && options.env) {\n const fsOptions = boolableToObject(options.fs);\n const fs = await readConfigRawFromFS(fsOptions);\n const env = readConfigRawFromEnv();\n\n return merge(env, fs);\n }\n\n if (options.fs) {\n const fsOptions = boolableToObject(options.fs);\n return readConfigRawFromFS(fsOptions);\n }\n\n if (options.env) {\n return readConfigRawFromEnv();\n }\n\n return {};\n}\n\nfunction boolableToObject<T>(input: T | boolean) : T {\n if (typeof input === 'boolean') {\n return {} as T;\n }\n\n return input;\n}\n"],"mappings":";;;;;;;AAaA,eAAsBG,cAAcC,UAAgC,CAAC,GAAC;CAClE,IAAIA,QAAQC,MAAMD,QAAQE,KAAK;EAC3B,MAAMC,YAAYC,iBAAiBJ,QAAQC,EAAE;EAC7C,MAAMA,KAAK,MAAMH,oBAAoBK,SAAAA;EACrC,MAAMD,MAAML,qBAAAA;EAEZ,OAAOD,MAAMM,KAAKD,EAAAA;CACtB;CAEA,IAAID,QAAQC,IAAI;EACZ,MAAME,YAAYC,iBAAiBJ,QAAQC,EAAE;EAC7C,OAAOH,oBAAoBK,SAAAA;CAC/B;CAEA,IAAIH,QAAQE,KACR,OAAOL,qBAAAA;CAGX,OAAO,CAAC;AACZ;AAEA,SAASO,iBAAoBC,OAAkB;CAC3C,IAAI,OAAOA,UAAU,WACjB,OAAO,CAAC;CAGZ,OAAOA;AACX"}
@@ -26,6 +26,59 @@ export type Config = {
26
26
  * default: writable
27
27
  */
28
28
  writableDirectoryPath: string;
29
+ /**
30
+ * EXPERIMENTAL. May change in a minor release: per-realm themes are
31
+ * likely to reshape the directory into `<root>/<theme name>/`. The
32
+ * manifest's `version` field makes a breaking change detectable.
33
+ *
34
+ * Directory holding the operator theme applied to the served consoles
35
+ * (the auth console and the account console). Relative paths resolve
36
+ * against the rootPath.
37
+ *
38
+ * The directory is operator trust, exactly like the config file: its
39
+ * `assets/` sub-directory is served verbatim at `/theme`, and its
40
+ * `theme.json` injects CSS custom properties into both consoles.
41
+ * Mount it read-only and never from a source a tenant can write.
42
+ *
43
+ * default: '' (theming disabled)
44
+ */
45
+ themeDirectoryPath: string;
46
+ /**
47
+ * EXPERIMENTAL, alongside themeDirectoryPath.
48
+ *
49
+ * Opt in to reading `fragments/head.html` from the theme directory and
50
+ * splicing it into the `<head>` of both served consoles.
51
+ *
52
+ * The fragment is raw, unsanitized markup running on the IdP origin,
53
+ * so it must be a deliberate operator decision and never a consequence
54
+ * of a file appearing in the mounted directory.
55
+ *
56
+ * default: false
57
+ */
58
+ themeFragmentsEnabled: boolean;
59
+ /**
60
+ * EXPERIMENTAL. The render contract it verifies is itself versioned
61
+ * (CONTRACT_VERSION), but this key and the boot-time assert may change.
62
+ *
63
+ * Package directory of a substituted `@authup/client-auth-console`
64
+ * (the directory holding its package.json and dist/). Consulted before
65
+ * the node_modules resolution walk.
66
+ *
67
+ * This replaces the login/consent IMPLEMENTATION, not its styling: the
68
+ * substituted package owns the prompt ladder, PKCE and state handling,
69
+ * MFA ordering and redirect gating. Use the theme directory for
70
+ * branding.
71
+ *
72
+ * default: '' (resolve @authup/client-auth-console from node_modules)
73
+ */
74
+ authConsolePath: string;
75
+ /**
76
+ * Package directory of a substituted
77
+ * `@authup/client-account-console`. Same contract as authConsolePath.
78
+ *
79
+ * default: '' (resolve @authup/client-account-console from node_modules)
80
+ */
81
+ accountConsolePath: string;
29
82
  /**
30
83
  * default: true
31
84
  */
@@ -91,7 +144,7 @@ export type Config = {
91
144
  trustProxy: boolean | number | string | string[];
92
145
  /**
93
146
  * Trusted first-party app origins (besides publicUrl) — used as
94
- * redirect targets for the per-realm public `web` client. Does NOT
147
+ * redirect targets for the per-realm public system clients. Does NOT
95
148
  * drive CORS (the API reflects any origin by default; an explicit
96
149
  * CORS allowlist goes through middlewareCors), and does not affect
97
150
  * UIs using their own registered OAuth2 client. Input entries may be
@@ -99,10 +152,10 @@ export type Config = {
99
152
  * rejected) or bare hosts (host[:port]) — a bare host expands to
100
153
  * both its http and https origin during normalization, so the
101
154
  * normalized config always holds full origins (scheme://host[:port],
102
- * no path); each is stored as `<origin>/**` in the web client's
155
+ * no path); each is stored as `<origin>/**` in the system clients'
103
156
  * redirect_uri set.
104
157
  *
105
- * SECURITY: the `web` client is built_in (auto-consent + `global`
158
+ * SECURITY: the system clients are built_in (auto-consent + `global`
106
159
  * scope), so any origin listed here can obtain a full-permission user
107
160
  * token once a user logs in. Adding an origin grants it full login
108
161
  * capability for every realm.
@@ -200,6 +253,13 @@ export type Config = {
200
253
  * default: 10
201
254
  */
202
255
  passwordMinLength: number;
256
+ /**
257
+ * Serve the account self-service surface (`/account`: profile, password,
258
+ * authenticators, sessions, applications). Operators with their own
259
+ * self-service portal can disable authup's.
260
+ * default: true
261
+ */
262
+ accountConsoleEnabled: boolean;
203
263
  /**
204
264
  * Persist security audit events (login, authorize, replay detection, ...)
205
265
  * to the auth_events table. When disabled only the structured log line
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/app/modules/config/types.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,KAAK,EAAE,YAAY,IAAI,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,KAAK,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,IAAI,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,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,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAIpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAGzC,qBAAa,eAAgB,SAAQ,SAAS,CAAC,MAAM,CAAC;cAC/B,UAAU;CAyHhC"}
1
+ {"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../../../src/app/modules/config/validator.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAIpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAGzC,qBAAa,eAAgB,SAAQ,SAAS,CAAC,MAAM,CAAC;cAC/B,UAAU;CA8HhC"}
@@ -24,6 +24,10 @@ var ConfigValidator = class extends Container {
24
24
  env: stringValidator,
25
25
  rootPath: stringValidator,
26
26
  writableDirectoryPath: stringValidator,
27
+ themeDirectoryPath: stringValidator,
28
+ themeFragmentsEnabled: booleanValidator,
29
+ authConsolePath: stringValidator,
30
+ accountConsolePath: stringValidator,
27
31
  logger: booleanValidator,
28
32
  db: createValidator(z.custom((value) => isObject(value))),
29
33
  redis: serviceValidator,
@@ -63,6 +67,7 @@ var ConfigValidator = class extends Container {
63
67
  emailVerificationEnabled: booleanValidator,
64
68
  passwordRecoveryEnabled: booleanValidator,
65
69
  passwordMinLength: createValidator(z.number().int().positive().max(USER_PASSWORD_MAX_LENGTH)),
70
+ accountConsoleEnabled: booleanValidator,
66
71
  eventLogEnabled: booleanValidator,
67
72
  eventLogRetentionDays: nonNegativeNumberValidator,
68
73
  eventLogEntityEnabled: booleanValidator,
@@ -1 +1 @@
1
- {"version":3,"file":"validator.mjs","names":["USER_PASSWORD_MAX_LENGTH","isObject","createValidator","Container","z","expandToOrigins","isValidTrustProxyListEntry","CERTIFICATE_SOURCES","ConfigValidator","initialize","stringValidator","string","booleanValidator","boolean","nonNegativeNumberValidator","number","nonnegative","secretValidator","min","max","middlewareValidator","or","record","any","serviceValidator","custom","value","validators","env","rootPath","writableDirectoryPath","logger","db","redis","smtp","port","host","publicUrl","url","mtlsPublicUrl","nullable","certificateSource","enum","trustProxy","union","int","array","refine","trustedOrigins","middlewareBody","middlewareCors","middlewareCookie","middlewareQuery","middlewarePrometheus","middlewareRateLimit","middlewareSwagger","tokenAccessMaxAge","tokenRefreshMaxAge","tokenRefreshGracePeriod","promptLoginMaxAge","endSessionHintGracePeriod","registrationEnabled","emailVerificationEnabled","passwordRecoveryEnabled","passwordMinLength","positive","eventLogEnabled","eventLogRetentionDays","eventLogEntityEnabled","eventLogEntityRetentionDays","loginAttemptThrottleEnabled","loginAttemptThreshold","loginAttemptWindow","secretsEncryptionKey","literal","base64","mfaEnabled","mfaRequired","mfaFreshnessMaxAge","mfaTicketMaxAge","clientAuthBasic","clientSystemEnabled","clientSystemSecret","clientSystemSecretReset","userAuthBasic","userAdminEnabled","userAdminPassword","userAdminPasswordReset","permissions","permissionsDefaultPolicyAssignment","keys","Object","key","mount","optional"],"sources":["../../../../src/app/modules/config/validator.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 { USER_PASSWORD_MAX_LENGTH } from '@authup/core-kit';\nimport { isObject } from '@authup/kit';\nimport { createValidator } from '@validup/zod';\nimport type { BetterSqlite3DataSourceOptions } from 'typeorm/driver/better-sqlite3/BetterSqlite3DataSourceOptions.js';\nimport type { MysqlDataSourceOptions } from 'typeorm/driver/mysql/MysqlDataSourceOptions.js';\nimport type { PostgresDataSourceOptions } from 'typeorm/driver/postgres/PostgresDataSourceOptions.js';\nimport type { ValidatorDescriptor } from 'validup';\nimport { Container } from 'validup';\nimport { z } from 'zod';\nimport { expandToOrigins } from './origins.ts';\nimport { isValidTrustProxyListEntry } from './trust-proxy.ts';\nimport type { Config } from './types.ts';\nimport { CERTIFICATE_SOURCES } from '../../../adapters/http/request/index.ts';\n\nexport class ConfigValidator extends Container<Config> {\n protected override initialize() {\n super.initialize();\n\n const stringValidator = createValidator(z.string());\n const booleanValidator = createValidator(z.boolean());\n const nonNegativeNumberValidator = createValidator(z.number().nonnegative());\n const secretValidator = createValidator(z.string().min(3).max(256));\n const middlewareValidator = createValidator(\n z.boolean().or(z.record(z.string(), z.any())),\n );\n const serviceValidator = createValidator(\n z.string()\n .or(z.boolean())\n .or(z.custom<Record<string, any>>((value) => isObject(value))),\n );\n\n // Record<keyof Config, ...> is the compile-time exhaustiveness\n // guard: a Config key without a validator here fails the build\n // instead of being silently stripped by run().\n const validators: Record<keyof Config, ValidatorDescriptor> = {\n env: stringValidator,\n rootPath: stringValidator,\n writableDirectoryPath: stringValidator,\n\n logger: booleanValidator,\n db: createValidator(\n z.custom<MysqlDataSourceOptions | PostgresDataSourceOptions | BetterSqlite3DataSourceOptions>(\n (value) => isObject(value),\n ),\n ),\n redis: serviceValidator,\n smtp: serviceValidator,\n\n port: nonNegativeNumberValidator,\n host: stringValidator,\n publicUrl: createValidator(z.url()),\n mtlsPublicUrl: createValidator(z.url().nullable()),\n certificateSource: createValidator(z.enum(CERTIFICATE_SOURCES)),\n trustProxy: createValidator(z.union([\n z.boolean(),\n z.number().int().nonnegative(),\n // scalar strings are canonicalized in normalizeConfig\n // (integer/boolean words → their semantic type)\n z.string(),\n // the explicit allowlist form: an integer-string or boolean\n // word entry is a mis-typed scalar and must fail loud —\n // proxy-addr would silently compile '1' to 0.0.0.1\n z.array(z.string().refine(\n isValidTrustProxyListEntry,\n 'must be an IP, CIDR, or proxy-addr preset',\n )),\n ])),\n trustedOrigins: createValidator(\n z.array(z.string().refine((value) => {\n try {\n expandToOrigins(value);\n return true;\n } catch {\n return false;\n }\n }, 'must be a http(s) origin or a bare host[:port]')),\n ),\n\n middlewareBody: middlewareValidator,\n middlewareCors: middlewareValidator,\n middlewareCookie: middlewareValidator,\n middlewareQuery: middlewareValidator,\n middlewarePrometheus: middlewareValidator,\n middlewareRateLimit: middlewareValidator,\n middlewareSwagger: booleanValidator,\n\n tokenAccessMaxAge: nonNegativeNumberValidator,\n tokenRefreshMaxAge: nonNegativeNumberValidator,\n tokenRefreshGracePeriod: nonNegativeNumberValidator,\n promptLoginMaxAge: nonNegativeNumberValidator,\n endSessionHintGracePeriod: nonNegativeNumberValidator,\n registrationEnabled: booleanValidator,\n emailVerificationEnabled: booleanValidator,\n passwordRecoveryEnabled: booleanValidator,\n passwordMinLength: createValidator(\n z.number().int().positive().max(USER_PASSWORD_MAX_LENGTH),\n ),\n\n eventLogEnabled: booleanValidator,\n eventLogRetentionDays: nonNegativeNumberValidator,\n eventLogEntityEnabled: booleanValidator,\n eventLogEntityRetentionDays: nonNegativeNumberValidator,\n loginAttemptThrottleEnabled: booleanValidator,\n loginAttemptThreshold: createValidator(z.number().int().positive()),\n loginAttemptWindow: createValidator(z.number().int().positive()),\n\n // '' = unset; otherwise a base64 string (normalizeConfig enforces\n // the decoded 32-byte length at boot).\n secretsEncryptionKey: createValidator(z.union([z.literal(''), z.base64()])),\n\n mfaEnabled: booleanValidator,\n mfaRequired: booleanValidator,\n mfaFreshnessMaxAge: nonNegativeNumberValidator,\n mfaTicketMaxAge: createValidator(z.number().int().positive()),\n\n clientAuthBasic: booleanValidator,\n clientSystemEnabled: booleanValidator,\n clientSystemSecret: secretValidator,\n clientSystemSecretReset: booleanValidator,\n\n userAuthBasic: booleanValidator,\n userAdminEnabled: booleanValidator,\n userAdminPassword: secretValidator,\n userAdminPasswordReset: booleanValidator,\n\n permissions: createValidator(\n z.string().or(z.array(z.string())),\n ),\n permissionsDefaultPolicyAssignment: booleanValidator,\n };\n\n const keys = Object.keys(validators) as (keyof Config)[];\n for (const key of keys) {\n this.mount(key, { optional: true }, validators[key]);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAqBA,IAAaQ,kBAAb,cAAqCL,UAAAA;CACdM,aAAa;EAC5B,MAAMA,WAAAA;EAEN,MAAMC,kBAAkBR,gBAAgBE,EAAEO,OAAM,CAAA;EAChD,MAAMC,mB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AAEO,OAAM,CAAA,CAAGU,GAAGjB,EAAE0C,MAAM1C,EAAEO,OAAM,CAAA,CAAA,CAAA;GAElC8E,oCAAoC7E;EACxC;EAEA,MAAM8E,OAAOC,OAAOD,KAAK/D,UAAAA;EACzB,KAAK,MAAMiE,OAAOF,MACd,KAAKG,MAAMD,KAAK,EAAEE,UAAU,KAAK,GAAGnE,WAAWiE,IAAI;CAE3D;AACJ"}
1
+ {"version":3,"file":"validator.mjs","names":["USER_PASSWORD_MAX_LENGTH","isObject","createValidator","Container","z","expandToOrigins","isValidTrustProxyListEntry","CERTIFICATE_SOURCES","ConfigValidator","initialize","stringValidator","string","booleanValidator","boolean","nonNegativeNumberValidator","number","nonnegative","secretValidator","min","max","middlewareValidator","or","record","any","serviceValidator","custom","value","validators","env","rootPath","writableDirectoryPath","themeDirectoryPath","themeFragmentsEnabled","authConsolePath","accountConsolePath","logger","db","redis","smtp","port","host","publicUrl","url","mtlsPublicUrl","nullable","certificateSource","enum","trustProxy","union","int","array","refine","trustedOrigins","middlewareBody","middlewareCors","middlewareCookie","middlewareQuery","middlewarePrometheus","middlewareRateLimit","middlewareSwagger","tokenAccessMaxAge","tokenRefreshMaxAge","tokenRefreshGracePeriod","promptLoginMaxAge","endSessionHintGracePeriod","registrationEnabled","emailVerificationEnabled","passwordRecoveryEnabled","passwordMinLength","positive","accountConsoleEnabled","eventLogEnabled","eventLogRetentionDays","eventLogEntityEnabled","eventLogEntityRetentionDays","loginAttemptThrottleEnabled","loginAttemptThreshold","loginAttemptWindow","secretsEncryptionKey","literal","base64","mfaEnabled","mfaRequired","mfaFreshnessMaxAge","mfaTicketMaxAge","clientAuthBasic","clientSystemEnabled","clientSystemSecret","clientSystemSecretReset","userAuthBasic","userAdminEnabled","userAdminPassword","userAdminPasswordReset","permissions","permissionsDefaultPolicyAssignment","keys","Object","key","mount","optional"],"sources":["../../../../src/app/modules/config/validator.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 { USER_PASSWORD_MAX_LENGTH } from '@authup/core-kit';\nimport { isObject } from '@authup/kit';\nimport { createValidator } from '@validup/zod';\nimport type { BetterSqlite3DataSourceOptions } from 'typeorm/driver/better-sqlite3/BetterSqlite3DataSourceOptions.js';\nimport type { MysqlDataSourceOptions } from 'typeorm/driver/mysql/MysqlDataSourceOptions.js';\nimport type { PostgresDataSourceOptions } from 'typeorm/driver/postgres/PostgresDataSourceOptions.js';\nimport type { ValidatorDescriptor } from 'validup';\nimport { Container } from 'validup';\nimport { z } from 'zod';\nimport { expandToOrigins } from './origins.ts';\nimport { isValidTrustProxyListEntry } from './trust-proxy.ts';\nimport type { Config } from './types.ts';\nimport { CERTIFICATE_SOURCES } from '../../../adapters/http/request/index.ts';\n\nexport class ConfigValidator extends Container<Config> {\n protected override initialize() {\n super.initialize();\n\n const stringValidator = createValidator(z.string());\n const booleanValidator = createValidator(z.boolean());\n const nonNegativeNumberValidator = createValidator(z.number().nonnegative());\n const secretValidator = createValidator(z.string().min(3).max(256));\n const middlewareValidator = createValidator(\n z.boolean().or(z.record(z.string(), z.any())),\n );\n const serviceValidator = createValidator(\n z.string()\n .or(z.boolean())\n .or(z.custom<Record<string, any>>((value) => isObject(value))),\n );\n\n // Record<keyof Config, ...> is the compile-time exhaustiveness\n // guard: a Config key without a validator here fails the build\n // instead of being silently stripped by run().\n const validators: Record<keyof Config, ValidatorDescriptor> = {\n env: stringValidator,\n rootPath: stringValidator,\n writableDirectoryPath: stringValidator,\n themeDirectoryPath: stringValidator,\n themeFragmentsEnabled: booleanValidator,\n authConsolePath: stringValidator,\n accountConsolePath: stringValidator,\n\n logger: booleanValidator,\n db: createValidator(\n z.custom<MysqlDataSourceOptions | PostgresDataSourceOptions | BetterSqlite3DataSourceOptions>(\n (value) => isObject(value),\n ),\n ),\n redis: serviceValidator,\n smtp: serviceValidator,\n\n port: nonNegativeNumberValidator,\n host: stringValidator,\n publicUrl: createValidator(z.url()),\n mtlsPublicUrl: createValidator(z.url().nullable()),\n certificateSource: createValidator(z.enum(CERTIFICATE_SOURCES)),\n trustProxy: createValidator(z.union([\n z.boolean(),\n z.number().int().nonnegative(),\n // scalar strings are canonicalized in normalizeConfig\n // (integer/boolean words → their semantic type)\n z.string(),\n // the explicit allowlist form: an integer-string or boolean\n // word entry is a mis-typed scalar and must fail loud —\n // proxy-addr would silently compile '1' to 0.0.0.1\n z.array(z.string().refine(\n isValidTrustProxyListEntry,\n 'must be an IP, CIDR, or proxy-addr preset',\n )),\n ])),\n trustedOrigins: createValidator(\n z.array(z.string().refine((value) => {\n try {\n expandToOrigins(value);\n return true;\n } catch {\n return false;\n }\n }, 'must be a http(s) origin or a bare host[:port]')),\n ),\n\n middlewareBody: middlewareValidator,\n middlewareCors: middlewareValidator,\n middlewareCookie: middlewareValidator,\n middlewareQuery: middlewareValidator,\n middlewarePrometheus: middlewareValidator,\n middlewareRateLimit: middlewareValidator,\n middlewareSwagger: booleanValidator,\n\n tokenAccessMaxAge: nonNegativeNumberValidator,\n tokenRefreshMaxAge: nonNegativeNumberValidator,\n tokenRefreshGracePeriod: nonNegativeNumberValidator,\n promptLoginMaxAge: nonNegativeNumberValidator,\n endSessionHintGracePeriod: nonNegativeNumberValidator,\n registrationEnabled: booleanValidator,\n emailVerificationEnabled: booleanValidator,\n passwordRecoveryEnabled: booleanValidator,\n passwordMinLength: createValidator(\n z.number().int().positive().max(USER_PASSWORD_MAX_LENGTH),\n ),\n accountConsoleEnabled: booleanValidator,\n\n eventLogEnabled: booleanValidator,\n eventLogRetentionDays: nonNegativeNumberValidator,\n eventLogEntityEnabled: booleanValidator,\n eventLogEntityRetentionDays: nonNegativeNumberValidator,\n loginAttemptThrottleEnabled: booleanValidator,\n loginAttemptThreshold: createValidator(z.number().int().positive()),\n loginAttemptWindow: createValidator(z.number().int().positive()),\n\n // '' = unset; otherwise a base64 string (normalizeConfig enforces\n // the decoded 32-byte length at boot).\n secretsEncryptionKey: createValidator(z.union([z.literal(''), z.base64()])),\n\n mfaEnabled: booleanValidator,\n mfaRequired: booleanValidator,\n mfaFreshnessMaxAge: nonNegativeNumberValidator,\n mfaTicketMaxAge: createValidator(z.number().int().positive()),\n\n clientAuthBasic: booleanValidator,\n clientSystemEnabled: booleanValidator,\n clientSystemSecret: secretValidator,\n clientSystemSecretReset: booleanValidator,\n\n userAuthBasic: booleanValidator,\n userAdminEnabled: booleanValidator,\n userAdminPassword: secretValidator,\n userAdminPasswordReset: booleanValidator,\n\n permissions: createValidator(\n z.string().or(z.array(z.string())),\n ),\n permissionsDefaultPolicyAssignment: booleanValidator,\n };\n\n const keys = Object.keys(validators) as (keyof Config)[];\n for (const key of keys) {\n this.mount(key, { optional: true }, validators[key]);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAqBA,IAAaQ,kBAAb,cAAqCL,UAAAA;CACdM,aAAa;EAC5B,MAAMA,WAAAA;EAEN,MAAMC,kBAAkBR,gBAAgBE,EAAEO,OAAM,CAAA;EAChD,MAAMC,mBAAmBV,gBAAgBE,EAAES,QAAO,CAAA;EAClD,MAAMC,6BAA6BZ,gBAAgBE,EAAEW,OAAM,CAAA,CAAGC,YAAW,CAAA;EACzE,MAAMC,kBAAkBf,gBAAgBE,EAAEO,OAAM,CAAA,CAAGO,IAAI,CAAA,CAAA,CAAGC,IAAI,GAAA,CAAA;EAC9D,MAAMC,sBAAsBlB,gBACxBE,EAAES,QAAO,CAAA,CAAGQ,GAAGjB,EAAEkB,OAAOlB,EAAEO,OAAM,GAAIP,EAAEmB,IAAG,CAAA,CAAA,CAAA;EAE7C,MAAMC,mBAAmBtB,gBACrBE,EAAEO,OAAM,CAAA,CACHU,GAAGjB,EAAES,QAAO,CAAA,CAAA,CACZQ,GAAGjB,EAAEqB,QAA6BC,UAAUzB,SAASyB,KAAAA,CAAAA,CAAAA,CAAAA;EAM9D,MAAMC,aAAwD;GAC1DC,KAAKlB;GACLmB,UAAUnB;GACV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AGlD,IAAInB,wBAAAA,CAAAA;GAEpCsE,uBAAuB1D;GAEvB2D,iBAAiB3D;GACjB4D,uBAAuB1D;GACvB2D,uBAAuB7D;GACvB8D,6BAA6B5D;GAC7B6D,6BAA6B/D;GAC7BgE,uBAAuB1E,gBAAgBE,EAAEW,OAAM,CAAA,CAAGkC,IAAG,CAAA,CAAGoB,SAAQ,CAAA;GAChEQ,oBAAoB3E,gBAAgBE,EAAEW,OAAM,CAAA,CAAGkC,IAAG,CAAA,CAAGoB,SAAQ,CAAA;GAI7DS,sBAAsB5E,gBAAgBE,EAAE4C,MAAM,CAAC5C,EAAE2E,QAAQ,EAAA,GAAK3E,EAAE4E,OAAM,CAAG,CAAA,CAAA;GAEzEC,YAAYrE;GACZsE,aAAatE;GACbuE,oBAAoBrE;GACpBsE,iBAAiBlF,gBAAgBE,EAAEW,OAAM,CAAA,CAAGkC,IAAG,CAAA,CAAGoB,SAAQ,CAAA;GAE1DgB,iBAAiBzE;GACjB0E,qBAAqB1E;GACrB2E,oBAAoBtE;GACpBuE,yBAAyB5E;GAEzB6E,eAAe7E;GACf8E,kBAAkB9E;GAClB+E,mBAAmB1E;GACnB2E,wBAAwBhF;GAExBiF,aAAa3F,gBACTE,EAAEO,OAAM,CAAA,CAAGU,GAAGjB,EAAE8C,MAAM9C,EAAEO,OAAM,CAAA,CAAA,CAAA;GAElCmF,oCAAoClF;EACxC;EAEA,MAAMmF,OAAOC,OAAOD,KAAKpE,UAAAA;EACzB,KAAK,MAAMsE,OAAOF,MACd,KAAKG,MAAMD,KAAK,EAAEE,UAAU,KAAK,GAAGxE,WAAWsE,IAAI;CAE3D;AACJ"}
@@ -135,7 +135,8 @@ var DatabaseModule = class {
135
135
  }
136
136
  registerEventPublisher(container, dataSource) {
137
137
  const config = container.resolve(ConfigInjectionKey);
138
- const publisher = new DomainEventPublisher({ logger: container.resolve(LoggerInjectionKey) });
138
+ const logger = container.resolve(LoggerInjectionKey);
139
+ const publisher = new DomainEventPublisher({ logger });
139
140
  this.eventPublisher = publisher;
140
141
  if (config.redis) {
141
142
  const client = createRedisClient(config.redis);
@@ -1 +1 @@
1
- {"version":3,"file":"module.mjs","names":["DomainEventPublisher","DomainEventRedisHandler","DomainEventSocketHandler","createRedisClient","AuthupError","DataSource","InstanceChecker","checkDatabase","createDatabase","synchronizeDatabaseSchema","DataSourceOptionsBuilder","DatabaseQueryResultCache","EntitySubscriber","EventEntity","isDatabaseTypeSupported","isDatabaseTypeSupportedForEnvironment","EntityEventHandler","EventService","useRequestEventContext","EventRepositoryAdapter","validateEntitySchemas","CacheInjectionKey","ModuleName","DatabaseInjectionKey","ConfigInjectionKey","LoggerInjectionKey","DatabaseModule","name","dependencies","optionsBuilder","options","eventRedisClient","eventPublisher","DATABASE","CONFIG","LOGGER","setup","container","logger","resolve","prepareBuild","dataSourceOptions","buildDataSourceOptions","setupDatabase","dataSource","debug","initialize","migrate","registerRepositories","registerEvents","registerEventPublisher","register","useValue","e","isInitialized","destroy","disposeEventPublisher","cleanupError","warn","teardown","tryResolve","success","data","unregister","EventRepository","dispose","undefined","disconnect","check","exists","synchronize","ifNotExist","config","db","buildWith","buildWithEnv","type","env","cacheResult","Object","assign","cache","provider","entities","Array","isArray","entity","isEntitySchema","useFactory","getRepository","publisher","redis","client","eventLogEnabled","eventLogEntityEnabled","eventService","requestContext","retentionDays","eventLogEntityRetentionDays","i","subscribers","length","subscriber","setPublisher","repository","service","enabled","eventLogRetentionDays"],"sources":["../../../../src/app/modules/database/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 {\n DomainEventPublisher,\n DomainEventRedisHandler,\n DomainEventSocketHandler,\n createRedisClient,\n} from '@authup/server-kit';\nimport type { RedisClient } from '@authup/server-kit';\nimport { AuthupError } from '@authup/errors';\nimport type { DataSourceOptions } from 'typeorm';\nimport { DataSource, InstanceChecker } from 'typeorm';\nimport {\n checkDatabase,\n createDatabase,\n synchronizeDatabaseSchema,\n} from 'typeorm-extension';\nimport {\n DataSourceOptionsBuilder,\n DatabaseQueryResultCache,\n EntitySubscriber,\n EventEntity,\n isDatabaseTypeSupported,\n isDatabaseTypeSupportedForEnvironment,\n} from '../../../adapters/database/index.ts';\nimport type { Event } from '@authup/core-kit';\nimport { EntityEventHandler, EventService } from '../../../core/index.ts';\nimport { useRequestEventContext } from '../../../adapters/http/request/index.ts';\nimport { EventRepositoryAdapter } from './repositories/index.ts';\nimport { validateEntitySchemas } from './repositories/schema-validation.ts';\nimport { CacheInjectionKey } from '../cache/index.ts';\nimport type { IModule } from 'orkos';\nimport { ModuleName } from '../constants.ts';\nimport { DatabaseInjectionKey } from './constants.ts';\nimport { ConfigInjectionKey } from '../config/index.ts';\nimport type { IContainer } from 'eldin';\nimport { LoggerInjectionKey } from '../logger/index.ts';\n\nexport type DatabaseModuleOptions = {\n prepareBuild?: (container: IContainer) => Promise<void>;\n setup?: (container: IContainer, options: DataSourceOptions) => Promise<void>;\n migrate?: (container: IContainer, dataSource: DataSource) => Promise<void>;\n};\n\nexport class DatabaseModule implements IModule {\n readonly name: string;\n\n readonly dependencies: string[];\n\n protected optionsBuilder : DataSourceOptionsBuilder;\n\n protected options: DatabaseModuleOptions;\n\n protected eventRedisClient? : RedisClient;\n\n protected eventPublisher? : DomainEventPublisher;\n\n constructor(options: DatabaseModuleOptions = {}) {\n this.name = ModuleName.DATABASE;\n this.dependencies = [ModuleName.CONFIG, ModuleName.LOGGER];\n\n this.optionsBuilder = new DataSourceOptionsBuilder();\n this.options = options;\n }\n\n async setup(container: IContainer): Promise<void> {\n const logger = container.resolve(LoggerInjectionKey);\n\n if (this.options.prepareBuild) {\n await this.options.prepareBuild(container);\n }\n\n const dataSourceOptions = await this.buildDataSourceOptions(container);\n\n if (this.options.setup) {\n await this.options.setup(container, dataSourceOptions);\n } else {\n await this.setupDatabase(container, dataSourceOptions);\n }\n\n const dataSource = new DataSource(dataSourceOptions);\n\n logger.debug('Establishing database connection...');\n await dataSource.initialize();\n logger.debug('Established database connection.');\n\n try {\n if (this.options.migrate) {\n await this.options.migrate(container, dataSource);\n } else {\n await this.migrate(container, dataSource);\n }\n\n validateEntitySchemas(dataSource);\n this.registerRepositories(container, dataSource);\n // the event service must exist before the publisher wiring — the\n // entity-CRUD bridge handler resolves it from the container.\n this.registerEvents(container, dataSource);\n this.registerEventPublisher(container, dataSource);\n\n container.register(DatabaseInjectionKey.DataSource, { useValue: dataSource });\n } catch (e) {\n // teardown() is skipped for a module that fails its own setup(),\n // so release the connection pool and any event-publisher handles\n // here. Guard cleanup so it can never mask the original error.\n try {\n if (dataSource.isInitialized) {\n await dataSource.destroy();\n }\n\n await this.disposeEventPublisher();\n } catch (cleanupError) {\n logger.warn(`Failed to clean up database resources after setup error: ${cleanupError}`);\n }\n\n throw e;\n }\n }\n\n async teardown(container: IContainer): Promise<void> {\n const dataSource = container.tryResolve(DatabaseInjectionKey.DataSource);\n if (dataSource.success) {\n if (dataSource.data.isInitialized) {\n await dataSource.data.destroy();\n }\n\n container.unregister(DatabaseInjectionKey.DataSource);\n }\n\n container.unregister(DatabaseInjectionKey.DomainEventPublisher);\n container.unregister(DatabaseInjectionKey.EventRepository);\n container.unregister(DatabaseInjectionKey.EventService);\n\n await this.disposeEventPublisher();\n }\n\n protected async disposeEventPublisher(): Promise<void> {\n if (this.eventPublisher) {\n await this.eventPublisher.dispose();\n this.eventPublisher = undefined;\n }\n\n if (this.eventRedisClient) {\n this.eventRedisClient.disconnect();\n this.eventRedisClient = undefined;\n }\n }\n\n // ----------------------------------------------------\n\n protected async setupDatabase(container: IContainer, options: DataSourceOptions): Promise<void> {\n const logger = container.resolve(LoggerInjectionKey);\n\n const check = await checkDatabase({ options });\n\n if (!check.exists) {\n logger.debug('Creating database...');\n await createDatabase({\n options,\n synchronize: false,\n ifNotExist: true, \n });\n logger.debug('Created database');\n }\n }\n\n protected async migrate(container: IContainer, dataSource: DataSource): Promise<void> {\n const logger = container.resolve(LoggerInjectionKey);\n\n logger.debug('Migrating database...');\n await synchronizeDatabaseSchema(dataSource);\n logger.debug('Migrated database');\n }\n\n // ----------------------------------------------------\n\n /**\n * Load data source options for connection.\n *\n * @protected\n */\n protected async buildDataSourceOptions(container: IContainer) : Promise<DataSourceOptions> {\n const config = container.resolve(ConfigInjectionKey);\n\n let options : DataSourceOptions | undefined;\n if (config.db) {\n options = this.optionsBuilder.buildWith(config.db);\n } else {\n options = this.optionsBuilder.buildWithEnv();\n }\n\n if (!isDatabaseTypeSupported(options.type)) {\n throw new AuthupError(`Database type ${options.type} is not supported (only: mysql, better-sqlite3 and postgres).`);\n }\n\n if (!isDatabaseTypeSupportedForEnvironment(options.type, config.env)) {\n throw new AuthupError(`Database type ${options.type} is not supported for ${config.env}.`);\n }\n\n const cacheResult = container.tryResolve(CacheInjectionKey);\n if (cacheResult.success) {\n Object.assign(options, {\n cache: {\n provider() {\n return new DatabaseQueryResultCache(cacheResult.data);\n },\n },\n } satisfies Partial<DataSourceOptions>);\n }\n\n return options;\n }\n\n protected registerRepositories(container: IContainer, dataSource: DataSource) : void {\n const entities = dataSource.options.entities || [];\n if (!Array.isArray(entities)) {\n return;\n }\n\n for (const entity of entities) {\n if (InstanceChecker.isEntitySchema(entity)) {\n continue;\n }\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n container.register(entity, { useFactory: () => dataSource.getRepository(entity) });\n }\n }\n\n protected registerEventPublisher(container: IContainer, dataSource: DataSource) {\n const config = container.resolve(ConfigInjectionKey);\n const logger = container.resolve(LoggerInjectionKey);\n\n const publisher = new DomainEventPublisher({ logger });\n this.eventPublisher = publisher;\n if (config.redis) {\n const client = createRedisClient(config.redis);\n if (client !== config.redis) {\n this.eventRedisClient = client;\n }\n\n publisher.register(new DomainEventRedisHandler(client));\n publisher.register(new DomainEventSocketHandler(client));\n }\n\n if (config.eventLogEnabled && config.eventLogEntityEnabled) {\n publisher.register(new EntityEventHandler({\n eventService: container.resolve(DatabaseInjectionKey.EventService),\n requestContext: useRequestEventContext,\n options: { retentionDays: config.eventLogEntityRetentionDays },\n }));\n }\n\n container.register(DatabaseInjectionKey.DomainEventPublisher, { useValue: publisher });\n\n for (let i = 0; i < dataSource.subscribers.length; i++) {\n const subscriber = dataSource.subscribers[i];\n if (subscriber instanceof EntitySubscriber) {\n subscriber.setPublisher(publisher);\n }\n }\n }\n\n protected registerEvents(container: IContainer, dataSource: DataSource) {\n const config = container.resolve(ConfigInjectionKey);\n const logger = container.resolve(LoggerInjectionKey);\n\n const repository = new EventRepositoryAdapter(\n dataSource.getRepository<Event>(EventEntity),\n );\n container.register(DatabaseInjectionKey.EventRepository, { useValue: repository });\n\n const service = new EventService({\n repository,\n options: {\n enabled: config.eventLogEnabled,\n retentionDays: config.eventLogRetentionDays,\n },\n logger,\n });\n container.register(DatabaseInjectionKey.EventService, { useValue: service });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,IAAa0B,iBAAb,MAAaA;CACAC;CAEAC;CAECC;CAEAC;CAEAC;CAEAC;CAEV,YAAYF,UAAiC,CAAC,GAAG;EAC7C,KAAKH,OAAOL,WAAWW;EACvB,KAAKL,eAAe,CAACN,WAAWY,QAAQZ,WAAWa,MAAO;EAE1D,KAAKN,iBAAiB,IAAInB,yBAAAA;EAC1B,KAAKoB,UAAUA;CACnB;CAEA,MAAMM,MAAMC,WAAsC;EAC9C,MAAMC,SAASD,UAAUE,QAAQd,kBAAAA;EAEjC,IAAI,KAAKK,QAAQU,cACb,MAAM,KAAKV,QAAQU,aAAaH,SAAAA;EAGpC,MAAMI,oBAAoB,MAAM,KAAKC,uBAAuBL,SAAAA;EAE5D,IAAI,KAAKP,QAAQM,OACb,MAAM,KAAKN,QAAQM,MAAMC,WAAWI,iBAAAA;OAEpC,MAAM,KAAKE,cAAcN,WAAWI,iBAAAA;EAGxC,MAAMG,aAAa,IAAIvC,WAAWoC,iBAAAA;EA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kBAAAA;EAEjC,MAAM+E,aAAa,IAAIrF,uBACnByB,WAAW6C,cAAqB5E,WAAAA,CAAAA;EAEpCwB,UAAUc,SAAS5B,qBAAqByC,iBAAiB,EAAEZ,UAAUoD,WAAW,CAAA;EAEhF,MAAMC,UAAU,IAAIxF,aAAa;GAC7BuF;GACA1E,SAAS;IACL4E,SAASlC,OAAOqB;IAChBI,eAAezB,OAAOmC;GAC1B;GACArE;EACJ,CAAA;EACAD,UAAUc,SAAS5B,qBAAqBN,cAAc,EAAEmC,UAAUqD,QAAQ,CAAA;CAC9E;AACJ"}
1
+ {"version":3,"file":"module.mjs","names":["DomainEventPublisher","DomainEventRedisHandler","DomainEventSocketHandler","createRedisClient","AuthupError","DataSource","InstanceChecker","checkDatabase","createDatabase","synchronizeDatabaseSchema","DataSourceOptionsBuilder","DatabaseQueryResultCache","EntitySubscriber","EventEntity","isDatabaseTypeSupported","isDatabaseTypeSupportedForEnvironment","EntityEventHandler","EventService","useRequestEventContext","EventRepositoryAdapter","validateEntitySchemas","CacheInjectionKey","ModuleName","DatabaseInjectionKey","ConfigInjectionKey","LoggerInjectionKey","DatabaseModule","name","dependencies","optionsBuilder","options","eventRedisClient","eventPublisher","DATABASE","CONFIG","LOGGER","setup","container","logger","resolve","prepareBuild","dataSourceOptions","buildDataSourceOptions","setupDatabase","dataSource","debug","initialize","migrate","registerRepositories","registerEvents","registerEventPublisher","register","useValue","e","isInitialized","destroy","disposeEventPublisher","cleanupError","warn","teardown","tryResolve","success","data","unregister","EventRepository","dispose","undefined","disconnect","check","exists","synchronize","ifNotExist","config","db","buildWith","buildWithEnv","type","env","cacheResult","Object","assign","cache","provider","entities","Array","isArray","entity","isEntitySchema","useFactory","getRepository","publisher","redis","client","eventLogEnabled","eventLogEntityEnabled","eventService","requestContext","retentionDays","eventLogEntityRetentionDays","i","subscribers","length","subscriber","setPublisher","repository","service","enabled","eventLogRetentionDays"],"sources":["../../../../src/app/modules/database/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 {\n DomainEventPublisher,\n DomainEventRedisHandler,\n DomainEventSocketHandler,\n createRedisClient,\n} from '@authup/server-kit';\nimport type { RedisClient } from '@authup/server-kit';\nimport { AuthupError } from '@authup/errors';\nimport type { DataSourceOptions } from 'typeorm';\nimport { DataSource, InstanceChecker } from 'typeorm';\nimport {\n checkDatabase,\n createDatabase,\n synchronizeDatabaseSchema,\n} from 'typeorm-extension';\nimport {\n DataSourceOptionsBuilder,\n DatabaseQueryResultCache,\n EntitySubscriber,\n EventEntity,\n isDatabaseTypeSupported,\n isDatabaseTypeSupportedForEnvironment,\n} from '../../../adapters/database/index.ts';\nimport type { Event } from '@authup/core-kit';\nimport { EntityEventHandler, EventService } from '../../../core/index.ts';\nimport { useRequestEventContext } from '../../../adapters/http/request/index.ts';\nimport { EventRepositoryAdapter } from './repositories/index.ts';\nimport { validateEntitySchemas } from './repositories/schema-validation.ts';\nimport { CacheInjectionKey } from '../cache/index.ts';\nimport type { IModule } from 'orkos';\nimport { ModuleName } from '../constants.ts';\nimport { DatabaseInjectionKey } from './constants.ts';\nimport { ConfigInjectionKey } from '../config/index.ts';\nimport type { IContainer } from 'eldin';\nimport { LoggerInjectionKey } from '../logger/index.ts';\n\nexport type DatabaseModuleOptions = {\n prepareBuild?: (container: IContainer) => Promise<void>;\n setup?: (container: IContainer, options: DataSourceOptions) => Promise<void>;\n migrate?: (container: IContainer, dataSource: DataSource) => Promise<void>;\n};\n\nexport class DatabaseModule implements IModule {\n readonly name: string;\n\n readonly dependencies: string[];\n\n protected optionsBuilder : DataSourceOptionsBuilder;\n\n protected options: DatabaseModuleOptions;\n\n protected eventRedisClient? : RedisClient;\n\n protected eventPublisher? : DomainEventPublisher;\n\n constructor(options: DatabaseModuleOptions = {}) {\n this.name = ModuleName.DATABASE;\n this.dependencies = [ModuleName.CONFIG, ModuleName.LOGGER];\n\n this.optionsBuilder = new DataSourceOptionsBuilder();\n this.options = options;\n }\n\n async setup(container: IContainer): Promise<void> {\n const logger = container.resolve(LoggerInjectionKey);\n\n if (this.options.prepareBuild) {\n await this.options.prepareBuild(container);\n }\n\n const dataSourceOptions = await this.buildDataSourceOptions(container);\n\n if (this.options.setup) {\n await this.options.setup(container, dataSourceOptions);\n } else {\n await this.setupDatabase(container, dataSourceOptions);\n }\n\n const dataSource = new DataSource(dataSourceOptions);\n\n logger.debug('Establishing database connection...');\n await dataSource.initialize();\n logger.debug('Established database connection.');\n\n try {\n if (this.options.migrate) {\n await this.options.migrate(container, dataSource);\n } else {\n await this.migrate(container, dataSource);\n }\n\n validateEntitySchemas(dataSource);\n this.registerRepositories(container, dataSource);\n // the event service must exist before the publisher wiring — the\n // entity-CRUD bridge handler resolves it from the container.\n this.registerEvents(container, dataSource);\n this.registerEventPublisher(container, dataSource);\n\n container.register(DatabaseInjectionKey.DataSource, { useValue: dataSource });\n } catch (e) {\n // teardown() is skipped for a module that fails its own setup(),\n // so release the connection pool and any event-publisher handles\n // here. Guard cleanup so it can never mask the original error.\n try {\n if (dataSource.isInitialized) {\n await dataSource.destroy();\n }\n\n await this.disposeEventPublisher();\n } catch (cleanupError) {\n logger.warn(`Failed to clean up database resources after setup error: ${cleanupError}`);\n }\n\n throw e;\n }\n }\n\n async teardown(container: IContainer): Promise<void> {\n const dataSource = container.tryResolve(DatabaseInjectionKey.DataSource);\n if (dataSource.success) {\n if (dataSource.data.isInitialized) {\n await dataSource.data.destroy();\n }\n\n container.unregister(DatabaseInjectionKey.DataSource);\n }\n\n container.unregister(DatabaseInjectionKey.DomainEventPublisher);\n container.unregister(DatabaseInjectionKey.EventRepository);\n container.unregister(DatabaseInjectionKey.EventService);\n\n await this.disposeEventPublisher();\n }\n\n protected async disposeEventPublisher(): Promise<void> {\n if (this.eventPublisher) {\n await this.eventPublisher.dispose();\n this.eventPublisher = undefined;\n }\n\n if (this.eventRedisClient) {\n this.eventRedisClient.disconnect();\n this.eventRedisClient = undefined;\n }\n }\n\n // ----------------------------------------------------\n\n protected async setupDatabase(container: IContainer, options: DataSourceOptions): Promise<void> {\n const logger = container.resolve(LoggerInjectionKey);\n\n const check = await checkDatabase({ options });\n\n if (!check.exists) {\n logger.debug('Creating database...');\n await createDatabase({\n options,\n synchronize: false,\n ifNotExist: true, \n });\n logger.debug('Created database');\n }\n }\n\n protected async migrate(container: IContainer, dataSource: DataSource): Promise<void> {\n const logger = container.resolve(LoggerInjectionKey);\n\n logger.debug('Migrating database...');\n await synchronizeDatabaseSchema(dataSource);\n logger.debug('Migrated database');\n }\n\n // ----------------------------------------------------\n\n /**\n * Load data source options for connection.\n *\n * @protected\n */\n protected async buildDataSourceOptions(container: IContainer) : Promise<DataSourceOptions> {\n const config = container.resolve(ConfigInjectionKey);\n\n let options : DataSourceOptions | undefined;\n if (config.db) {\n options = this.optionsBuilder.buildWith(config.db);\n } else {\n options = this.optionsBuilder.buildWithEnv();\n }\n\n if (!isDatabaseTypeSupported(options.type)) {\n throw new AuthupError(`Database type ${options.type} is not supported (only: mysql, better-sqlite3 and postgres).`);\n }\n\n if (!isDatabaseTypeSupportedForEnvironment(options.type, config.env)) {\n throw new AuthupError(`Database type ${options.type} is not supported for ${config.env}.`);\n }\n\n const cacheResult = container.tryResolve(CacheInjectionKey);\n if (cacheResult.success) {\n Object.assign(options, {\n cache: {\n provider() {\n return new DatabaseQueryResultCache(cacheResult.data);\n },\n },\n } satisfies Partial<DataSourceOptions>);\n }\n\n return options;\n }\n\n protected registerRepositories(container: IContainer, dataSource: DataSource) : void {\n const entities = dataSource.options.entities || [];\n if (!Array.isArray(entities)) {\n return;\n }\n\n for (const entity of entities) {\n if (InstanceChecker.isEntitySchema(entity)) {\n continue;\n }\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n container.register(entity, { useFactory: () => dataSource.getRepository(entity) });\n }\n }\n\n protected registerEventPublisher(container: IContainer, dataSource: DataSource) {\n const config = container.resolve(ConfigInjectionKey);\n const logger = container.resolve(LoggerInjectionKey);\n\n const publisher = new DomainEventPublisher({ logger });\n this.eventPublisher = publisher;\n if (config.redis) {\n const client = createRedisClient(config.redis);\n if (client !== config.redis) {\n this.eventRedisClient = client;\n }\n\n publisher.register(new DomainEventRedisHandler(client));\n publisher.register(new DomainEventSocketHandler(client));\n }\n\n if (config.eventLogEnabled && config.eventLogEntityEnabled) {\n publisher.register(new EntityEventHandler({\n eventService: container.resolve(DatabaseInjectionKey.EventService),\n requestContext: useRequestEventContext,\n options: { retentionDays: config.eventLogEntityRetentionDays },\n }));\n }\n\n container.register(DatabaseInjectionKey.DomainEventPublisher, { useValue: publisher });\n\n for (let i = 0; i < dataSource.subscribers.length; i++) {\n const subscriber = dataSource.subscribers[i];\n if (subscriber instanceof EntitySubscriber) {\n subscriber.setPublisher(publisher);\n }\n }\n }\n\n protected registerEvents(container: IContainer, dataSource: DataSource) {\n const config = container.resolve(ConfigInjectionKey);\n const logger = container.resolve(LoggerInjectionKey);\n\n const repository = new EventRepositoryAdapter(\n dataSource.getRepository<Event>(EventEntity),\n );\n container.register(DatabaseInjectionKey.EventRepository, { useValue: repository });\n\n const service = new EventService({\n repository,\n options: {\n enabled: config.eventLogEnabled,\n retentionDays: config.eventLogRetentionDays,\n },\n logger,\n });\n container.register(DatabaseInjectionKey.EventService, { useValue: service });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,IAAa0B,iBAAb,MAAaA;CACAC;CAEAC;CAECC;CAEAC;CAEAC;CAEAC;CAEV,YAAYF,UAAiC,CAAC,GAAG;EAC7C,KAAKH,OAAOL,WAAWW;EACvB,KAAKL,eAAe,CAACN,WAAWY,QAAQZ,WAAWa,MAAO;EAE1D,KAAKN,iBAAiB,IAAInB,yBAAAA;EAC1B,KAAKoB,UAAUA;CACnB;CAEA,MAAMM,MAAMC,WAAsC;EAC9C,MAAMC,SAASD,UAAUE,QAAQd,kBAAAA;EAEjC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