@authup/server-core 1.0.0-beta.58 → 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.
- package/dist/adapters/http/controllers/index.mjs +2 -1
- package/dist/adapters/http/controllers/workflows/account/index.d.ts +2 -0
- package/dist/adapters/http/controllers/workflows/account/index.d.ts.map +1 -0
- package/dist/adapters/http/controllers/workflows/account/index.mjs +5 -0
- package/dist/adapters/http/controllers/workflows/account/module.d.ts +24 -0
- package/dist/adapters/http/controllers/workflows/account/module.d.ts.map +1 -0
- package/dist/adapters/http/controllers/workflows/account/module.mjs +63 -0
- package/dist/adapters/http/controllers/workflows/account/module.mjs.map +1 -0
- package/dist/adapters/http/controllers/workflows/activate/module.mjs +1 -1
- package/dist/adapters/http/controllers/workflows/authorize/module.mjs +2 -2
- package/dist/adapters/http/controllers/workflows/authorize/module.mjs.map +1 -1
- package/dist/adapters/http/controllers/workflows/index.d.ts +1 -0
- package/dist/adapters/http/controllers/workflows/index.d.ts.map +1 -1
- package/dist/adapters/http/controllers/workflows/index.mjs +3 -1
- package/dist/adapters/http/controllers/workflows/logout/module.mjs +2 -2
- package/dist/adapters/http/controllers/workflows/logout/module.mjs.map +1 -1
- package/dist/adapters/http/controllers/workflows/password-forgot/module.mjs +1 -1
- package/dist/adapters/http/controllers/workflows/password-reset/module.mjs +1 -1
- package/dist/adapters/http/controllers/workflows/register/module.mjs +1 -1
- package/dist/adapters/http/controllers/workflows/userinfo/module.d.ts.map +1 -1
- package/dist/adapters/http/controllers/workflows/userinfo/module.mjs +5 -1
- package/dist/adapters/http/controllers/workflows/userinfo/module.mjs.map +1 -1
- package/dist/adapters/http/index.mjs +3 -1
- package/dist/adapters/http/middleware/built-in/assets.d.ts +8 -1
- package/dist/adapters/http/middleware/built-in/assets.d.ts.map +1 -1
- package/dist/adapters/http/middleware/built-in/assets.mjs +48 -4
- package/dist/adapters/http/middleware/built-in/assets.mjs.map +1 -1
- package/dist/adapters/http/middleware/built-in/index.d.ts +2 -0
- package/dist/adapters/http/middleware/built-in/index.d.ts.map +1 -1
- package/dist/adapters/http/middleware/built-in/index.mjs +2 -1
- package/dist/adapters/http/middleware/built-in/theme.d.ts +15 -0
- package/dist/adapters/http/middleware/built-in/theme.d.ts.map +1 -0
- package/dist/adapters/http/middleware/built-in/theme.mjs +27 -0
- package/dist/adapters/http/middleware/built-in/theme.mjs.map +1 -0
- package/dist/adapters/http/middleware/built-in/types.d.ts +14 -0
- package/dist/adapters/http/middleware/built-in/types.d.ts.map +1 -0
- package/dist/adapters/http/middleware/built-in/ui-http-client.d.ts +1 -1
- package/dist/adapters/http/middleware/built-in/ui-http-client.mjs +1 -1
- package/dist/adapters/http/middleware/built-in/ui-http-client.mjs.map +1 -1
- package/dist/adapters/http/middleware/index.mjs +2 -1
- package/dist/adapters/http/ui/account-console/index.d.ts +4 -0
- package/dist/adapters/http/ui/account-console/index.d.ts.map +1 -0
- package/dist/adapters/http/ui/account-console/index.mjs +6 -0
- package/dist/adapters/http/ui/account-console/module.d.ts +28 -0
- package/dist/adapters/http/ui/account-console/module.d.ts.map +1 -0
- package/dist/adapters/http/ui/account-console/module.mjs +80 -0
- package/dist/adapters/http/ui/account-console/module.mjs.map +1 -0
- package/dist/adapters/http/ui/account-console/ref.d.ts +30 -0
- package/dist/adapters/http/ui/account-console/ref.d.ts.map +1 -0
- package/dist/adapters/http/ui/account-console/ref.mjs +50 -0
- package/dist/adapters/http/ui/account-console/ref.mjs.map +1 -0
- package/dist/adapters/http/ui/account-console/types.d.ts +11 -0
- package/dist/adapters/http/ui/account-console/types.d.ts.map +1 -0
- package/dist/adapters/http/ui/account-console/types.mjs +4 -0
- package/dist/adapters/http/ui/{internal-http-client.d.ts → auth-console/http-client.d.ts} +1 -1
- package/dist/adapters/http/ui/auth-console/http-client.d.ts.map +1 -0
- package/dist/adapters/http/ui/{internal-http-client.mjs → auth-console/http-client.mjs} +2 -2
- package/dist/adapters/http/ui/auth-console/http-client.mjs.map +1 -0
- package/dist/adapters/http/ui/auth-console/index.d.ts +6 -0
- package/dist/adapters/http/ui/auth-console/index.d.ts.map +1 -0
- package/dist/adapters/http/ui/auth-console/index.mjs +8 -0
- package/dist/adapters/http/ui/auth-console/module.d.ts +4 -0
- package/dist/adapters/http/ui/auth-console/module.d.ts.map +1 -0
- package/dist/adapters/http/ui/auth-console/module.mjs +73 -0
- package/dist/adapters/http/ui/auth-console/module.mjs.map +1 -0
- package/dist/adapters/http/ui/auth-console/resolve.d.ts +21 -0
- package/dist/adapters/http/ui/auth-console/resolve.d.ts.map +1 -0
- package/dist/adapters/http/ui/auth-console/resolve.mjs +53 -0
- package/dist/adapters/http/ui/auth-console/resolve.mjs.map +1 -0
- package/dist/adapters/http/ui/{serve.d.ts → auth-console/serve.d.ts} +1 -8
- package/dist/adapters/http/ui/auth-console/serve.d.ts.map +1 -0
- package/dist/adapters/http/ui/{serve.mjs → auth-console/serve.mjs} +5 -5
- package/dist/adapters/http/ui/auth-console/serve.mjs.map +1 -0
- package/dist/adapters/http/ui/auth-console/types.d.ts +26 -0
- package/dist/adapters/http/ui/auth-console/types.d.ts.map +1 -0
- package/dist/adapters/http/ui/auth-console/types.mjs +4 -0
- package/dist/adapters/http/ui/console-packages/index.d.ts +3 -0
- package/dist/adapters/http/ui/console-packages/index.d.ts.map +1 -0
- package/dist/adapters/http/ui/console-packages/index.mjs +5 -0
- package/dist/adapters/http/ui/console-packages/module.d.ts +33 -0
- package/dist/adapters/http/ui/console-packages/module.d.ts.map +1 -0
- package/dist/adapters/http/ui/console-packages/module.mjs +70 -0
- package/dist/adapters/http/ui/console-packages/module.mjs.map +1 -0
- package/dist/adapters/http/ui/console-packages/types.d.ts +12 -0
- package/dist/adapters/http/ui/console-packages/types.d.ts.map +1 -0
- package/dist/adapters/http/ui/console-packages/types.mjs +4 -0
- package/dist/adapters/http/ui/index.d.ts +5 -5
- package/dist/adapters/http/ui/index.d.ts.map +1 -1
- package/dist/adapters/http/ui/index.mjs +22 -5
- package/dist/adapters/http/ui/shared/html.d.ts +76 -0
- package/dist/adapters/http/ui/shared/html.d.ts.map +1 -0
- package/dist/adapters/http/ui/shared/html.mjs +103 -0
- package/dist/adapters/http/ui/shared/html.mjs.map +1 -0
- package/dist/adapters/http/ui/shared/index.d.ts +2 -0
- package/dist/adapters/http/ui/shared/index.d.ts.map +1 -0
- package/dist/adapters/http/ui/shared/index.mjs +5 -0
- package/dist/adapters/http/ui/theme/apply.d.ts +12 -0
- package/dist/adapters/http/ui/theme/apply.d.ts.map +1 -0
- package/dist/adapters/http/ui/theme/apply.mjs +29 -0
- package/dist/adapters/http/ui/theme/apply.mjs.map +1 -0
- package/dist/adapters/http/ui/theme/assets.d.ts +20 -0
- package/dist/adapters/http/ui/theme/assets.d.ts.map +1 -0
- package/dist/adapters/http/ui/theme/assets.mjs +86 -0
- package/dist/adapters/http/ui/theme/assets.mjs.map +1 -0
- package/dist/adapters/http/ui/theme/constants.d.ts +16 -0
- package/dist/adapters/http/ui/theme/constants.d.ts.map +1 -0
- package/dist/adapters/http/ui/theme/constants.mjs +20 -0
- package/dist/adapters/http/ui/theme/constants.mjs.map +1 -0
- package/dist/adapters/http/ui/theme/contract/constants.d.ts +120 -0
- package/dist/adapters/http/ui/theme/contract/constants.d.ts.map +1 -0
- package/dist/adapters/http/ui/theme/contract/constants.mjs +136 -0
- package/dist/adapters/http/ui/theme/contract/constants.mjs.map +1 -0
- package/dist/adapters/http/ui/theme/contract/head.d.ts +12 -0
- package/dist/adapters/http/ui/theme/contract/head.d.ts.map +1 -0
- package/dist/adapters/http/ui/theme/contract/head.mjs +61 -0
- package/dist/adapters/http/ui/theme/contract/head.mjs.map +1 -0
- package/dist/adapters/http/ui/theme/contract/index.d.ts +6 -0
- package/dist/adapters/http/ui/theme/contract/index.d.ts.map +1 -0
- package/dist/adapters/http/ui/theme/contract/index.mjs +8 -0
- package/dist/adapters/http/ui/theme/contract/manifest.d.ts +25 -0
- package/dist/adapters/http/ui/theme/contract/manifest.d.ts.map +1 -0
- package/dist/adapters/http/ui/theme/contract/manifest.mjs +77 -0
- package/dist/adapters/http/ui/theme/contract/manifest.mjs.map +1 -0
- package/dist/adapters/http/ui/theme/contract/types.d.ts +26 -0
- package/dist/adapters/http/ui/theme/contract/types.d.ts.map +1 -0
- package/dist/adapters/http/ui/theme/contract/types.mjs +4 -0
- package/dist/adapters/http/ui/theme/contract/utils.d.ts +11 -0
- package/dist/adapters/http/ui/theme/contract/utils.d.ts.map +1 -0
- package/dist/adapters/http/ui/theme/contract/utils.mjs +22 -0
- package/dist/adapters/http/ui/theme/contract/utils.mjs.map +1 -0
- package/dist/adapters/http/ui/theme/index.d.ts +7 -0
- package/dist/adapters/http/ui/theme/index.d.ts.map +1 -0
- package/dist/adapters/http/ui/theme/index.mjs +13 -0
- package/dist/adapters/http/ui/theme/module.d.ts +79 -0
- package/dist/adapters/http/ui/theme/module.d.ts.map +1 -0
- package/dist/adapters/http/ui/theme/module.mjs +206 -0
- package/dist/adapters/http/ui/theme/module.mjs.map +1 -0
- package/dist/adapters/http/ui/theme/types.d.ts +42 -0
- package/dist/adapters/http/ui/theme/types.d.ts.map +1 -0
- package/dist/adapters/http/ui/theme/types.mjs +4 -0
- package/dist/app/index.mjs +3 -1
- package/dist/app/modules/config/constants.d.ts +5 -0
- package/dist/app/modules/config/constants.d.ts.map +1 -1
- package/dist/app/modules/config/constants.mjs +5 -0
- package/dist/app/modules/config/constants.mjs.map +1 -1
- package/dist/app/modules/config/normalize.d.ts.map +1 -1
- package/dist/app/modules/config/normalize.mjs +8 -0
- package/dist/app/modules/config/normalize.mjs.map +1 -1
- package/dist/app/modules/config/origins.d.ts.map +1 -1
- package/dist/app/modules/config/origins.mjs +2 -0
- package/dist/app/modules/config/origins.mjs.map +1 -1
- package/dist/app/modules/config/read/env.d.ts.map +1 -1
- package/dist/app/modules/config/read/env.mjs +10 -0
- package/dist/app/modules/config/read/env.mjs.map +1 -1
- package/dist/app/modules/config/types.d.ts +63 -3
- package/dist/app/modules/config/types.d.ts.map +1 -1
- package/dist/app/modules/config/validator.d.ts.map +1 -1
- package/dist/app/modules/config/validator.mjs +5 -0
- package/dist/app/modules/config/validator.mjs.map +1 -1
- package/dist/app/modules/http/module.d.ts.map +1 -1
- package/dist/app/modules/http/module.mjs +7 -1
- package/dist/app/modules/http/module.mjs.map +1 -1
- package/dist/app/modules/http/modules/controller.d.ts +2 -1
- package/dist/app/modules/http/modules/controller.d.ts.map +1 -1
- package/dist/app/modules/http/modules/controller.mjs +20 -5
- package/dist/app/modules/http/modules/controller.mjs.map +1 -1
- package/dist/app/modules/http/modules/middleware.d.ts +9 -1
- package/dist/app/modules/http/modules/middleware.d.ts.map +1 -1
- package/dist/app/modules/http/modules/middleware.mjs +18 -3
- package/dist/app/modules/http/modules/middleware.mjs.map +1 -1
- package/dist/app/modules/index.mjs +3 -1
- package/dist/app/modules/provisioning/constants.d.ts +12 -0
- package/dist/app/modules/provisioning/constants.d.ts.map +1 -0
- package/dist/app/modules/provisioning/constants.mjs +16 -0
- package/dist/app/modules/provisioning/constants.mjs.map +1 -0
- package/dist/app/modules/provisioning/index.d.ts +2 -0
- package/dist/app/modules/provisioning/index.d.ts.map +1 -1
- package/dist/app/modules/provisioning/index.mjs +3 -1
- package/dist/app/modules/provisioning/lazy-wildcard.d.ts +15 -0
- package/dist/app/modules/provisioning/lazy-wildcard.d.ts.map +1 -0
- package/dist/app/modules/provisioning/lazy-wildcard.mjs +23 -0
- package/dist/app/modules/provisioning/lazy-wildcard.mjs.map +1 -0
- package/dist/app/modules/provisioning/module.d.ts.map +1 -1
- package/dist/app/modules/provisioning/module.mjs +21 -3
- package/dist/app/modules/provisioning/module.mjs.map +1 -1
- package/dist/app/modules/provisioning/sources/composite/module.d.ts +0 -19
- package/dist/app/modules/provisioning/sources/composite/module.d.ts.map +1 -1
- package/dist/app/modules/provisioning/sources/composite/module.mjs +7 -77
- package/dist/app/modules/provisioning/sources/composite/module.mjs.map +1 -1
- package/dist/core/entities/client/index.d.ts +1 -1
- package/dist/core/entities/client/index.d.ts.map +1 -1
- package/dist/core/entities/client/index.mjs +2 -2
- package/dist/core/entities/client/service.mjs.map +1 -1
- package/dist/core/entities/client/system-clients.d.ts +95 -0
- package/dist/core/entities/client/system-clients.d.ts.map +1 -0
- package/dist/core/entities/client/system-clients.mjs +158 -0
- package/dist/core/entities/client/system-clients.mjs.map +1 -0
- package/dist/core/entities/client/types.d.ts +17 -4
- package/dist/core/entities/client/types.d.ts.map +1 -1
- package/dist/core/entities/index.mjs +2 -2
- package/dist/core/entities/realm/service.d.ts +8 -6
- package/dist/core/entities/realm/service.d.ts.map +1 -1
- package/dist/core/entities/realm/service.mjs +5 -8
- package/dist/core/entities/realm/service.mjs.map +1 -1
- package/dist/core/index.mjs +6 -2
- package/dist/core/key/types.d.ts +2 -1
- package/dist/core/key/types.d.ts.map +1 -1
- package/dist/core/oauth2/authorization/code-request/verifier/module.d.ts.map +1 -1
- package/dist/core/oauth2/authorization/code-request/verifier/module.mjs +2 -2
- package/dist/core/oauth2/authorization/code-request/verifier/module.mjs.map +1 -1
- package/dist/core/oauth2/end-session/service.d.ts.map +1 -1
- package/dist/core/oauth2/end-session/service.mjs +2 -2
- package/dist/core/oauth2/end-session/service.mjs.map +1 -1
- package/dist/core/provisioning/constants.d.ts +8 -0
- package/dist/core/provisioning/constants.d.ts.map +1 -0
- package/dist/core/provisioning/constants.mjs +14 -0
- package/dist/core/provisioning/constants.mjs.map +1 -0
- package/dist/core/provisioning/entities/index.mjs +2 -1
- package/dist/core/provisioning/entities/realm/index.d.ts +1 -0
- package/dist/core/provisioning/entities/realm/index.d.ts.map +1 -1
- package/dist/core/provisioning/entities/realm/index.mjs +2 -1
- package/dist/core/provisioning/entities/realm/validator.d.ts +11 -0
- package/dist/core/provisioning/entities/realm/validator.d.ts.map +1 -1
- package/dist/core/provisioning/entities/realm/validator.mjs +14 -0
- package/dist/core/provisioning/entities/realm/validator.mjs.map +1 -1
- package/dist/core/provisioning/entities/realm/wildcard-validator.d.ts +19 -0
- package/dist/core/provisioning/entities/realm/wildcard-validator.d.ts.map +1 -0
- package/dist/core/provisioning/entities/realm/wildcard-validator.mjs +65 -0
- package/dist/core/provisioning/entities/realm/wildcard-validator.mjs.map +1 -0
- package/dist/core/provisioning/index.d.ts +3 -0
- package/dist/core/provisioning/index.d.ts.map +1 -1
- package/dist/core/provisioning/index.mjs +7 -1
- package/dist/core/provisioning/merge/index.d.ts +3 -0
- package/dist/core/provisioning/merge/index.d.ts.map +1 -0
- package/dist/core/provisioning/merge/index.mjs +5 -0
- package/dist/core/provisioning/merge/module.d.ts +18 -0
- package/dist/core/provisioning/merge/module.d.ts.map +1 -0
- package/dist/core/provisioning/merge/module.mjs +82 -0
- package/dist/core/provisioning/merge/module.mjs.map +1 -0
- package/dist/core/provisioning/merge/types.d.ts +34 -0
- package/dist/core/provisioning/merge/types.d.ts.map +1 -0
- package/dist/core/provisioning/merge/types.mjs +4 -0
- package/dist/core/provisioning/types.d.ts +10 -0
- package/dist/core/provisioning/types.d.ts.map +1 -1
- package/dist/core/provisioning/wildcard/index.d.ts +3 -0
- package/dist/core/provisioning/wildcard/index.d.ts.map +1 -0
- package/dist/core/provisioning/wildcard/index.mjs +5 -0
- package/dist/core/provisioning/wildcard/module.d.ts +53 -0
- package/dist/core/provisioning/wildcard/module.d.ts.map +1 -0
- package/dist/core/provisioning/wildcard/module.mjs +91 -0
- package/dist/core/provisioning/wildcard/module.mjs.map +1 -0
- package/dist/core/provisioning/wildcard/types.d.ts +19 -0
- package/dist/core/provisioning/wildcard/types.d.ts.map +1 -0
- package/dist/core/provisioning/wildcard/types.mjs +4 -0
- package/dist/index.mjs +5 -1
- package/dist/path.d.ts +0 -2
- package/dist/path.d.ts.map +1 -1
- package/dist/path.mjs +1 -3
- package/dist/path.mjs.map +1 -1
- package/dist/swagger.json +50 -6
- package/package.json +19 -57
- package/dist/adapters/http/ui/base-path.d.ts +0 -9
- package/dist/adapters/http/ui/base-path.d.ts.map +0 -1
- package/dist/adapters/http/ui/base-path.mjs +0 -18
- package/dist/adapters/http/ui/base-path.mjs.map +0 -1
- package/dist/adapters/http/ui/internal-http-client.d.ts.map +0 -1
- package/dist/adapters/http/ui/internal-http-client.mjs.map +0 -1
- package/dist/adapters/http/ui/render.d.ts +0 -4
- package/dist/adapters/http/ui/render.d.ts.map +0 -1
- package/dist/adapters/http/ui/render.mjs +0 -63
- package/dist/adapters/http/ui/render.mjs.map +0 -1
- package/dist/adapters/http/ui/serve.d.ts.map +0 -1
- package/dist/adapters/http/ui/serve.mjs.map +0 -1
- package/dist/adapters/http/ui/types.d.ts +0 -20
- package/dist/adapters/http/ui/types.d.ts.map +0 -1
- package/dist/core/entities/client/web-client.d.ts +0 -72
- package/dist/core/entities/client/web-client.d.ts.map +0 -1
- package/dist/core/entities/client/web-client.mjs +0 -123
- package/dist/core/entities/client/web-client.mjs.map +0 -1
- package/dist/ui/client/.vite/ssr-manifest.json +0 -54974
- package/dist/ui/client/assets/asap-latin-400-normal-Dc37g3Il.woff +0 -0
- package/dist/ui/client/assets/asap-latin-400-normal-DnZ1MOsG.woff2 +0 -0
- package/dist/ui/client/assets/asap-latin-700-normal-Dqcopq14.woff +0 -0
- package/dist/ui/client/assets/asap-latin-700-normal-l2Y8pi-F.woff2 +0 -0
- package/dist/ui/client/assets/asap-latin-ext-400-normal-C-fcRdtE.woff +0 -0
- package/dist/ui/client/assets/asap-latin-ext-400-normal-DwYtpHbV.woff2 +0 -0
- package/dist/ui/client/assets/asap-latin-ext-700-normal-D00OESsZ.woff +0 -0
- package/dist/ui/client/assets/asap-latin-ext-700-normal-y8bo5aW5.woff2 +0 -0
- package/dist/ui/client/assets/asap-vietnamese-400-normal-DGyJlJLT.woff2 +0 -0
- package/dist/ui/client/assets/asap-vietnamese-400-normal-lfLaoF2x.woff +0 -0
- package/dist/ui/client/assets/asap-vietnamese-700-normal-B-e19ug5.woff +0 -0
- package/dist/ui/client/assets/asap-vietnamese-700-normal-D-SxY94i.woff2 +0 -0
- package/dist/ui/client/assets/index-BTK3GPZZ.js +0 -106
- package/dist/ui/client/assets/index-Cx_pI7BS.css +0 -2
- package/dist/ui/client/assets/nunito-cyrillic-300-normal-BPQV259B.woff2 +0 -0
- package/dist/ui/client/assets/nunito-cyrillic-300-normal-g5qSsvc0.woff +0 -0
- package/dist/ui/client/assets/nunito-cyrillic-400-normal-D1j0u8EH.woff +0 -0
- package/dist/ui/client/assets/nunito-cyrillic-400-normal-xAOo5cBP.woff2 +0 -0
- package/dist/ui/client/assets/nunito-cyrillic-600-normal-BUjmtIuu.woff +0 -0
- package/dist/ui/client/assets/nunito-cyrillic-600-normal-DJGQ2h05.woff2 +0 -0
- package/dist/ui/client/assets/nunito-cyrillic-700-normal-DP36NgGt.woff2 +0 -0
- package/dist/ui/client/assets/nunito-cyrillic-700-normal-DfHRUDv-.woff +0 -0
- package/dist/ui/client/assets/nunito-cyrillic-ext-300-normal-BDHtqmCR.woff +0 -0
- package/dist/ui/client/assets/nunito-cyrillic-ext-300-normal-ChMQLIrm.woff2 +0 -0
- package/dist/ui/client/assets/nunito-cyrillic-ext-400-normal-CuPM9foi.woff2 +0 -0
- package/dist/ui/client/assets/nunito-cyrillic-ext-400-normal-xaE7D4Sw.woff +0 -0
- package/dist/ui/client/assets/nunito-cyrillic-ext-600-normal-CWPPjBOD.woff2 +0 -0
- package/dist/ui/client/assets/nunito-cyrillic-ext-600-normal-vnfu4DTE.woff +0 -0
- package/dist/ui/client/assets/nunito-cyrillic-ext-700-normal-BuR0mlCG.woff2 +0 -0
- package/dist/ui/client/assets/nunito-cyrillic-ext-700-normal-DfoqN4Gs.woff +0 -0
- package/dist/ui/client/assets/nunito-latin-300-normal-C3ZIKvzv.woff +0 -0
- package/dist/ui/client/assets/nunito-latin-300-normal-COoPE5VN.woff2 +0 -0
- package/dist/ui/client/assets/nunito-latin-400-normal-DKg4f3fz.woff +0 -0
- package/dist/ui/client/assets/nunito-latin-400-normal-r8SDr6Up.woff2 +0 -0
- package/dist/ui/client/assets/nunito-latin-600-normal-Br8yIETf.woff2 +0 -0
- package/dist/ui/client/assets/nunito-latin-600-normal-Cd0eNu1l.woff +0 -0
- package/dist/ui/client/assets/nunito-latin-700-normal-Dort48En.woff2 +0 -0
- package/dist/ui/client/assets/nunito-latin-700-normal-OcDqTBcA.woff +0 -0
- package/dist/ui/client/assets/nunito-latin-ext-300-normal-D1SyVuPt.woff2 +0 -0
- package/dist/ui/client/assets/nunito-latin-ext-300-normal-DfqbmdMl.woff +0 -0
- package/dist/ui/client/assets/nunito-latin-ext-400-normal-CjMJVfGn.woff +0 -0
- package/dist/ui/client/assets/nunito-latin-ext-400-normal-i-8OOpdj.woff2 +0 -0
- package/dist/ui/client/assets/nunito-latin-ext-600-normal-BKUpuB78.woff +0 -0
- package/dist/ui/client/assets/nunito-latin-ext-600-normal-Dd9Zuxh1.woff2 +0 -0
- package/dist/ui/client/assets/nunito-latin-ext-700-normal-BWeMsAzO.woff2 +0 -0
- package/dist/ui/client/assets/nunito-latin-ext-700-normal-D4woHhbd.woff +0 -0
- package/dist/ui/client/assets/nunito-vietnamese-300-normal-DATld5Vw.woff +0 -0
- package/dist/ui/client/assets/nunito-vietnamese-300-normal-mLneKULB.woff2 +0 -0
- package/dist/ui/client/assets/nunito-vietnamese-400-normal-BHkVbP3T.woff2 +0 -0
- package/dist/ui/client/assets/nunito-vietnamese-400-normal-DtOtW02z.woff +0 -0
- package/dist/ui/client/assets/nunito-vietnamese-600-normal-BY8O6Cug.woff2 +0 -0
- package/dist/ui/client/assets/nunito-vietnamese-600-normal-DO1RqFw5.woff +0 -0
- package/dist/ui/client/assets/nunito-vietnamese-700-normal-C9SQsXvj.woff +0 -0
- package/dist/ui/client/assets/nunito-vietnamese-700-normal-Ch8EUCfz.woff2 +0 -0
- package/dist/ui/client/index.html +0 -22
- package/dist/ui/server/assets/multipart-parser-BCMy8Xwv.js +0 -181
- package/dist/ui/server/assets/multipart-parser-BVY8pIV2.js +0 -176
- package/dist/ui/server/server.js +0 -155269
- /package/dist/adapters/http/{ui → middleware/built-in}/types.mjs +0 -0
package/dist/app/index.mjs
CHANGED
|
@@ -57,6 +57,8 @@ import { LDAPInjectionKey } from "./modules/ldap/constants.mjs";
|
|
|
57
57
|
import { LdapModule } from "./modules/ldap/module.mjs";
|
|
58
58
|
import { IdentityModule } from "./modules/identity/module.mjs";
|
|
59
59
|
import { OAuth2Module } from "./modules/oauth2/module.mjs";
|
|
60
|
+
import { ProvisioningInjectionKey } from "./modules/provisioning/constants.mjs";
|
|
61
|
+
import { LazyWildcardRealmProvisioner } from "./modules/provisioning/lazy-wildcard.mjs";
|
|
60
62
|
import { MailInjectionKey, MailTemplateRendererInjectionKey } from "./modules/mail/constants.mjs";
|
|
61
63
|
import { MailModule } from "./modules/mail/module.mjs";
|
|
62
64
|
import { HTTPModule } from "./modules/http/module.mjs";
|
|
@@ -68,4 +70,4 @@ import { RuntimeModule } from "./modules/runtime/module.mjs";
|
|
|
68
70
|
import "./modules/index.mjs";
|
|
69
71
|
import { ApplicationBuilder } from "./builder.mjs";
|
|
70
72
|
import { createApplication } from "./factory.mjs";
|
|
71
|
-
export { ApplicationBuilder, AuthenticationInjectionKey, AuthenticationModule, CacheInjectionKey, CacheModule, ClientIdentityRepository, ClientPermissionRepositoryAdapter, ClientRepositoryAdapter, ClientRoleRepositoryAdapter, ClientScopeRepositoryAdapter, ComponentsModule, CompositeProvisioningSource, ConfigEnvironmentVariableName, ConfigInjectionKey, ConfigModule, DatabaseInjectionKey, DatabaseModule, DefaultProvisioningSource, EventRepositoryAdapter, FileProvisioningSource, HTTPInjectionKey, HTTPModule, IdentityInjectionKey, IdentityModule, IdentityProviderAccountRepository, IdentityProviderAttributeMappingRepository, IdentityProviderPermissionMappingRepository, IdentityProviderRepositoryAdapter, IdentityProviderRoleMappingRepository, IdentityProviderRoleMappingRepositoryAdapter, KeyRepositoryAdapter, LDAPInjectionKey, LdapModule, LoggerInjectionKey, LoggerModule, MailInjectionKey, MailModule, MailTemplateRendererInjectionKey, MetricsInjectionKey, ModuleName, OAuth2InjectionToken, OAuth2Module, PermissionDatabaseProvider, PermissionPolicyRepositoryAdapter, PermissionRepositoryAdapter, PolicyRepositoryAdapter, PromAuthFlowMetrics, ProvisionerModule, RealmRepositoryAdapter, RoleAttributeRepositoryAdapter, RolePermissionRepositoryAdapter, RoleRepositoryAdapter, RuntimeModule, ScopeRepositoryAdapter, SessionRepository, TrustAnchorRepositoryAdapter, UserAttributeRepositoryAdapter, UserAuthenticatorRepositoryAdapter, UserIdentityRepository, UserPermissionRepositoryAdapter, UserRepositoryAdapter, UserRoleRepositoryAdapter, createApplication, expandToOrigins, getAppOrigins, readConfig, readConfigRaw, readConfigRawFromEnv, readConfigRawFromFS };
|
|
73
|
+
export { ApplicationBuilder, AuthenticationInjectionKey, AuthenticationModule, CacheInjectionKey, CacheModule, ClientIdentityRepository, ClientPermissionRepositoryAdapter, ClientRepositoryAdapter, ClientRoleRepositoryAdapter, ClientScopeRepositoryAdapter, ComponentsModule, CompositeProvisioningSource, ConfigEnvironmentVariableName, ConfigInjectionKey, ConfigModule, DatabaseInjectionKey, DatabaseModule, DefaultProvisioningSource, EventRepositoryAdapter, FileProvisioningSource, HTTPInjectionKey, HTTPModule, IdentityInjectionKey, IdentityModule, IdentityProviderAccountRepository, IdentityProviderAttributeMappingRepository, IdentityProviderPermissionMappingRepository, IdentityProviderRepositoryAdapter, IdentityProviderRoleMappingRepository, IdentityProviderRoleMappingRepositoryAdapter, KeyRepositoryAdapter, LDAPInjectionKey, LazyWildcardRealmProvisioner, LdapModule, LoggerInjectionKey, LoggerModule, MailInjectionKey, MailModule, MailTemplateRendererInjectionKey, MetricsInjectionKey, ModuleName, OAuth2InjectionToken, OAuth2Module, PermissionDatabaseProvider, PermissionPolicyRepositoryAdapter, PermissionRepositoryAdapter, PolicyRepositoryAdapter, PromAuthFlowMetrics, ProvisionerModule, ProvisioningInjectionKey, RealmRepositoryAdapter, RoleAttributeRepositoryAdapter, RolePermissionRepositoryAdapter, RoleRepositoryAdapter, RuntimeModule, ScopeRepositoryAdapter, SessionRepository, TrustAnchorRepositoryAdapter, UserAttributeRepositoryAdapter, UserAuthenticatorRepositoryAdapter, UserIdentityRepository, UserPermissionRepositoryAdapter, UserRepositoryAdapter, UserRoleRepositoryAdapter, createApplication, expandToOrigins, getAppOrigins, readConfig, readConfigRaw, readConfigRawFromEnv, readConfigRawFromFS };
|
|
@@ -4,6 +4,10 @@ export declare const ConfigInjectionKey: TypedToken<Config>;
|
|
|
4
4
|
export declare enum ConfigEnvironmentVariableName {
|
|
5
5
|
NODE_ENV = "NODE_ENV",
|
|
6
6
|
WRITABLE_DIRECTORY_PATH = "WRITABLE_DIRECTORY_PATH",
|
|
7
|
+
THEME_DIRECTORY_PATH = "THEME_DIRECTORY_PATH",
|
|
8
|
+
THEME_FRAGMENTS_ENABLED = "THEME_FRAGMENTS_ENABLED",
|
|
9
|
+
AUTH_CONSOLE_PATH = "AUTH_CONSOLE_PATH",
|
|
10
|
+
ACCOUNT_CONSOLE_PATH = "ACCOUNT_CONSOLE_PATH",
|
|
7
11
|
REDIS = "REDIS",
|
|
8
12
|
SMTP = "SMTP",
|
|
9
13
|
HOST = "HOST",
|
|
@@ -22,6 +26,7 @@ export declare enum ConfigEnvironmentVariableName {
|
|
|
22
26
|
EMAIL_VERIFICATION_ENABLED = "EMAIL_VERIFICATION_ENABLED",
|
|
23
27
|
PASSWORD_RECOVERY_ENABLED = "PASSWORD_RECOVERY_ENABLED",
|
|
24
28
|
PASSWORD_MIN_LENGTH = "PASSWORD_MIN_LENGTH",
|
|
29
|
+
ACCOUNT_CONSOLE_ENABLED = "ACCOUNT_CONSOLE_ENABLED",
|
|
25
30
|
EVENT_LOG_ENABLED = "EVENT_LOG_ENABLED",
|
|
26
31
|
EVENT_LOG_RETENTION_DAYS = "EVENT_LOG_RETENTION_DAYS",
|
|
27
32
|
EVENT_LOG_ENTITY_ENABLED = "EVENT_LOG_ENTITY_ENABLED",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/app/modules/config/constants.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC,eAAO,MAAM,kBAAkB,oBAAmC,CAAC;AAEnE,oBAAY,6BAA6B;IACrC,QAAQ,aAAa;IACrB,uBAAuB,4BAA4B;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/app/modules/config/constants.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC,eAAO,MAAM,kBAAkB,oBAAmC,CAAC;AAEnE,oBAAY,6BAA6B;IACrC,QAAQ,aAAa;IACrB,uBAAuB,4BAA4B;IACnD,oBAAoB,yBAAyB;IAC7C,uBAAuB,4BAA4B;IACnD,iBAAiB,sBAAsB;IACvC,oBAAoB,yBAAyB;IAE7C,KAAK,UAAU;IACf,IAAI,SAAS;IAEb,IAAI,SAAS;IACb,IAAI,SAAS;IACb,UAAU,eAAe;IACzB,eAAe,oBAAoB;IACnC,kBAAkB,uBAAuB;IACzC,WAAW,gBAAgB;IAC3B,eAAe,oBAAoB;IACnC,oBAAoB,yBAAyB;IAC7C,qBAAqB,0BAA0B;IAC/C,0BAA0B,+BAA+B;IACzD,oBAAoB,yBAAyB;IAC7C,6BAA6B,kCAAkC;IAC/D,oBAAoB,yBAAyB;IAC7C,0BAA0B,+BAA+B;IACzD,yBAAyB,8BAA8B;IACvD,mBAAmB,wBAAwB;IAC3C,uBAAuB,4BAA4B;IAEnD,iBAAiB,sBAAsB;IACvC,wBAAwB,6BAA6B;IACrD,wBAAwB,6BAA6B;IACrD,+BAA+B,oCAAoC;IACnE,8BAA8B,mCAAmC;IACjE,uBAAuB,4BAA4B;IACnD,oBAAoB,yBAAyB;IAE7C,sBAAsB,2BAA2B;IAEjD,WAAW,gBAAgB;IAC3B,YAAY,iBAAiB;IAC7B,qBAAqB,0BAA0B;IAC/C,kBAAkB,uBAAuB;IAEzC,iBAAiB,sBAAsB;IACvC,qBAAqB,0BAA0B;IAC/C,oBAAoB,yBAAyB;IAC7C,0BAA0B,+BAA+B;IAEzD,eAAe,oBAAoB;IACnC,kBAAkB,uBAAuB;IACzC,mBAAmB,wBAAwB;IAC3C,yBAAyB,8BAA8B;IAEvD,WAAW,gBAAgB;IAC3B,qCAAqC,0CAA0C;CAClF"}
|
|
@@ -7,6 +7,10 @@ const ConfigInjectionKey = new TypedToken("Config");
|
|
|
7
7
|
var ConfigEnvironmentVariableName = /*#__PURE__*/ function(ConfigEnvironmentVariableName) {
|
|
8
8
|
ConfigEnvironmentVariableName["NODE_ENV"] = "NODE_ENV";
|
|
9
9
|
ConfigEnvironmentVariableName["WRITABLE_DIRECTORY_PATH"] = "WRITABLE_DIRECTORY_PATH";
|
|
10
|
+
ConfigEnvironmentVariableName["THEME_DIRECTORY_PATH"] = "THEME_DIRECTORY_PATH";
|
|
11
|
+
ConfigEnvironmentVariableName["THEME_FRAGMENTS_ENABLED"] = "THEME_FRAGMENTS_ENABLED";
|
|
12
|
+
ConfigEnvironmentVariableName["AUTH_CONSOLE_PATH"] = "AUTH_CONSOLE_PATH";
|
|
13
|
+
ConfigEnvironmentVariableName["ACCOUNT_CONSOLE_PATH"] = "ACCOUNT_CONSOLE_PATH";
|
|
10
14
|
ConfigEnvironmentVariableName["REDIS"] = "REDIS";
|
|
11
15
|
ConfigEnvironmentVariableName["SMTP"] = "SMTP";
|
|
12
16
|
ConfigEnvironmentVariableName["HOST"] = "HOST";
|
|
@@ -25,6 +29,7 @@ var ConfigEnvironmentVariableName = /*#__PURE__*/ function(ConfigEnvironmentVari
|
|
|
25
29
|
ConfigEnvironmentVariableName["EMAIL_VERIFICATION_ENABLED"] = "EMAIL_VERIFICATION_ENABLED";
|
|
26
30
|
ConfigEnvironmentVariableName["PASSWORD_RECOVERY_ENABLED"] = "PASSWORD_RECOVERY_ENABLED";
|
|
27
31
|
ConfigEnvironmentVariableName["PASSWORD_MIN_LENGTH"] = "PASSWORD_MIN_LENGTH";
|
|
32
|
+
ConfigEnvironmentVariableName["ACCOUNT_CONSOLE_ENABLED"] = "ACCOUNT_CONSOLE_ENABLED";
|
|
28
33
|
ConfigEnvironmentVariableName["EVENT_LOG_ENABLED"] = "EVENT_LOG_ENABLED";
|
|
29
34
|
ConfigEnvironmentVariableName["EVENT_LOG_RETENTION_DAYS"] = "EVENT_LOG_RETENTION_DAYS";
|
|
30
35
|
ConfigEnvironmentVariableName["EVENT_LOG_ENTITY_ENABLED"] = "EVENT_LOG_ENTITY_ENABLED";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.mjs","names":["TypedToken","ConfigInjectionKey","ConfigEnvironmentVariableName"],"sources":["../../../../src/app/modules/config/constants.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 { TypedToken } from 'eldin';\nimport type { Config } from './types.ts';\n\nexport const ConfigInjectionKey = new TypedToken<Config>('Config');\n\nexport enum ConfigEnvironmentVariableName {\n NODE_ENV = 'NODE_ENV',\n WRITABLE_DIRECTORY_PATH = 'WRITABLE_DIRECTORY_PATH',\n\n REDIS = 'REDIS',\n SMTP = 'SMTP',\n\n HOST = 'HOST',\n PORT = 'PORT',\n PUBLIC_URL = 'PUBLIC_URL',\n MTLS_PUBLIC_URL = 'MTLS_PUBLIC_URL',\n CERTIFICATE_SOURCE = 'CERTIFICATE_SOURCE',\n TRUST_PROXY = 'TRUST_PROXY',\n TRUSTED_ORIGINS = 'TRUSTED_ORIGINS',\n TOKEN_ACCESS_MAX_AGE = 'TOKEN_ACCESS_MAX_AGE',\n TOKEN_REFRESH_MAX_AGE = 'TOKEN_REFRESH_MAX_AGE',\n TOKEN_REFRESH_GRACE_PERIOD = 'TOKEN_REFRESH_GRACE_PERIOD',\n PROMPT_LOGIN_MAX_AGE = 'PROMPT_LOGIN_MAX_AGE',\n END_SESSION_HINT_GRACE_PERIOD = 'END_SESSION_HINT_GRACE_PERIOD',\n REGISTRATION_ENABLED = 'REGISTRATION_ENABLED',\n EMAIL_VERIFICATION_ENABLED = 'EMAIL_VERIFICATION_ENABLED',\n PASSWORD_RECOVERY_ENABLED = 'PASSWORD_RECOVERY_ENABLED',\n PASSWORD_MIN_LENGTH = 'PASSWORD_MIN_LENGTH',\n\n EVENT_LOG_ENABLED = 'EVENT_LOG_ENABLED',\n EVENT_LOG_RETENTION_DAYS = 'EVENT_LOG_RETENTION_DAYS',\n EVENT_LOG_ENTITY_ENABLED = 'EVENT_LOG_ENTITY_ENABLED',\n EVENT_LOG_ENTITY_RETENTION_DAYS = 'EVENT_LOG_ENTITY_RETENTION_DAYS',\n LOGIN_ATTEMPT_THROTTLE_ENABLED = 'LOGIN_ATTEMPT_THROTTLE_ENABLED',\n LOGIN_ATTEMPT_THRESHOLD = 'LOGIN_ATTEMPT_THRESHOLD',\n LOGIN_ATTEMPT_WINDOW = 'LOGIN_ATTEMPT_WINDOW',\n\n SECRETS_ENCRYPTION_KEY = 'SECRETS_ENCRYPTION_KEY',\n\n MFA_ENABLED = 'MFA_ENABLED',\n MFA_REQUIRED = 'MFA_REQUIRED',\n MFA_FRESHNESS_MAX_AGE = 'MFA_FRESHNESS_MAX_AGE',\n MFA_TICKET_MAX_AGE = 'MFA_TICKET_MAX_AGE',\n\n CLIENT_AUTH_BASIC = 'CLIENT_AUTH_BASIC',\n CLIENT_SYSTEM_ENABLED = 'CLIENT_SYSTEM_ENABLED',\n CLIENT_SYSTEM_SECRET = 'CLIENT_SYSTEM_SECRET',\n CLIENT_SYSTEM_SECRET_RESET = 'CLIENT_SYSTEM_SECRET_RESET',\n\n USER_AUTH_BASIC = 'USER_AUTH_BASIC',\n USER_ADMIN_ENABLED = 'USER_ADMIN_ENABLED',\n USER_ADMIN_PASSWORD = 'USER_ADMIN_PASSWORD',\n USER_ADMIN_PASSWORD_RESET = 'USER_ADMIN_PASSWORD_RESET',\n\n PERMISSIONS = 'PERMISSIONS',\n PERMISSIONS_DEFAULT_POLICY_ASSIGNMENT = 'PERMISSIONS_DEFAULT_POLICY_ASSIGNMENT',\n}\n"],"mappings":";;;;;AAUA,MAAaC,qBAAqB,IAAID,WAAmB,QAAA;AAEzD,IAAO,gCAAKE,uBAAAA,+BAAAA
|
|
1
|
+
{"version":3,"file":"constants.mjs","names":["TypedToken","ConfigInjectionKey","ConfigEnvironmentVariableName"],"sources":["../../../../src/app/modules/config/constants.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 { TypedToken } from 'eldin';\nimport type { Config } from './types.ts';\n\nexport const ConfigInjectionKey = new TypedToken<Config>('Config');\n\nexport enum ConfigEnvironmentVariableName {\n NODE_ENV = 'NODE_ENV',\n WRITABLE_DIRECTORY_PATH = 'WRITABLE_DIRECTORY_PATH',\n THEME_DIRECTORY_PATH = 'THEME_DIRECTORY_PATH',\n THEME_FRAGMENTS_ENABLED = 'THEME_FRAGMENTS_ENABLED',\n AUTH_CONSOLE_PATH = 'AUTH_CONSOLE_PATH',\n ACCOUNT_CONSOLE_PATH = 'ACCOUNT_CONSOLE_PATH',\n\n REDIS = 'REDIS',\n SMTP = 'SMTP',\n\n HOST = 'HOST',\n PORT = 'PORT',\n PUBLIC_URL = 'PUBLIC_URL',\n MTLS_PUBLIC_URL = 'MTLS_PUBLIC_URL',\n CERTIFICATE_SOURCE = 'CERTIFICATE_SOURCE',\n TRUST_PROXY = 'TRUST_PROXY',\n TRUSTED_ORIGINS = 'TRUSTED_ORIGINS',\n TOKEN_ACCESS_MAX_AGE = 'TOKEN_ACCESS_MAX_AGE',\n TOKEN_REFRESH_MAX_AGE = 'TOKEN_REFRESH_MAX_AGE',\n TOKEN_REFRESH_GRACE_PERIOD = 'TOKEN_REFRESH_GRACE_PERIOD',\n PROMPT_LOGIN_MAX_AGE = 'PROMPT_LOGIN_MAX_AGE',\n END_SESSION_HINT_GRACE_PERIOD = 'END_SESSION_HINT_GRACE_PERIOD',\n REGISTRATION_ENABLED = 'REGISTRATION_ENABLED',\n EMAIL_VERIFICATION_ENABLED = 'EMAIL_VERIFICATION_ENABLED',\n PASSWORD_RECOVERY_ENABLED = 'PASSWORD_RECOVERY_ENABLED',\n PASSWORD_MIN_LENGTH = 'PASSWORD_MIN_LENGTH',\n ACCOUNT_CONSOLE_ENABLED = 'ACCOUNT_CONSOLE_ENABLED',\n\n EVENT_LOG_ENABLED = 'EVENT_LOG_ENABLED',\n EVENT_LOG_RETENTION_DAYS = 'EVENT_LOG_RETENTION_DAYS',\n EVENT_LOG_ENTITY_ENABLED = 'EVENT_LOG_ENTITY_ENABLED',\n EVENT_LOG_ENTITY_RETENTION_DAYS = 'EVENT_LOG_ENTITY_RETENTION_DAYS',\n LOGIN_ATTEMPT_THROTTLE_ENABLED = 'LOGIN_ATTEMPT_THROTTLE_ENABLED',\n LOGIN_ATTEMPT_THRESHOLD = 'LOGIN_ATTEMPT_THRESHOLD',\n LOGIN_ATTEMPT_WINDOW = 'LOGIN_ATTEMPT_WINDOW',\n\n SECRETS_ENCRYPTION_KEY = 'SECRETS_ENCRYPTION_KEY',\n\n MFA_ENABLED = 'MFA_ENABLED',\n MFA_REQUIRED = 'MFA_REQUIRED',\n MFA_FRESHNESS_MAX_AGE = 'MFA_FRESHNESS_MAX_AGE',\n MFA_TICKET_MAX_AGE = 'MFA_TICKET_MAX_AGE',\n\n CLIENT_AUTH_BASIC = 'CLIENT_AUTH_BASIC',\n CLIENT_SYSTEM_ENABLED = 'CLIENT_SYSTEM_ENABLED',\n CLIENT_SYSTEM_SECRET = 'CLIENT_SYSTEM_SECRET',\n CLIENT_SYSTEM_SECRET_RESET = 'CLIENT_SYSTEM_SECRET_RESET',\n\n USER_AUTH_BASIC = 'USER_AUTH_BASIC',\n USER_ADMIN_ENABLED = 'USER_ADMIN_ENABLED',\n USER_ADMIN_PASSWORD = 'USER_ADMIN_PASSWORD',\n USER_ADMIN_PASSWORD_RESET = 'USER_ADMIN_PASSWORD_RESET',\n\n PERMISSIONS = 'PERMISSIONS',\n PERMISSIONS_DEFAULT_POLICY_ASSIGNMENT = 'PERMISSIONS_DEFAULT_POLICY_ASSIGNMENT',\n}\n"],"mappings":";;;;;AAUA,MAAaC,qBAAqB,IAAID,WAAmB,QAAA;AAEzD,IAAO,gCAAKE,uBAAAA,+BAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAAA,OAAAA;AAwDX,EAAA,CAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../../../src/app/modules/config/normalize.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEtD,wBAAsB,eAAe,CAAC,KAAK,GAAE,WAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../../../src/app/modules/config/normalize.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEtD,wBAAsB,eAAe,CAAC,KAAK,GAAE,WAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CA0L9E"}
|
|
@@ -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,QAAQnB,gBAAgB0B,YAAY;EACpC,MAAMC,YAAY;EAClB,IAAI,CAACN,eAAeG,SAASG,SAAAA,GACzBN,eAAeI,KAAKE,SAAAA;CAE5B;CAEA,MAA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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;EACpBC,uBAAuB;EACvBC,iBAAiB;EACjBC,oBAAoB;EAEpBC,QAAQ;EACRC,OAAO;EACPC,MAAM;EAENtB;EACAC;EACAC;EACAqB,eAAe;EACfC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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":"
|
|
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","
|
|
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,
|
|
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;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;CAKpC,IAAIpB,wBAAAA,GAEAiB,QAAQK,KAAKrB,6BAAAA;CAKjB,MAAMsB,QAAQ5B,MAAM,C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AkB;CAClF,IAAI,OAAOD,qBAAqB,aAC5BlF,QAAQkF,mBAAmBA;CAG/B,MAAME,oBAAoBzG,KAAKM,8BAA8BoG,mBAAmB;CAChF,IAAID,mBACApF,QAAQoF,oBAAoBA;CAGhC,MAAME,yBAAyBzG,SAASI,8BAA8BsG,yBAAyB;CAC/F,IAAI,OAAOD,2BAA2B,aAClCtF,QAAQsF,yBAAyBA;CAKrC,MAAME,cAAc5G,UAAUK,8BAA8BwG,WAAW;CACvE,IAAID,eAAeA,YAAY/F,SAAS,GACpCO,QAAQwF,cAAcA;CAG1B,MAAME,qCAAqC7G,SAASI,8BAA8B0G,qCAAqC;CACvH,IAAI,OAAOD,uCAAuC,aAC9C1F,QAAQ0F,qCAAqCA;CAGjD,OAAO1F;AACX"}
|
|
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","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,IA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,QAAQoG,qCAAqCA;CAGjD,OAAOpG;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
|
|
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
|
|
155
|
+
* no path); each is stored as `<origin>/**` in the system clients'
|
|
103
156
|
* redirect_uri set.
|
|
104
157
|
*
|
|
105
|
-
* SECURITY: the
|
|
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,KAAK,EAAE,YAAY,IAAI,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,KAAK,EAAE,YAAY,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,KAAK,EAAE,SAAS,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,KAAK,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAEjF,MAAM,MA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,aAAa,EAAE,OAAO,CAAC;IAEvB;;;OAGG;IACH,gBAAgB,EAAE,OAAO,CAAC;IAE1B;;;OAGG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACH,sBAAsB,EAAE,OAAO,CAAC;IAIhC;;OAEG;IACH,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE/B;;;;;;OAMG;IACH,kCAAkC,EAAE,OAAO,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAE1C,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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,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,KAA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jBuD,uBAAuBrD;GACvBsD,uBAAuBxD;GACvByD,6BAA6BvD;GAC7BwD,6BAA6B1D;GAC7B2D,uBAAuBrE,gBAAgBE,EAAEW,OAAM,CAAA,CAAG8B,IAAG,CAAA,CAAGoB,SAAQ,CAAA;GAChEO,oBAAoBtE,gBAAgBE,EAAEW,OAAM,CAAA,CAAG8B,IAAG,CAAA,CAAGoB,SAAQ,CAAA;GAI7DQ,sBAAsBvE,gBAAgBE,EAAEwC,MAAM,CAACxC,EAAEsE,QAAQ,EAAA,GAAKtE,EAAEuE,OAAM,CAAG,CAAA,CAAA;GAEzEC,YAAYhE;GACZiE,aAAajE;GACbkE,oBAAoBhE;GACpBiE,iBAAiB7E,gBAAgBE,EAAEW,OAAM,CAAA,CAAG8B,IAAG,CAAA,CAAGoB,SAAQ,CAAA;GAE1De,iBAAiBpE;GACjBqE,qBAAqBrE;GACrBsE,oBAAoBjE;GACpBkE,yBAAyBvE;GAEzBwE,eAAexE;GACfyE,kBAAkBzE;GAClB0E,mBAAmBrE;GACnBsE,wBAAwB3E;GAExB4E,aAAatF,gBACTE,EAAEO,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,c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":"module.d.ts","sourceRoot":"","sources":["../../../../src/app/modules/http/module.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAIrC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAGhF,qBAAa,UAAW,YAAW,OAAO;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,CAAC;IAEhC,SAAS,CAAC,QAAQ,EAAG,UAAU,GAAG,SAAS,CAAC;IAE5C,SAAS,CAAC,UAAU,EAAG,oBAAoB,CAAC;IAE5C,SAAS,CAAC,UAAU,EAAG,oBAAoB,CAAC;IAE5C,SAAS,CAAC,sBAAsB,EAAG,OAAO,CAAC;;IAYrC,KAAK,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IA4DjD;;;;;;;OAOG;IACH,SAAS,CAAC,oBAAoB,CAAC,SAAS,EAAE,UAAU,GAAG,IAAI;IA+B3D;;;;;;OAMG;IACH,SAAS,CAAC,eAAe,CAAC,SAAS,EAAE,UAAU,GAAG,IAAI;IAehD,QAAQ,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CAiBvD"}
|
|
@@ -9,7 +9,8 @@ import "../config/index.mjs";
|
|
|
9
9
|
import { LoggerInjectionKey } from "../logger/constants.mjs";
|
|
10
10
|
import "../logger/index.mjs";
|
|
11
11
|
import { HTTPInjectionKey } from "./constants.mjs";
|
|
12
|
-
import { createInternalUIHttpClient } from "../../../adapters/http/ui/
|
|
12
|
+
import { createInternalUIHttpClient } from "../../../adapters/http/ui/auth-console/http-client.mjs";
|
|
13
|
+
import { bindConsolePackages } from "../../../adapters/http/ui/console-packages/module.mjs";
|
|
13
14
|
import "../../../adapters/http/ui/index.mjs";
|
|
14
15
|
import { MetricsInjectionKey } from "../metrics/constants.mjs";
|
|
15
16
|
import { PromAuthFlowMetrics } from "../metrics/prom.mjs";
|
|
@@ -52,6 +53,10 @@ var HTTPModule = class {
|
|
|
52
53
|
} catch (e) {
|
|
53
54
|
throw new AuthupError(`Invalid trustProxy (TRUST_PROXY) configuration: ${e instanceof Error ? e.message : String(e)}`);
|
|
54
55
|
}
|
|
56
|
+
await bindConsolePackages({
|
|
57
|
+
authConsolePath: config.authConsolePath,
|
|
58
|
+
accountConsolePath: config.accountConsolePath
|
|
59
|
+
});
|
|
55
60
|
this.registerUIHttpClient(container);
|
|
56
61
|
this.registerMetrics(container);
|
|
57
62
|
await this.middleware.mountBefore(router, container);
|
|
@@ -106,6 +111,7 @@ var HTTPModule = class {
|
|
|
106
111
|
this.uiHttpClientRegistered = false;
|
|
107
112
|
}
|
|
108
113
|
container.unregister(MetricsInjectionKey);
|
|
114
|
+
await this.middleware.teardown();
|
|
109
115
|
if (!this.instance) return;
|
|
110
116
|
container.unregister(HTTPInjectionKey.Server);
|
|
111
117
|
await this.instance.close();
|