@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
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
import { PACKAGE_PATH } from "../../../../path.mjs";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import { locateUpSync } from "locter";
|
|
7
|
+
import fs from "node:fs";
|
|
8
|
+
//#region src/adapters/http/ui/auth-console/resolve.ts
|
|
9
|
+
let cachedPackagePath;
|
|
10
|
+
let cachedDistPath;
|
|
11
|
+
let overridePackagePath;
|
|
12
|
+
/**
|
|
13
|
+
* Point the resolution at a substituted package (config `authConsolePath`)
|
|
14
|
+
* instead of the node_modules walk. Called once at boot.
|
|
15
|
+
*/ function setAuthConsolePackagePath(value) {
|
|
16
|
+
overridePackagePath = value || void 0;
|
|
17
|
+
cachedPackagePath = void 0;
|
|
18
|
+
cachedDistPath = void 0;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Locate the auth console package. The SSR auth workflow UI ships as
|
|
22
|
+
* `@authup/client-auth-console` (a server-core dependency), so the
|
|
23
|
+
* node_modules ancestor walk from server-core's own package root (locter's
|
|
24
|
+
* `locateUp`) finds it for the workspace (symlink onto
|
|
25
|
+
* apps/client-auth-console) and for a published install alike. Only a
|
|
26
|
+
* positive result is cached.
|
|
27
|
+
*/ function resolveAuthConsolePackagePath() {
|
|
28
|
+
if (cachedPackagePath) return cachedPackagePath;
|
|
29
|
+
if (overridePackagePath) {
|
|
30
|
+
cachedPackagePath = overridePackagePath;
|
|
31
|
+
return cachedPackagePath;
|
|
32
|
+
}
|
|
33
|
+
const manifest = locateUpSync("node_modules/@authup/client-auth-console/package.json", { cwd: PACKAGE_PATH });
|
|
34
|
+
if (manifest) cachedPackagePath = manifest.directory;
|
|
35
|
+
return cachedPackagePath;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Locate the BUILT auth console bundle (`dist/client` template + assets,
|
|
39
|
+
* `dist/server/server.js` render entry). Only a positive result is cached —
|
|
40
|
+
* a dev building the package after boot is picked up on the next request.
|
|
41
|
+
*/ function resolveAuthConsoleDistPath() {
|
|
42
|
+
if (cachedDistPath) return cachedDistPath;
|
|
43
|
+
const packagePath = resolveAuthConsolePackagePath();
|
|
44
|
+
if (packagePath) {
|
|
45
|
+
const distPath = path.join(packagePath, "dist");
|
|
46
|
+
if (fs.existsSync(path.join(distPath, "client", "index.html"))) cachedDistPath = distPath;
|
|
47
|
+
}
|
|
48
|
+
return cachedDistPath;
|
|
49
|
+
}
|
|
50
|
+
//#endregion
|
|
51
|
+
export { resolveAuthConsoleDistPath, resolveAuthConsolePackagePath, setAuthConsolePackagePath };
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=resolve.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.mjs","names":["locateUpSync","fs","path","PACKAGE_PATH","cachedPackagePath","cachedDistPath","overridePackagePath","setAuthConsolePackagePath","value","undefined","resolveAuthConsolePackagePath","manifest","cwd","directory","resolveAuthConsoleDistPath","packagePath","distPath","join","existsSync"],"sources":["../../../../../src/adapters/http/ui/auth-console/resolve.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 { locateUpSync } from 'locter';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport { PACKAGE_PATH } from '../../../../path.ts';\n\nlet cachedPackagePath: string | undefined;\nlet cachedDistPath: string | undefined;\nlet overridePackagePath: string | undefined;\n\n/**\n * Point the resolution at a substituted package (config `authConsolePath`)\n * instead of the node_modules walk. Called once at boot.\n */\nexport function setAuthConsolePackagePath(value: string | undefined) : void {\n overridePackagePath = value || undefined;\n cachedPackagePath = undefined;\n cachedDistPath = undefined;\n}\n\n/**\n * Locate the auth console package. The SSR auth workflow UI ships as\n * `@authup/client-auth-console` (a server-core dependency), so the\n * node_modules ancestor walk from server-core's own package root (locter's\n * `locateUp`) finds it for the workspace (symlink onto\n * apps/client-auth-console) and for a published install alike. Only a\n * positive result is cached.\n */\nexport function resolveAuthConsolePackagePath() : string | undefined {\n if (cachedPackagePath) {\n return cachedPackagePath;\n }\n\n if (overridePackagePath) {\n cachedPackagePath = overridePackagePath;\n\n return cachedPackagePath;\n }\n\n const manifest = locateUpSync(\n 'node_modules/@authup/client-auth-console/package.json',\n { cwd: PACKAGE_PATH },\n );\n if (manifest) {\n cachedPackagePath = manifest.directory;\n }\n\n return cachedPackagePath;\n}\n\n/**\n * Locate the BUILT auth console bundle (`dist/client` template + assets,\n * `dist/server/server.js` render entry). Only a positive result is cached —\n * a dev building the package after boot is picked up on the next request.\n */\nexport function resolveAuthConsoleDistPath() : string | undefined {\n if (cachedDistPath) {\n return cachedDistPath;\n }\n\n const packagePath = resolveAuthConsolePackagePath();\n if (packagePath) {\n const distPath = path.join(packagePath, 'dist');\n\n if (fs.existsSync(path.join(distPath, 'client', 'index.html'))) {\n cachedDistPath = distPath;\n }\n }\n\n return cachedDistPath;\n}\n"],"mappings":";;;;;;;;AAYA,IAAII;AACJ,IAAIC;AACJ,IAAIC;;;;GAMJ,SAAgBC,0BAA0BC,OAAyB;CAC/DF,sBAAsBE,SAASC,KAAAA;CAC/BL,oBAAoBK,KAAAA;CACpBJ,iBAAiBI,KAAAA;AACrB;;;;;;;;GAUA,SAAgBC,gCAAAA;CACZ,IAAIN,mBACA,OAAOA;CAGX,IAAIE,qBAAqB;EACrBF,oBAAoBE;EAEpB,OAAOF;CACX;CAEA,MAAMO,WAAWX,aACb,yDACA,EAAEY,KAAKT,aAAa,CAAA;CAExB,IAAIQ,UACAP,oBAAoBO,SAASE;CAGjC,OAAOT;AACX;;;;;GAOA,SAAgBU,6BAAAA;CACZ,IAAIT,gBACA,OAAOA;CAGX,MAAMU,cAAcL,8BAAAA;CACpB,IAAIK,aAAa;EACb,MAAMC,WAAWd,KAAKe,KAAKF,aAAa,MAAA;EAExC,IAAId,GAAGiB,WAAWhB,KAAKe,KAAKD,UAAU,UAAU,YAAA,CAAA,GAC5CX,iBAAiBW;CAEzB;CAEA,OAAOX;AACX"}
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
import type { StatusResponseFeatures } from '@authup/core-http-kit';
|
|
2
1
|
import type { IAppEvent } from 'routup';
|
|
3
|
-
|
|
4
|
-
url: string;
|
|
5
|
-
baseURL: string;
|
|
6
|
-
features: StatusResponseFeatures;
|
|
7
|
-
realmAware?: boolean;
|
|
8
|
-
tokenAware?: boolean;
|
|
9
|
-
};
|
|
2
|
+
import type { ServeWorkflowPageOptions } from './types.ts';
|
|
10
3
|
/**
|
|
11
4
|
* Single SSR payload-assembly path for the auth workflow GET routes:
|
|
12
5
|
* whitelists query params, applies the open-redirect guard, and renders.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/http/ui/auth-console/serve.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAGxC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAE3D;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC7B,KAAK,EAAE,SAAS,EAChB,OAAO,EAAE,wBAAwB,GAClC,OAAO,CAAC,MAAM,CAAC,CAwBjB"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "node:path";
|
|
2
2
|
import "node:url";
|
|
3
3
|
import.meta.url;
|
|
4
|
-
import { sanitizeRelativeRedirect } from "
|
|
5
|
-
import "
|
|
6
|
-
import {
|
|
4
|
+
import { sanitizeRelativeRedirect } from "../../request/helpers/redirect.mjs";
|
|
5
|
+
import "../../request/index.mjs";
|
|
6
|
+
import { renderAuthConsolePage } from "./module.mjs";
|
|
7
7
|
import { useRequestQuery } from "@routup/basic/query";
|
|
8
|
-
//#region src/adapters/http/ui/serve.ts
|
|
8
|
+
//#region src/adapters/http/ui/auth-console/serve.ts
|
|
9
9
|
/**
|
|
10
10
|
* Single SSR payload-assembly path for the auth workflow GET routes:
|
|
11
11
|
* whitelists query params, applies the open-redirect guard, and renders.
|
|
@@ -21,7 +21,7 @@ import { useRequestQuery } from "@routup/basic/query";
|
|
|
21
21
|
data.realmId = typeof realmId === "string" ? realmId : void 0;
|
|
22
22
|
}
|
|
23
23
|
if (options.tokenAware) data.token = typeof query.token === "string" ? query.token : void 0;
|
|
24
|
-
return
|
|
24
|
+
return renderAuthConsolePage(event, {
|
|
25
25
|
url: options.url,
|
|
26
26
|
payload: {
|
|
27
27
|
config: { baseURL: options.baseURL },
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serve.mjs","names":["useRequestQuery","sanitizeRelativeRedirect","renderAuthConsolePage","serveWorkflowPage","event","options","query","data","features","redirect","realmAware","realmId","realm_id","undefined","tokenAware","token","url","payload","config","baseURL"],"sources":["../../../../../src/adapters/http/ui/auth-console/serve.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 { useRequestQuery } from '@routup/basic/query';\nimport type { IAppEvent } from 'routup';\nimport { sanitizeRelativeRedirect } from '../../request/index.ts';\nimport { renderAuthConsolePage } from './module.ts';\nimport type { ServeWorkflowPageOptions } from './types.ts';\n\n/**\n * Single SSR payload-assembly path for the auth workflow GET routes:\n * whitelists query params, applies the open-redirect guard, and renders.\n * Keeps the four workflow controllers as thin POST adapters.\n */\nexport function serveWorkflowPage(\n event: IAppEvent,\n options: ServeWorkflowPageOptions,\n): Promise<string> {\n const query = useRequestQuery(event);\n\n const data: Record<string, any> = {\n features: options.features,\n redirect: sanitizeRelativeRedirect(query.redirect),\n };\n\n if (options.realmAware) {\n const realmId = typeof query.realmId === 'string' ? query.realmId : query.realm_id;\n data.realmId = typeof realmId === 'string' ? realmId : undefined;\n }\n\n if (options.tokenAware) {\n data.token = typeof query.token === 'string' ? query.token : undefined;\n }\n\n return renderAuthConsolePage(event, {\n url: options.url,\n payload: {\n config: { baseURL: options.baseURL },\n data,\n },\n });\n}\n"],"mappings":";;;;;;;;;;;;GAkBA,SAAgBG,kBACZC,OACAC,SAAiC;CAEjC,MAAMC,QAAQN,gBAAgBI,KAAAA;CAE9B,MAAMG,OAA4B;EAC9BC,UAAUH,QAAQG;EAClBC,UAAUR,yBAAyBK,MAAMG,QAAQ;CACrD;CAEA,IAAIJ,QAAQK,YAAY;EACpB,MAAMC,UAAU,OAAOL,MAAMK,YAAY,WAAWL,MAAMK,UAAUL,MAAMM;EAC1EL,KAAKI,UAAU,OAAOA,YAAY,WAAWA,UAAUE,KAAAA;CAC3D;CAEA,IAAIR,QAAQS,YACRP,KAAKQ,QAAQ,OAAOT,MAAMS,UAAU,WAAWT,MAAMS,QAAQF,KAAAA;CAGjE,OAAOX,sBAAsBE,OAAO;EAChCY,KAAKX,QAAQW;EACbC,SAAS;GACLC,QAAQ,EAAEC,SAASd,QAAQc,QAAQ;GACnCZ;EACJ;CACJ,CAAA;AACJ"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { HydrationPayload } from '@authup/client-auth-console';
|
|
2
|
+
import type { StatusResponseFeatures } from '@authup/core-http-kit';
|
|
3
|
+
export type AuthConsoleRenderContext = {
|
|
4
|
+
url: string;
|
|
5
|
+
payload: HydrationPayload;
|
|
6
|
+
};
|
|
7
|
+
export type ServeWorkflowPageOptions = {
|
|
8
|
+
url: string;
|
|
9
|
+
baseURL: string;
|
|
10
|
+
features: StatusResponseFeatures;
|
|
11
|
+
realmAware?: boolean;
|
|
12
|
+
tokenAware?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export type InternalUIHttpClientContext = {
|
|
15
|
+
/**
|
|
16
|
+
* The public base URL (config `publicUrl`) — stays the client's
|
|
17
|
+
* `baseURL` so URLs rendered into the HTML remain user-facing.
|
|
18
|
+
*/
|
|
19
|
+
publicURL: string;
|
|
20
|
+
/**
|
|
21
|
+
* The server's own listen address (e.g. http://localhost:3010/) —
|
|
22
|
+
* where the transport actually dispatches requests.
|
|
23
|
+
*/
|
|
24
|
+
internalURL: string;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/http/ui/auth-console/types.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAEpE,MAAM,MAAM,wBAAwB,GAAG;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,gBAAgB,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,sBAAsB,CAAC;IAIjC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACtC;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;CACvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/http/ui/console-packages/index.ts"],"names":[],"mappings":"AAOA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ConsolePackageOptions } from './types.ts';
|
|
2
|
+
/**
|
|
3
|
+
* The render-contract version server-core compiles against. Must match the
|
|
4
|
+
* `CONTRACT_VERSION` the auth console bundle exports.
|
|
5
|
+
*
|
|
6
|
+
* Bump alongside `apps/client-auth-console/src/contract.ts` whenever a
|
|
7
|
+
* change breaks a package built against the previous shape.
|
|
8
|
+
*/
|
|
9
|
+
export declare const AUTH_CONSOLE_CONTRACT_VERSION = 1;
|
|
10
|
+
/**
|
|
11
|
+
* The marker the account console's index.html must carry. It is that
|
|
12
|
+
* console's entire runtime contract: without it the injected
|
|
13
|
+
* `window.__AUTHUP__` never lands and the SPA silently falls back to
|
|
14
|
+
* deriving its API URL from the origin.
|
|
15
|
+
*/
|
|
16
|
+
export declare const ACCOUNT_CONSOLE_CONFIG_MARKER = "<!--account-config-->";
|
|
17
|
+
/**
|
|
18
|
+
* Bind the substituted console packages and verify they still fulfill the
|
|
19
|
+
* contracts, before the first request rather than per render.
|
|
20
|
+
*
|
|
21
|
+
* Only runs for a package the operator actually substituted. With the
|
|
22
|
+
* default resolution the console packages ship from this repo with linked
|
|
23
|
+
* versions, so the assert would compare a constant against itself, and
|
|
24
|
+
* loading the SSR bundle at boot would turn a missing build into a failed
|
|
25
|
+
* start instead of an actionable error on the page.
|
|
26
|
+
*
|
|
27
|
+
* Fail-closed on a mismatch: the operator replaced the login and consent
|
|
28
|
+
* IMPLEMENTATION (the prompt ladder, PKCE and state handling, MFA
|
|
29
|
+
* ordering, redirect gating), so a contract drift must stop the container
|
|
30
|
+
* rather than render subtly wrong auth pages.
|
|
31
|
+
*/
|
|
32
|
+
export declare function bindConsolePackages(options?: ConsolePackageOptions): Promise<void>;
|
|
33
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/http/ui/console-packages/module.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6B,IAAI,CAAC;AAiB/C;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,0BAA0B,CAAC;AAErE;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,GAAE,qBAA0B,GAAI,OAAO,CAAC,IAAI,CAAC,CAW7F"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
import { resolveAuthConsoleDistPath, setAuthConsolePackagePath } from "../auth-console/resolve.mjs";
|
|
5
|
+
import "../auth-console/index.mjs";
|
|
6
|
+
import { resolveAccountConsoleDistPath, setAccountConsolePackagePath } from "../account-console/module.mjs";
|
|
7
|
+
import "../account-console/index.mjs";
|
|
8
|
+
import { AuthupError, normalizeError } from "@authup/errors";
|
|
9
|
+
import path from "node:path";
|
|
10
|
+
import { read } from "locter";
|
|
11
|
+
import fs from "node:fs";
|
|
12
|
+
//#region src/adapters/http/ui/console-packages/module.ts
|
|
13
|
+
/**
|
|
14
|
+
* The render-contract version server-core compiles against. Must match the
|
|
15
|
+
* `CONTRACT_VERSION` the auth console bundle exports.
|
|
16
|
+
*
|
|
17
|
+
* Bump alongside `apps/client-auth-console/src/contract.ts` whenever a
|
|
18
|
+
* change breaks a package built against the previous shape.
|
|
19
|
+
*/ const AUTH_CONSOLE_CONTRACT_VERSION = 1;
|
|
20
|
+
/**
|
|
21
|
+
* The marker the account console's index.html must carry. It is that
|
|
22
|
+
* console's entire runtime contract: without it the injected
|
|
23
|
+
* `window.__AUTHUP__` never lands and the SPA silently falls back to
|
|
24
|
+
* deriving its API URL from the origin.
|
|
25
|
+
*/ const ACCOUNT_CONSOLE_CONFIG_MARKER = "<!--account-config-->";
|
|
26
|
+
/**
|
|
27
|
+
* Bind the substituted console packages and verify they still fulfill the
|
|
28
|
+
* contracts, before the first request rather than per render.
|
|
29
|
+
*
|
|
30
|
+
* Only runs for a package the operator actually substituted. With the
|
|
31
|
+
* default resolution the console packages ship from this repo with linked
|
|
32
|
+
* versions, so the assert would compare a constant against itself, and
|
|
33
|
+
* loading the SSR bundle at boot would turn a missing build into a failed
|
|
34
|
+
* start instead of an actionable error on the page.
|
|
35
|
+
*
|
|
36
|
+
* Fail-closed on a mismatch: the operator replaced the login and consent
|
|
37
|
+
* IMPLEMENTATION (the prompt ladder, PKCE and state handling, MFA
|
|
38
|
+
* ordering, redirect gating), so a contract drift must stop the container
|
|
39
|
+
* rather than render subtly wrong auth pages.
|
|
40
|
+
*/ async function bindConsolePackages(options = {}) {
|
|
41
|
+
setAuthConsolePackagePath(options.authConsolePath);
|
|
42
|
+
setAccountConsolePackagePath(options.accountConsolePath);
|
|
43
|
+
if (options.authConsolePath) await assertAuthConsoleContract(options.authConsolePath);
|
|
44
|
+
if (options.accountConsolePath) assertAccountConsoleContract(options.accountConsolePath);
|
|
45
|
+
}
|
|
46
|
+
async function assertAuthConsoleContract(packagePath) {
|
|
47
|
+
const distPath = resolveAuthConsoleDistPath();
|
|
48
|
+
if (!distPath) throw new AuthupError(`The auth console package at "${packagePath}" carries no built bundle (expected dist/client/index.html).`);
|
|
49
|
+
const entry = path.join(distPath, "server", "server.js");
|
|
50
|
+
let module;
|
|
51
|
+
try {
|
|
52
|
+
module = await read(entry);
|
|
53
|
+
} catch (e) {
|
|
54
|
+
const reason = normalizeError(e).message;
|
|
55
|
+
throw new AuthupError(`The auth console render entry "${entry}" could not be loaded.\n ${reason}`);
|
|
56
|
+
}
|
|
57
|
+
if (typeof module.render !== "function") throw new AuthupError(`The auth console bundle "${entry}" does not export a render() function.`);
|
|
58
|
+
const version = typeof module.CONTRACT_VERSION === "undefined" ? 1 : module.CONTRACT_VERSION;
|
|
59
|
+
if (version !== 1) throw new AuthupError(`The auth console package at "${packagePath}" implements render-contract version ${version}, but this authup requires 1. Rebuild it against the current @authup/client-auth-console contract.`);
|
|
60
|
+
}
|
|
61
|
+
function assertAccountConsoleContract(packagePath) {
|
|
62
|
+
const distPath = resolveAccountConsoleDistPath();
|
|
63
|
+
if (!distPath) throw new AuthupError(`The account console package at "${packagePath}" carries no built bundle (expected dist/index.html).`);
|
|
64
|
+
const entry = path.join(distPath, "index.html");
|
|
65
|
+
if (!fs.readFileSync(entry, "utf-8").includes("<!--account-config-->")) throw new AuthupError(`The account console shell "${entry}" carries no ${ACCOUNT_CONSOLE_CONFIG_MARKER} marker, so its runtime configuration cannot be injected.`);
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
export { ACCOUNT_CONSOLE_CONFIG_MARKER, AUTH_CONSOLE_CONTRACT_VERSION, bindConsolePackages };
|
|
69
|
+
|
|
70
|
+
//# sourceMappingURL=module.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.mjs","names":["AuthupError","normalizeError","read","fs","path","resolveAccountConsoleDistPath","setAccountConsolePackagePath","resolveAuthConsoleDistPath","setAuthConsolePackagePath","AUTH_CONSOLE_CONTRACT_VERSION","AUTH_CONSOLE_CONTRACT_VERSION_IN_SYNC","ACCOUNT_CONSOLE_CONFIG_MARKER","bindConsolePackages","options","authConsolePath","accountConsolePath","assertAuthConsoleContract","assertAccountConsoleContract","packagePath","distPath","entry","join","module","e","reason","message","render","version","CONTRACT_VERSION","html","readFileSync","includes"],"sources":["../../../../../src/adapters/http/ui/console-packages/module.ts"],"sourcesContent":["/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { AuthupError, normalizeError } from '@authup/errors';\nimport { read } from 'locter';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport {\n resolveAccountConsoleDistPath,\n setAccountConsolePackagePath,\n} from '../account-console/index.ts';\nimport { resolveAuthConsoleDistPath, setAuthConsolePackagePath } from '../auth-console/index.ts';\n// Type position only (see AUTH_CONSOLE_CONTRACT_VERSION_IN_SYNC below), so\n// the runtime stays a dist-file read and the layering rule holds.\nimport type { CONTRACT_VERSION as AuthConsoleContractVersion } from '@authup/client-auth-console';\nimport type { ConsolePackageOptions } from './types.ts';\n\n/**\n * The render-contract version server-core compiles against. Must match the\n * `CONTRACT_VERSION` the auth console bundle exports.\n *\n * Bump alongside `apps/client-auth-console/src/contract.ts` whenever a\n * change breaks a package built against the previous shape.\n */\nexport const AUTH_CONSOLE_CONTRACT_VERSION = 1;\n\n/**\n * Compile-time link to the value this constant mirrors.\n *\n * The runtime assert below only fires for a SUBSTITUTED package, so a bump\n * on one side and not the other would otherwise go unnoticed until a\n * substituted console failed at boot in someone else's deployment. The\n * annotation costs nothing at runtime (types are erased) and fails this\n * package's build the moment the two drift.\n */\ntype AuthConsoleContractVersionInSync = typeof AuthConsoleContractVersion extends typeof AUTH_CONSOLE_CONTRACT_VERSION ?\n true :\n never;\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst AUTH_CONSOLE_CONTRACT_VERSION_IN_SYNC : AuthConsoleContractVersionInSync = true;\n\n/**\n * The marker the account console's index.html must carry. It is that\n * console's entire runtime contract: without it the injected\n * `window.__AUTHUP__` never lands and the SPA silently falls back to\n * deriving its API URL from the origin.\n */\nexport const ACCOUNT_CONSOLE_CONFIG_MARKER = '<!--account-config-->';\n\n/**\n * Bind the substituted console packages and verify they still fulfill the\n * contracts, before the first request rather than per render.\n *\n * Only runs for a package the operator actually substituted. With the\n * default resolution the console packages ship from this repo with linked\n * versions, so the assert would compare a constant against itself, and\n * loading the SSR bundle at boot would turn a missing build into a failed\n * start instead of an actionable error on the page.\n *\n * Fail-closed on a mismatch: the operator replaced the login and consent\n * IMPLEMENTATION (the prompt ladder, PKCE and state handling, MFA\n * ordering, redirect gating), so a contract drift must stop the container\n * rather than render subtly wrong auth pages.\n */\nexport async function bindConsolePackages(options: ConsolePackageOptions = {}) : Promise<void> {\n setAuthConsolePackagePath(options.authConsolePath);\n setAccountConsolePackagePath(options.accountConsolePath);\n\n if (options.authConsolePath) {\n await assertAuthConsoleContract(options.authConsolePath);\n }\n\n if (options.accountConsolePath) {\n assertAccountConsoleContract(options.accountConsolePath);\n }\n}\n\nasync function assertAuthConsoleContract(packagePath: string) : Promise<void> {\n const distPath = resolveAuthConsoleDistPath();\n if (!distPath) {\n throw new AuthupError(\n `The auth console package at \"${packagePath}\" carries no built bundle (expected dist/client/index.html).`,\n );\n }\n\n const entry = path.join(distPath, 'server', 'server.js');\n\n let module : Record<string, any>;\n try {\n module = await read(entry) as Record<string, any>;\n } catch (e) {\n const reason = normalizeError(e).message;\n\n throw new AuthupError(`The auth console render entry \"${entry}\" could not be loaded.\\n ${reason}`);\n }\n\n if (typeof module.render !== 'function') {\n throw new AuthupError(`The auth console bundle \"${entry}\" does not export a render() function.`);\n }\n\n // A bundle predating the export counts as version 1, the shape every\n // package built before the constant existed implements.\n const version = typeof module.CONTRACT_VERSION === 'undefined' ?\n 1 :\n module.CONTRACT_VERSION;\n\n if (version !== AUTH_CONSOLE_CONTRACT_VERSION) {\n throw new AuthupError(\n `The auth console package at \"${packagePath}\" implements render-contract version ${version}, but this authup requires ${AUTH_CONSOLE_CONTRACT_VERSION}. Rebuild it against the current @authup/client-auth-console contract.`,\n );\n }\n}\n\nfunction assertAccountConsoleContract(packagePath: string) : void {\n const distPath = resolveAccountConsoleDistPath();\n if (!distPath) {\n throw new AuthupError(\n `The account console package at \"${packagePath}\" carries no built bundle (expected dist/index.html).`,\n );\n }\n\n const entry = path.join(distPath, 'index.html');\n const html = fs.readFileSync(entry, 'utf-8');\n\n if (!html.includes(ACCOUNT_CONSOLE_CONFIG_MARKER)) {\n throw new AuthupError(\n `The account console shell \"${entry}\" carries no ${ACCOUNT_CONSOLE_CONFIG_MARKER} marker, so its runtime configuration cannot be injected.`,\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;GA4BA,MAAaS,gCAAgC;;;;;;GAuB7C,MAAaE,gCAAgC;;;;;;;;;;;;;;;GAiB7C,eAAsBC,oBAAoBC,UAAiC,CAAC,GAAC;CACzEL,0BAA0BK,QAAQC,eAAe;CACjDR,6BAA6BO,QAAQE,kBAAkB;CAEvD,IAAIF,QAAQC,iBACR,MAAME,0BAA0BH,QAAQC,eAAe;CAG3D,IAAID,QAAQE,oBACRE,6BAA6BJ,QAAQE,kBAAkB;AAE/D;AAEA,eAAeC,0BAA0BE,aAAmB;CACxD,MAAMC,WAAWZ,2BAAAA;CACjB,IAAI,CAACY,UACD,MAAM,IAAInB,YACN,gCAAgCkB,YAAY,6DAA6D;CAIjH,MAAME,QAAQhB,KAAKiB,KAAKF,UAAU,UAAU,WAAA;CAE5C,IAAIG;CACJ,IAAI;EACAA,SAAS,MAAMpB,KAAKkB,KAAAA;CACxB,SAASG,GAAG;EACR,MAAMC,SAASvB,eAAesB,CAAAA,CAAAA,CAAGE;EAEjC,MAAM,IAAIzB,YAAY,kCAAkCoB,MAAM,4BAA4BI,QAAQ;CACtG;CAEA,IAAI,OAAOF,OAAOI,WAAW,YACzB,MAAM,IAAI1B,YAAY,4BAA4BoB,MAAM,uCAAuC;CAKnG,MAAMO,UAAU,OAAOL,OAAOM,qBAAqB,cAC/C,IACAN,OAAOM;CAEX,IAAID,YAAAA,GACA,MAAM,IAAI3B,YACN,gCAAgCkB,YAAY,uCAAuCS,QAAQ,mGAAkI;AAGzO;AAEA,SAASV,6BAA6BC,aAAmB;CACrD,MAAMC,WAAWd,8BAAAA;CACjB,IAAI,CAACc,UACD,MAAM,IAAInB,YACN,mCAAmCkB,YAAY,sDAAsD;CAI7G,MAAME,QAAQhB,KAAKiB,KAAKF,UAAU,YAAA;CAGlC,IAAI,CAFShB,GAAG2B,aAAaV,OAAO,OAE/BS,CAAAA,CAAKE,SAAAA,uBAASpB,GACf,MAAM,IAAIX,YACN,8BAA8BoB,MAAM,eAAeT,8BAA8B,0DAA0D;AAGvJ"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type ConsolePackageOptions = {
|
|
2
|
+
/**
|
|
3
|
+
* Package directory of a substituted @authup/client-auth-console.
|
|
4
|
+
* Empty resolves the packaged one from node_modules.
|
|
5
|
+
*/
|
|
6
|
+
authConsolePath?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Package directory of a substituted @authup/client-account-console.
|
|
9
|
+
*/
|
|
10
|
+
accountConsolePath?: string;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/http/ui/console-packages/types.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,qBAAqB,GAAG;IAChC;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
1
|
+
export * from './account-console/index.ts';
|
|
2
|
+
export * from './auth-console/index.ts';
|
|
3
|
+
export * from './console-packages/index.ts';
|
|
4
|
+
export * from './shared/index.ts';
|
|
5
|
+
export * from './theme/index.ts';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/adapters/http/ui/index.ts"],"names":[],"mappings":"AAOA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/adapters/http/ui/index.ts"],"names":[],"mappings":"AAOA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC"}
|
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
import "node:path";
|
|
2
2
|
import "node:url";
|
|
3
3
|
import.meta.url;
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
|
|
4
|
+
import { createInternalUIHttpClient, createPublicToInternalURLRewriter } from "./auth-console/http-client.mjs";
|
|
5
|
+
import { applyUIPageHeaders, injectHeadContent, readUIClientPreferences, rebaseAssetURLs, replaceTemplateMarker, serializeInlineScriptJSON, stampDocumentTitle, stampHtmlAttributes } from "./shared/html.mjs";
|
|
6
|
+
import "./shared/index.mjs";
|
|
7
|
+
import { THEME_ASSETS_DIRECTORY_NAME, THEME_ASSET_CONTENT_TYPES, THEME_ASSET_EXTENSIONS, THEME_ASSET_MOUNT_PATH, THEME_CSS_LAYER_NAME, THEME_FRAGMENTS_DIRECTORY_NAME, THEME_HEAD_FRAGMENT_FILE_NAME, THEME_HEAD_FRAGMENT_MAX_LENGTH, THEME_IMAGE_EXTENSIONS, THEME_LOGO_TOKENS, THEME_MANIFEST_FILE_NAME, THEME_MANIFEST_VERSION, THEME_TOKEN_NAME_PATTERN, THEME_TOKEN_VALUE_FORBIDDEN_PATTERN, THEME_TOKEN_VALUE_MAX_LENGTH } from "./theme/contract/constants.mjs";
|
|
8
|
+
import { buildThemeHead, escapeHtml } from "./theme/contract/head.mjs";
|
|
9
|
+
import { themeAssetExtension } from "./theme/contract/utils.mjs";
|
|
10
|
+
import { ThemeManifestValidator, parseThemeManifest } from "./theme/contract/manifest.mjs";
|
|
11
|
+
import { applyTheme } from "./theme/apply.mjs";
|
|
12
|
+
import { THEME_ASSET_CSP, THEME_MANIFEST_REVALIDATE_INTERVAL } from "./theme/constants.mjs";
|
|
13
|
+
import { createThemeAssetsHandler } from "./theme/assets.mjs";
|
|
14
|
+
import { ThemeProvider } from "./theme/module.mjs";
|
|
15
|
+
import "./theme/index.mjs";
|
|
16
|
+
import { resolveAuthConsoleDistPath, resolveAuthConsolePackagePath, setAuthConsolePackagePath } from "./auth-console/resolve.mjs";
|
|
17
|
+
import { renderAuthConsolePage } from "./auth-console/module.mjs";
|
|
18
|
+
import { serveWorkflowPage } from "./auth-console/serve.mjs";
|
|
19
|
+
import "./auth-console/index.mjs";
|
|
20
|
+
import { ACCOUNT_CONSOLE_REF_MAX_LENGTH, resolveAccountConsoleRef } from "./account-console/ref.mjs";
|
|
21
|
+
import { resolveAccountConsoleDistPath, serveAccountConsolePage, setAccountConsolePackagePath } from "./account-console/module.mjs";
|
|
22
|
+
import "./account-console/index.mjs";
|
|
23
|
+
import { ACCOUNT_CONSOLE_CONFIG_MARKER, AUTH_CONSOLE_CONTRACT_VERSION, bindConsolePackages } from "./console-packages/module.mjs";
|
|
24
|
+
import "./console-packages/index.mjs";
|
|
25
|
+
export { ACCOUNT_CONSOLE_CONFIG_MARKER, ACCOUNT_CONSOLE_REF_MAX_LENGTH, AUTH_CONSOLE_CONTRACT_VERSION, THEME_ASSETS_DIRECTORY_NAME, THEME_ASSET_CONTENT_TYPES, THEME_ASSET_CSP, THEME_ASSET_EXTENSIONS, THEME_ASSET_MOUNT_PATH, THEME_CSS_LAYER_NAME, THEME_FRAGMENTS_DIRECTORY_NAME, THEME_HEAD_FRAGMENT_FILE_NAME, THEME_HEAD_FRAGMENT_MAX_LENGTH, THEME_IMAGE_EXTENSIONS, THEME_LOGO_TOKENS, THEME_MANIFEST_FILE_NAME, THEME_MANIFEST_REVALIDATE_INTERVAL, THEME_MANIFEST_VERSION, THEME_TOKEN_NAME_PATTERN, THEME_TOKEN_VALUE_FORBIDDEN_PATTERN, THEME_TOKEN_VALUE_MAX_LENGTH, ThemeManifestValidator, ThemeProvider, applyTheme, applyUIPageHeaders, bindConsolePackages, buildThemeHead, createInternalUIHttpClient, createPublicToInternalURLRewriter, createThemeAssetsHandler, escapeHtml, injectHeadContent, parseThemeManifest, readUIClientPreferences, rebaseAssetURLs, renderAuthConsolePage, replaceTemplateMarker, resolveAccountConsoleDistPath, resolveAccountConsoleRef, resolveAuthConsoleDistPath, resolveAuthConsolePackagePath, serializeInlineScriptJSON, serveAccountConsolePage, serveWorkflowPage, setAccountConsolePackagePath, setAuthConsolePackagePath, stampDocumentTitle, stampHtmlAttributes, themeAssetExtension };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { IAppEvent } from 'routup';
|
|
2
|
+
export type UIClientPreferences = {
|
|
3
|
+
locale?: string;
|
|
4
|
+
colorMode?: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Mirror @vuecs/nuxt's SSR plugins: resolve the shared cookies server-side
|
|
8
|
+
* so the HTML shell already carries the `.dark`/`.light` class and lang
|
|
9
|
+
* attribute (no flash) and the client app hydrates from the same values.
|
|
10
|
+
* The cookies are shared between every console on the origin.
|
|
11
|
+
*/
|
|
12
|
+
export declare function readUIClientPreferences(event: IAppEvent): UIClientPreferences;
|
|
13
|
+
/**
|
|
14
|
+
* Stamp the resolved preferences onto the opening `<html>` tag. Matched by
|
|
15
|
+
* pattern rather than an exact literal, so a reformatted tag / dev-mode
|
|
16
|
+
* transformIndexHtml rewrite still gets the lang + color-mode attributes
|
|
17
|
+
* (no silent FOUC).
|
|
18
|
+
*/
|
|
19
|
+
export declare function stampHtmlAttributes(html: string, preferences: UIClientPreferences): string;
|
|
20
|
+
/**
|
|
21
|
+
* Replace a template marker (`<!--app-html-->`, `<!--account-config-->`, ...)
|
|
22
|
+
* with a rendered value.
|
|
23
|
+
*
|
|
24
|
+
* The replacement is passed as a FUNCTION on purpose. A string replacement
|
|
25
|
+
* expands the `$&`, `` $` ``, `$'` and `$$` patterns, so a `$'` anywhere in
|
|
26
|
+
* the value splices the template's own text back into the page. The values
|
|
27
|
+
* spliced here carry raw request input (the SSR hydration payload reflects
|
|
28
|
+
* query parameters), which made `?token=$'` return a page whose inline
|
|
29
|
+
* payload script was no longer valid JavaScript. Escaping cannot prevent
|
|
30
|
+
* this: the expansion happens after the value was built.
|
|
31
|
+
*/
|
|
32
|
+
export declare function replaceTemplateMarker(html: string, marker: string, value: string): string;
|
|
33
|
+
/**
|
|
34
|
+
* Insert markup immediately before `</head>`.
|
|
35
|
+
*
|
|
36
|
+
* Deliberately not a template marker: injecting at the closing tag works
|
|
37
|
+
* against console bundles that were built BEFORE this feature existed, so
|
|
38
|
+
* server-core never silently loses theming when it runs against an older
|
|
39
|
+
* console package. A shell without a `</head>` is returned unchanged.
|
|
40
|
+
*
|
|
41
|
+
* Function-replacement form for the same reason as replaceTemplateMarker.
|
|
42
|
+
*/
|
|
43
|
+
export declare function injectHeadContent(html: string, content: string): string;
|
|
44
|
+
/**
|
|
45
|
+
* Replace the document title. The value must already be HTML-escaped by
|
|
46
|
+
* the caller; matched by pattern so a reformatted tag still hits.
|
|
47
|
+
*/
|
|
48
|
+
export declare function stampDocumentTitle(html: string, title: string): string;
|
|
49
|
+
/**
|
|
50
|
+
* Response headers every served console page shares.
|
|
51
|
+
*
|
|
52
|
+
* Clickjacking guard: the pages mutate state behind explicit clicks and
|
|
53
|
+
* hydrate first-party session state, so framing them would make
|
|
54
|
+
* click-gating defeatable via overlay attacks — deny embedding entirely
|
|
55
|
+
* (iframe-based silent renew is therefore unsupported). The URLs routinely
|
|
56
|
+
* carry sensitive query params (id_token_hint, code, redirect, state) —
|
|
57
|
+
* never leak them via Referer.
|
|
58
|
+
*/
|
|
59
|
+
export declare function applyUIPageHeaders(event: IAppEvent): void;
|
|
60
|
+
/**
|
|
61
|
+
* Rewrite root-absolute asset references (script/link/preload tags emitted
|
|
62
|
+
* with a fixed vite base, e.g. /public/ or /account/) so they carry the
|
|
63
|
+
* path prefix under which authup is publicly served (e.g. /auth/public/...).
|
|
64
|
+
* The reverse proxy is expected to strip the prefix before the request
|
|
65
|
+
* reaches authup, so the assets middleware keeps serving at the fixed base.
|
|
66
|
+
*/
|
|
67
|
+
export declare function rebaseAssetURLs(html: string, basePath: string, viteBase: string): string;
|
|
68
|
+
/**
|
|
69
|
+
* Escape characters that would otherwise let a value break out of an inline
|
|
70
|
+
* `<script>` context (`</script>`) or terminate the JS string literal via
|
|
71
|
+
* the U+2028/U+2029 line separators. Every window-global config/payload a
|
|
72
|
+
* console page inlines must pass through this — never rely on the VALUES
|
|
73
|
+
* staying benign.
|
|
74
|
+
*/
|
|
75
|
+
export declare function serializeInlineScriptJSON(value: unknown): string;
|
|
76
|
+
//# sourceMappingURL=html.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/http/ui/shared/html.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAKxC,MAAM,MAAM,mBAAmB,GAAG;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,SAAS,GAAI,mBAAmB,CAK9E;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,mBAAmB,GAAI,MAAM,CAU3F;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAI,MAAM,CAE1F;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAI,MAAM,CAWxE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAI,MAAM,CAEvE;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,SAAS,GAAI,IAAI,CAQ1D;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAI,MAAM,CASzF;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAI,MAAM,CAMjE"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
import { LOCALE_COOKIE } from "../../request/helpers/locale.mjs";
|
|
5
|
+
import { useRequestCookie } from "@routup/basic/cookie";
|
|
6
|
+
//#region src/adapters/http/ui/shared/html.ts
|
|
7
|
+
const COLOR_MODE_COOKIE = "vc-color-mode";
|
|
8
|
+
/**
|
|
9
|
+
* Mirror @vuecs/nuxt's SSR plugins: resolve the shared cookies server-side
|
|
10
|
+
* so the HTML shell already carries the `.dark`/`.light` class and lang
|
|
11
|
+
* attribute (no flash) and the client app hydrates from the same values.
|
|
12
|
+
* The cookies are shared between every console on the origin.
|
|
13
|
+
*/ function readUIClientPreferences(event) {
|
|
14
|
+
return {
|
|
15
|
+
locale: useRequestCookie(event, LOCALE_COOKIE),
|
|
16
|
+
colorMode: useRequestCookie(event, COLOR_MODE_COOKIE)
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Stamp the resolved preferences onto the opening `<html>` tag. Matched by
|
|
21
|
+
* pattern rather than an exact literal, so a reformatted tag / dev-mode
|
|
22
|
+
* transformIndexHtml rewrite still gets the lang + color-mode attributes
|
|
23
|
+
* (no silent FOUC).
|
|
24
|
+
*/ function stampHtmlAttributes(html, preferences) {
|
|
25
|
+
let htmlAttrs = "lang=\"en\"";
|
|
26
|
+
if (preferences.locale && /^[a-zA-Z]{2,3}(-[a-zA-Z0-9]+)*$/.test(preferences.locale)) htmlAttrs = `lang="${preferences.locale}"`;
|
|
27
|
+
if (preferences.colorMode === "dark" || preferences.colorMode === "light") htmlAttrs += ` class="${preferences.colorMode}"`;
|
|
28
|
+
return html.replace(/<html\b[^>]*>/i, () => `<html ${htmlAttrs}>`);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Replace a template marker (`<!--app-html-->`, `<!--account-config-->`, ...)
|
|
32
|
+
* with a rendered value.
|
|
33
|
+
*
|
|
34
|
+
* The replacement is passed as a FUNCTION on purpose. A string replacement
|
|
35
|
+
* expands the `$&`, `` $` ``, `$'` and `$$` patterns, so a `$'` anywhere in
|
|
36
|
+
* the value splices the template's own text back into the page. The values
|
|
37
|
+
* spliced here carry raw request input (the SSR hydration payload reflects
|
|
38
|
+
* query parameters), which made `?token=$'` return a page whose inline
|
|
39
|
+
* payload script was no longer valid JavaScript. Escaping cannot prevent
|
|
40
|
+
* this: the expansion happens after the value was built.
|
|
41
|
+
*/ function replaceTemplateMarker(html, marker, value) {
|
|
42
|
+
return html.replace(marker, () => value);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Insert markup immediately before `</head>`.
|
|
46
|
+
*
|
|
47
|
+
* Deliberately not a template marker: injecting at the closing tag works
|
|
48
|
+
* against console bundles that were built BEFORE this feature existed, so
|
|
49
|
+
* server-core never silently loses theming when it runs against an older
|
|
50
|
+
* console package. A shell without a `</head>` is returned unchanged.
|
|
51
|
+
*
|
|
52
|
+
* Function-replacement form for the same reason as replaceTemplateMarker.
|
|
53
|
+
*/ function injectHeadContent(html, content) {
|
|
54
|
+
if (!content) return html;
|
|
55
|
+
const index = html.toLowerCase().indexOf("</head>");
|
|
56
|
+
if (index === -1) return html;
|
|
57
|
+
return html.slice(0, index) + content + html.slice(index);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Replace the document title. The value must already be HTML-escaped by
|
|
61
|
+
* the caller; matched by pattern so a reformatted tag still hits.
|
|
62
|
+
*/ function stampDocumentTitle(html, title) {
|
|
63
|
+
return html.replace(/<title\b[^>]*>[\s\S]*?<\/title>/i, () => `<title>${title}</title>`);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Response headers every served console page shares.
|
|
67
|
+
*
|
|
68
|
+
* Clickjacking guard: the pages mutate state behind explicit clicks and
|
|
69
|
+
* hydrate first-party session state, so framing them would make
|
|
70
|
+
* click-gating defeatable via overlay attacks — deny embedding entirely
|
|
71
|
+
* (iframe-based silent renew is therefore unsupported). The URLs routinely
|
|
72
|
+
* carry sensitive query params (id_token_hint, code, redirect, state) —
|
|
73
|
+
* never leak them via Referer.
|
|
74
|
+
*/ function applyUIPageHeaders(event) {
|
|
75
|
+
event.response.headers.set("content-type", "text/html; charset=utf-8");
|
|
76
|
+
event.response.headers.set("vary", "cookie");
|
|
77
|
+
event.response.headers.set("content-security-policy", "frame-ancestors 'none'");
|
|
78
|
+
event.response.headers.set("x-frame-options", "DENY");
|
|
79
|
+
event.response.headers.set("referrer-policy", "no-referrer");
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Rewrite root-absolute asset references (script/link/preload tags emitted
|
|
83
|
+
* with a fixed vite base, e.g. /public/ or /account/) so they carry the
|
|
84
|
+
* path prefix under which authup is publicly served (e.g. /auth/public/...).
|
|
85
|
+
* The reverse proxy is expected to strip the prefix before the request
|
|
86
|
+
* reaches authup, so the assets middleware keeps serving at the fixed base.
|
|
87
|
+
*/ function rebaseAssetURLs(html, basePath, viteBase) {
|
|
88
|
+
if (!basePath) return html;
|
|
89
|
+
return html.replace(new RegExp(`(src|href)="${viteBase.replace(/[.*+?^${}()|[\]\\/]/g, "\\$&")}`, "g"), (_match, attribute) => `${attribute}="${basePath}${viteBase}`);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Escape characters that would otherwise let a value break out of an inline
|
|
93
|
+
* `<script>` context (`<\/script>`) or terminate the JS string literal via
|
|
94
|
+
* the U+2028/U+2029 line separators. Every window-global config/payload a
|
|
95
|
+
* console page inlines must pass through this — never rely on the VALUES
|
|
96
|
+
* staying benign.
|
|
97
|
+
*/ function serializeInlineScriptJSON(value) {
|
|
98
|
+
return JSON.stringify(value).replace(/</g, "\\u003c").replace(/>/g, "\\u003e").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
99
|
+
}
|
|
100
|
+
//#endregion
|
|
101
|
+
export { applyUIPageHeaders, injectHeadContent, readUIClientPreferences, rebaseAssetURLs, replaceTemplateMarker, serializeInlineScriptJSON, stampDocumentTitle, stampHtmlAttributes };
|
|
102
|
+
|
|
103
|
+
//# sourceMappingURL=html.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html.mjs","names":["useRequestCookie","LOCALE_COOKIE","COLOR_MODE_COOKIE","readUIClientPreferences","event","locale","colorMode","stampHtmlAttributes","html","preferences","htmlAttrs","test","replace","replaceTemplateMarker","marker","value","injectHeadContent","content","index","toLowerCase","indexOf","slice","stampDocumentTitle","title","applyUIPageHeaders","response","headers","set","rebaseAssetURLs","basePath","viteBase","RegExp","_match","attribute","serializeInlineScriptJSON","JSON","stringify"],"sources":["../../../../../src/adapters/http/ui/shared/html.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 { useRequestCookie } from '@routup/basic/cookie';\nimport type { IAppEvent } from 'routup';\nimport { LOCALE_COOKIE } from '../../request/helpers/locale.ts';\n\nconst COLOR_MODE_COOKIE = 'vc-color-mode';\n\nexport type UIClientPreferences = {\n locale?: string,\n colorMode?: string,\n};\n\n/**\n * Mirror @vuecs/nuxt's SSR plugins: resolve the shared cookies server-side\n * so the HTML shell already carries the `.dark`/`.light` class and lang\n * attribute (no flash) and the client app hydrates from the same values.\n * The cookies are shared between every console on the origin.\n */\nexport function readUIClientPreferences(event: IAppEvent) : UIClientPreferences {\n return {\n locale: useRequestCookie(event, LOCALE_COOKIE),\n colorMode: useRequestCookie(event, COLOR_MODE_COOKIE),\n };\n}\n\n/**\n * Stamp the resolved preferences onto the opening `<html>` tag. Matched by\n * pattern rather than an exact literal, so a reformatted tag / dev-mode\n * transformIndexHtml rewrite still gets the lang + color-mode attributes\n * (no silent FOUC).\n */\nexport function stampHtmlAttributes(html: string, preferences: UIClientPreferences) : string {\n let htmlAttrs = 'lang=\"en\"';\n if (preferences.locale && /^[a-zA-Z]{2,3}(-[a-zA-Z0-9]+)*$/.test(preferences.locale)) {\n htmlAttrs = `lang=\"${preferences.locale}\"`;\n }\n if (preferences.colorMode === 'dark' || preferences.colorMode === 'light') {\n htmlAttrs += ` class=\"${preferences.colorMode}\"`;\n }\n\n return html.replace(/<html\\b[^>]*>/i, () => `<html ${htmlAttrs}>`);\n}\n\n/**\n * Replace a template marker (`<!--app-html-->`, `<!--account-config-->`, ...)\n * with a rendered value.\n *\n * The replacement is passed as a FUNCTION on purpose. A string replacement\n * expands the `$&`, `` $` ``, `$'` and `$$` patterns, so a `$'` anywhere in\n * the value splices the template's own text back into the page. The values\n * spliced here carry raw request input (the SSR hydration payload reflects\n * query parameters), which made `?token=$'` return a page whose inline\n * payload script was no longer valid JavaScript. Escaping cannot prevent\n * this: the expansion happens after the value was built.\n */\nexport function replaceTemplateMarker(html: string, marker: string, value: string) : string {\n return html.replace(marker, () => value);\n}\n\n/**\n * Insert markup immediately before `</head>`.\n *\n * Deliberately not a template marker: injecting at the closing tag works\n * against console bundles that were built BEFORE this feature existed, so\n * server-core never silently loses theming when it runs against an older\n * console package. A shell without a `</head>` is returned unchanged.\n *\n * Function-replacement form for the same reason as replaceTemplateMarker.\n */\nexport function injectHeadContent(html: string, content: string) : string {\n if (!content) {\n return html;\n }\n\n const index = html.toLowerCase().indexOf('</head>');\n if (index === -1) {\n return html;\n }\n\n return html.slice(0, index) + content + html.slice(index);\n}\n\n/**\n * Replace the document title. The value must already be HTML-escaped by\n * the caller; matched by pattern so a reformatted tag still hits.\n */\nexport function stampDocumentTitle(html: string, title: string) : string {\n return html.replace(/<title\\b[^>]*>[\\s\\S]*?<\\/title>/i, () => `<title>${title}</title>`);\n}\n\n/**\n * Response headers every served console page shares.\n *\n * Clickjacking guard: the pages mutate state behind explicit clicks and\n * hydrate first-party session state, so framing them would make\n * click-gating defeatable via overlay attacks — deny embedding entirely\n * (iframe-based silent renew is therefore unsupported). The URLs routinely\n * carry sensitive query params (id_token_hint, code, redirect, state) —\n * never leak them via Referer.\n */\nexport function applyUIPageHeaders(event: IAppEvent) : void {\n event.response.headers.set('content-type', 'text/html; charset=utf-8');\n // The shell is stamped from the vc-locale / vc-color-mode cookies, so\n // it genuinely varies by them. It carried no Vary header at all.\n event.response.headers.set('vary', 'cookie');\n event.response.headers.set('content-security-policy', \"frame-ancestors 'none'\");\n event.response.headers.set('x-frame-options', 'DENY');\n event.response.headers.set('referrer-policy', 'no-referrer');\n}\n\n/**\n * Rewrite root-absolute asset references (script/link/preload tags emitted\n * with a fixed vite base, e.g. /public/ or /account/) so they carry the\n * path prefix under which authup is publicly served (e.g. /auth/public/...).\n * The reverse proxy is expected to strip the prefix before the request\n * reaches authup, so the assets middleware keeps serving at the fixed base.\n */\nexport function rebaseAssetURLs(html: string, basePath: string, viteBase: string) : string {\n if (!basePath) {\n return html;\n }\n\n return html.replace(\n new RegExp(`(src|href)=\"${viteBase.replace(/[.*+?^${}()|[\\]\\\\/]/g, '\\\\$&')}`, 'g'),\n (_match, attribute) => `${attribute}=\"${basePath}${viteBase}`,\n );\n}\n\n/**\n * Escape characters that would otherwise let a value break out of an inline\n * `<script>` context (`</script>`) or terminate the JS string literal via\n * the U+2028/U+2029 line separators. Every window-global config/payload a\n * console page inlines must pass through this — never rely on the VALUES\n * staying benign.\n */\nexport function serializeInlineScriptJSON(value: unknown) : string {\n return JSON.stringify(value)\n .replace(/</g, '\\\\u003c')\n .replace(/>/g, '\\\\u003e')\n .replace(/\\u2028/g, '\\\\u2028')\n .replace(/\\u2029/g, '\\\\u2029');\n}\n"],"mappings":";;;;;;AAWA,MAAME,oBAAoB;;;;;;GAa1B,SAAgBC,wBAAwBC,OAAgB;CACpD,OAAO;EACHC,QAAQL,iBAAiBI,OAAOH,aAAAA;EAChCK,WAAWN,iBAAiBI,OAAOF,iBAAAA;CACvC;AACJ;;;;;;GAQA,SAAgBK,oBAAoBC,MAAcC,aAAgC;CAC9E,IAAIC,YAAY;CAChB,IAAID,YAAYJ,UAAU,kCAAkCM,KAAKF,YAAYJ,MAAM,GAC/EK,YAAY,SAASD,YAAYJ,OAAO;CAE5C,IAAII,YAAYH,cAAc,UAAUG,YAAYH,cAAc,SAC9DI,aAAa,WAAWD,YAAYH,UAAU;CAGlD,OAAOE,KAAKI,QAAQ,wBAAwB,SAASF,UAAU,EAAE;AACrE;;;;;;;;;;;;GAcA,SAAgBG,sBAAsBL,MAAcM,QAAgBC,OAAa;CAC7E,OAAOP,KAAKI,QAAQE,cAAcC,KAAAA;AACtC;;;;;;;;;;GAYA,SAAgBC,kBAAkBR,MAAcS,SAAe;CAC3D,IAAI,CAACA,SACD,OAAOT;CAGX,MAAMU,QAAQV,KAAKW,YAAW,CAAA,CAAGC,QAAQ,SAAA;CACzC,IAAIF,UAAU,IACV,OAAOV;CAGX,OAAOA,KAAKa,MAAM,GAAGH,KAAAA,IAASD,UAAUT,KAAKa,MAAMH,KAAAA;AACvD;;;;GAMA,SAAgBI,mBAAmBd,MAAce,OAAa;CAC1D,OAAOf,KAAKI,QAAQ,0CAA0C,UAAUW,MAAM,SAAS;AAC3F;;;;;;;;;;GAYA,SAAgBC,mBAAmBpB,OAAgB;CAC/CA,MAAMqB,SAASC,QAAQC,IAAI,gBAAgB,0BAAA;CAG3CvB,MAAMqB,SAASC,QAAQC,IAAI,QAAQ,QAAA;CACnCvB,MAAMqB,SAASC,QAAQC,IAAI,2BAA2B,wBAAA;CACtDvB,MAAMqB,SAASC,QAAQC,IAAI,mBAAmB,MAAA;CAC9CvB,MAAMqB,SAASC,QAAQC,IAAI,mBAAmB,aAAA;AAClD;;;;;;;GASA,SAAgBC,gBAAgBpB,MAAcqB,UAAkBC,UAAgB;CAC5E,IAAI,CAACD,UACD,OAAOrB;CAGX,OAAOA,KAAKI,QACR,IAAImB,OAAO,eAAeD,SAASlB,QAAQ,wBAAwB,MAAA,KAAW,GAAA,IAC7EoB,QAAQC,cAAc,GAAGA,UAAU,IAAIJ,WAAWC,UAAU;AAErE;;;;;;;GASA,SAAgBI,0BAA0BnB,OAAc;CACpD,OAAOoB,KAAKC,UAAUrB,KAAAA,CAAAA,CACjBH,QAAQ,MAAM,SAAA,CAAA,CACdA,QAAQ,MAAM,SAAA,CAAA,CACdA,QAAQ,WAAW,SAAA,CAAA,CACnBA,QAAQ,WAAW,SAAA;AAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/http/ui/shared/index.ts"],"names":[],"mappings":"AAOA,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
import { applyUIPageHeaders, injectHeadContent, readUIClientPreferences, rebaseAssetURLs, replaceTemplateMarker, serializeInlineScriptJSON, stampDocumentTitle, stampHtmlAttributes } from "./html.mjs";
|
|
5
|
+
export { applyUIPageHeaders, injectHeadContent, readUIClientPreferences, rebaseAssetURLs, replaceTemplateMarker, serializeInlineScriptJSON, stampDocumentTitle, stampHtmlAttributes };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IThemeProvider } from './types.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Apply the operator theme to a rendered console shell. A no-op when
|
|
4
|
+
* theming is off or the directory carries no manifest, so both console
|
|
5
|
+
* serve paths can call it unconditionally.
|
|
6
|
+
*
|
|
7
|
+
* Lives outside contract/ because it takes a provider (filesystem-backed)
|
|
8
|
+
* and splices into a served document: contract/ stays a pure description
|
|
9
|
+
* of what a theme IS.
|
|
10
|
+
*/
|
|
11
|
+
export declare function applyTheme(html: string, provider: IThemeProvider | undefined, basePath: string): Promise<string>;
|
|
12
|
+
//# sourceMappingURL=apply.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/http/ui/theme/apply.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD;;;;;;;;GAQG;AACH,wBAAsB,UAAU,CAC5B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,cAAc,GAAG,SAAS,EACpC,QAAQ,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,CAAC,CAoBlB"}
|