@hivemagnus/magnus-ui 3.6.0 → 3.7.0
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/.env.example +5 -4
- package/README.md +52 -4
- package/bin/magnus-ui.mjs +118 -2
- package/dist/app/apps/dashboard/.next/BUILD_ID +1 -1
- package/dist/app/apps/dashboard/.next/build-manifest.json +3 -3
- package/dist/app/apps/dashboard/.next/prerender-manifest.json +3 -3
- package/dist/app/apps/dashboard/.next/required-server-files.json +2 -16
- package/dist/app/apps/dashboard/.next/routes-manifest.json +9 -20
- package/dist/app/apps/dashboard/.next/server/app/_global-error.html +1 -1
- package/dist/app/apps/dashboard/.next/server/app/_global-error.rsc +1 -1
- package/dist/app/apps/dashboard/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/dist/app/apps/dashboard/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/app/apps/dashboard/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/app/apps/dashboard/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/anomalies/[anomalyId]/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/anomalies/[anomalyId]/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/anomalies/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/anomalies/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/anomalies/remediation/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/anomalies/remediation/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/auth/hive/callback/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/auth/hive/configured/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/auth/hive/start/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/auth/login/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/auth/logout/route.js +6 -5
- package/dist/app/apps/dashboard/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/auth/me/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/control-nodes/[id]/route.js +2 -2
- package/dist/app/apps/dashboard/.next/server/app/api/control-nodes/[id]/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/control-nodes/route.js +2 -2
- package/dist/app/apps/dashboard/.next/server/app/api/control-nodes/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/federation/route.js +3 -3
- package/dist/app/apps/dashboard/.next/server/app/api/federation/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/health/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/hermes/dashboard/[[...path]]/route.js +8 -6
- package/dist/app/apps/dashboard/.next/server/app/api/hermes/dashboard/[[...path]]/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/hive-router/dashboard/[[...path]]/route.js +7 -5
- package/dist/app/apps/dashboard/.next/server/app/api/hive-router/dashboard/[[...path]]/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/proxy/[...path]/route.js +5 -5
- package/dist/app/apps/dashboard/.next/server/app/api/proxy/[...path]/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/terminal/close/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/terminal/input/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/terminal/open/route.js +4 -4
- package/dist/app/apps/dashboard/.next/server/app/api/terminal/open/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/terminal/resize/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/terminal/stream/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api-docs/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api-docs/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/application-operations/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/application-operations/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/installations/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/installations/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/[id]/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/[id]/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/audit/page.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/audit/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/audit/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/codex/installations/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/codex/installations/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/codex/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/codex/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/commands/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/commands/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/cron/page/server-reference-manifest.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/cron/page.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/cron/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/cron/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/files/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/files/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-map/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-map/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-readiness/page.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-readiness/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-readiness/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-timeline/page.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-timeline/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-timeline/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/governor/operations/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/governor/operations/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/hermes-drift/page.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/hermes-drift/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/hermes-drift/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/hermes-security/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/hermes-security/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/incidents/page.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/incidents/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/incidents/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/library/page.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/library/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/library/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/login/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/logs/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/logs/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/mission-control/page.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/mission-control/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/mission-control/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/nodes/[nodeId]/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/nodes/[nodeId]/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/nodes/page.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/nodes/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/nodes/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/notifications/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/notifications/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/installations/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/installations/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/profiles/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/profiles/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/web-gateway/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/web-gateway/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/page.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/retention/page.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/retention/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/retention/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/roles/page.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/roles/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/roles/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/rollouts/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/rollouts/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/[caseId]/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/[caseId]/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/entities/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/entities/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/events/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/events/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/evidence/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/evidence/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/page.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/policies/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/policies/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/sources/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/sources/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/skills/page/server-reference-manifest.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/skills/page.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/skills/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/webhooks/[id]/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/webhooks/[id]/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/webhooks/new/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/webhooks/new/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/webhooks/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/webhooks/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/{[externals]__0lufsyh_0gqup._.js → [externals]__1k43kg5-icx7b._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/{[root-of-the-server]__0vzssf5bgd660._.js → [root-of-the-server]__0ndj_rhwp_6vf._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/[root-of-the-server]__0ywmf3079vsm1._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/{[root-of-the-server]__05vapur0p6d-l._.js → [root-of-the-server]__15_4jl4ba_7y3._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/{[root-of-the-server]__0iiv9pxo2yauj._.js → [root-of-the-server]__1cxla67mqwfdr._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/{[root-of-the-server]__0fwm7idn_76uf._.js → [root-of-the-server]__1rrn6p9afghbt._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/{[root-of-the-server]__0ioimsx71gr0o._.js → [root-of-the-server]__1wj2nw17pv5g8._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/_0jvoc4-ta3zc0._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/_0oj6_-g5b2lvi._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/_0rwz3f0jh1ty0._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/_0s788ryrplkp6._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/_1-ntqfqk_4-f0._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/_120rsoc_nc7_3._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/_1ilhtkg33m99h._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/_1xodprib7qa_j._.js +2 -2
- package/dist/app/apps/dashboard/.next/server/chunks/apps_dashboard_runtime-embed-isolation_mjs_1ovehd-pl97ex._.js +3 -0
- package/dist/app/apps/dashboard/.next/server/chunks/apps_dashboard_src_lib_auth_ts_1hhq1tq6hjj-e._.js +2 -2
- package/dist/app/apps/dashboard/.next/server/chunks/apps_dashboard_src_lib_control-nodes-store_ts_01hjyte7nc7l2._.js +3 -2
- package/dist/app/apps/dashboard/.next/server/chunks/apps_dashboard_src_lib_embedded-frame_ts_1dw1tog69m3ap._.js +3 -0
- package/dist/app/apps/dashboard/.next/server/chunks/apps_dashboard_src_lib_hive-login_ts_0ab2iq7-rpy13._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/[root-of-the-server]__02wumq04h7-2m._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__1koj-a25tcc9z._.js → [root-of-the-server]__0az7ayfxt936j._.js} +2 -2
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__02rfo46o0ocq7._.js → [root-of-the-server]__0cbjirfjkahyz._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__0l7okklk-ix9t._.js → [root-of-the-server]__0mtl30w3r3d8n._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__1w1bkuf_-8zxm._.js → [root-of-the-server]__0n1mehgazoyys._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__1y4za7l5ph9o-._.js → [root-of-the-server]__0piptu4qrcax4._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__0neu-iblb1_-5._.js → [root-of-the-server]__0qoxqg_z229qc._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__1jb0a4bkg6dd1._.js → [root-of-the-server]__0yvtveej1dtd6._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__000ndthd0hd5v._.js → [root-of-the-server]__0zftzxoekcfyw._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__202zczfuwkbzi._.js → [root-of-the-server]__15i5sz08w-tg0._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__1ria97bl22vsq._.js → [root-of-the-server]__18k_-53xs-qpk._.js} +2 -2
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__1jtg9fc0ny1cg._.js → [root-of-the-server]__1cesdboqyg7rq._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__1wsrd6m1h8q7q._.js → [root-of-the-server]__1p0rsbsf87odz._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__1l8__2gqqi590._.js → [root-of-the-server]__1un9oi8-bokqt._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__1gwofuehw8lyc._.js → [root-of-the-server]__206hwh476sy80._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/_07u8d93e_m_yo._.js +3 -2
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/_0caxc2bc6a__r._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/_1oebzzj_en62h._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_runtime-environment_mjs_11tpywm9_soif._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_0gs_s688kgg1i._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_anomalies_remediation_page_tsx_179m33swiclif._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_ardent_installations_page_tsx_0nvqgacugy6nf._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_audit_audit-client_tsx_0iyab_tlw5yus._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_cron_page_tsx_1i3duyygc0_tg._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_files_page_tsx_1kls9-qinldks._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_governor_operations_page_tsx_1tvdkgil8mlgk._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_login_page_tsx_12_rihimtav2a._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_logs_page_tsx_0473-hcpj1mqr._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_mission-control_page_tsx_0crgxncex_u3w._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_nodes_[nodeId]_page_tsx_1q7fqu18oklzc._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_nodes_nodes-client_tsx_0pt4iarhpqbgn._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_orchestra_web-gateway_page_tsx_1fz12np0wk27t._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_security-fusion_page_tsx_0d314q7yh6fx8._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_skills_page_tsx_0n5zp4xad38in._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_webhooks_webhook-form_tsx_02z3be5wx7-cb._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_components_ui_card_tsx_1pngl2ib-xo5t._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_components_ui_node-selector_tsx_1ci6ldznpaofq._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_lib_api-client_ts_0tho-kkk5ez7h._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/middleware-build-manifest.js +3 -3
- package/dist/app/apps/dashboard/.next/server/pages/500.html +1 -1
- package/dist/app/apps/dashboard/.next/server/preview-props.json +3 -3
- package/dist/app/apps/dashboard/.next/server/server-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/server-reference-manifest.json +3 -3
- package/dist/app/apps/dashboard/.next/static/chunks/{369vzlcjad-gn.js → 017x1uhn9l7nw.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{1-vn8cqro-f08.js → 06_2psos--paq.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/0i8g96dmx-fbo.css +2 -0
- package/dist/app/apps/dashboard/.next/static/chunks/0nalo72r7vipw.js +1 -0
- package/dist/app/apps/dashboard/.next/static/chunks/0pswbe-19xxl5.js +1 -0
- package/dist/app/apps/dashboard/.next/static/chunks/{3ntnj6ts2r3e2.js → 0s2skhp7086pc.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{0nekvgtqt8goj.js → 0zsp_alwy1f3v.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/1fpi73pmpn8v5.js +1 -0
- package/dist/app/apps/dashboard/.next/static/chunks/1gko0bkguj_g0.js +1 -0
- package/dist/app/apps/dashboard/.next/static/chunks/{0lxf5l-ugq-09.js → 1t6g3-pjlavb5.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{1bn40ef0zair9.js → 1ygangs-zn4yl.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/2_eadjwf4989d.js +1 -0
- package/dist/app/apps/dashboard/.next/static/chunks/2fzv4_us4q1w_.js +1 -0
- package/dist/app/apps/dashboard/.next/static/chunks/{1cvbtmsr4d3ci.js → 2isl5q2zhjwiw.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/2jaw-lni6k_dt.js +1 -0
- package/dist/app/apps/dashboard/.next/static/chunks/2sh8fn_vg-vs5.js +1 -0
- package/dist/app/apps/dashboard/.next/static/chunks/{1kx48jg-4j5iv.js → 2u4_fj_v8i521.js} +2 -2
- package/dist/app/apps/dashboard/.next/static/chunks/{0d6kculhmue59.js → 2zj24fir1fm27.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{3w-7xko96ljib.js → 2zjjqqg5z63sl.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/337js55ro9g08.js +1 -0
- package/dist/app/apps/dashboard/.next/static/chunks/{37kstof-v-jwi.js → 33xay7yclh_jd.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/34yff9n0mbd1h.js +1 -0
- package/dist/app/apps/dashboard/.next/static/chunks/{05p7s0xtb3koa.js → 3eo_31lzj51v9.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{12ju76tjcqh_z.js → 3f73kvi1pwabq.js} +4 -4
- package/dist/app/apps/dashboard/.next/static/chunks/{23o8zfgrdxuhk.js → 3kh386y5gla53.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/3mwn69j8d-q9v.js +4 -0
- package/dist/app/apps/dashboard/.next/static/chunks/3p_wvl3sieoi4.js +1 -0
- package/dist/app/apps/dashboard/.next/static/chunks/{0yb36s9l-f3_w.js → 3qrrim22gq-vp.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/3ui3xvxcdyc0r.js +1 -0
- package/dist/app/apps/dashboard/.next/static/chunks/3ya4-24grz_0f.js +1 -0
- package/dist/app/apps/dashboard/.next/static/chunks/{37pb0l96d03rk.js → 42j6wpibe0zrn.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/4369o9c3gezxt.js +6 -0
- package/dist/app/apps/dashboard/.next/static/rWpgppq64sqgeZO3-MlD1/_buildManifest.js +11 -0
- package/dist/app/apps/dashboard/package.json +3 -2
- package/dist/app/apps/dashboard/runtime-control-node-credentials.mjs +638 -0
- package/dist/app/apps/dashboard/runtime-embed-isolation.mjs +450 -0
- package/dist/app/apps/dashboard/runtime-environment.mjs +1 -1
- package/dist/app/apps/dashboard/runtime-integrations.mjs +4 -4
- package/dist/app/apps/dashboard/server-tls.mjs +96 -47
- package/dist/app/apps/dashboard/server.js +1 -1
- package/npm-shrinkwrap.json +4 -3
- package/package.json +3 -2
- package/dist/app/apps/dashboard/.next/static/IOi-LmbFghqZcllGm0tny/_buildManifest.js +0 -20
- package/dist/app/apps/dashboard/.next/static/chunks/015s19fe5dtkp.css +0 -2
- package/dist/app/apps/dashboard/.next/static/chunks/06xzeulnw897e.js +0 -1
- package/dist/app/apps/dashboard/.next/static/chunks/07tx3h4lr-lxl.js +0 -6
- package/dist/app/apps/dashboard/.next/static/chunks/0j0dzrd0ev-gx.js +0 -1
- package/dist/app/apps/dashboard/.next/static/chunks/1-pj3rx01kcq0.js +0 -4
- package/dist/app/apps/dashboard/.next/static/chunks/1j5vpju4k1wlj.js +0 -1
- package/dist/app/apps/dashboard/.next/static/chunks/1kjl44-64ume7.js +0 -1
- package/dist/app/apps/dashboard/.next/static/chunks/28zpgt1trm_m4.js +0 -1
- package/dist/app/apps/dashboard/.next/static/chunks/2lk4ailve7631.js +0 -1
- package/dist/app/apps/dashboard/.next/static/chunks/2lulmsr2vjuw5.js +0 -1
- package/dist/app/apps/dashboard/.next/static/chunks/30npcziw-f8ld.js +0 -1
- package/dist/app/apps/dashboard/.next/static/chunks/31hx4x8k9707e.js +0 -1
- package/dist/app/apps/dashboard/.next/static/chunks/34mzv0h7jkx20.js +0 -1
- package/dist/app/apps/dashboard/.next/static/chunks/3cw8xs2dab1g-.js +0 -1
- package/dist/app/apps/dashboard/.next/static/chunks/3gjll_bse9v1f.js +0 -1
- package/dist/app/apps/dashboard/.next/static/chunks/3qq-otw-t-6b0.js +0 -1
- /package/dist/app/apps/dashboard/.next/static/{IOi-LmbFghqZcllGm0tny → rWpgppq64sqgeZO3-MlD1}/_clientMiddlewareManifest.js +0 -0
- /package/dist/app/apps/dashboard/.next/static/{IOi-LmbFghqZcllGm0tny → rWpgppq64sqgeZO3-MlD1}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,450 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Isolation for the third-party dashboards the console proxies (the Hermes dashboard and the
|
|
3
|
+
* deprecated Hive Router admin UI).
|
|
4
|
+
*
|
|
5
|
+
* Their pages are served from the console's own host, so without isolation a script flaw in
|
|
6
|
+
* either would run with full console authority. Every proxied response therefore carries a
|
|
7
|
+
* `sandbox` Content Security Policy without `allow-same-origin`: the browser gives the page an
|
|
8
|
+
* opaque origin, so its script cannot read console cookies, storage or pages, and the console's
|
|
9
|
+
* cross-site checks refuse its requests. `connect-src 'self'` keeps its fetches and sockets on
|
|
10
|
+
* this host.
|
|
11
|
+
*
|
|
12
|
+
* An opaque-origin page cannot send the console session cookie either, so the proxy hands it a
|
|
13
|
+
* frame grant instead: a signed, path-scoped capability that reaches only that one dashboard
|
|
14
|
+
* (and, for Hermes, one installation). Proxied URLs carry it as a path segment,
|
|
15
|
+
* `<base>/_frame/<grant>/<upstream path>`, so it lands in access logs and browser history; it is
|
|
16
|
+
* therefore short-lived ({@link FRAME_GRANT_TTL_SECONDS}), never outlives its console session and
|
|
17
|
+
* stops working on sign-out. The console frame renews it through `postMessage`
|
|
18
|
+
* ({@link FRAME_COMPAT_SCRIPT}, `src/lib/frame-grant-relay.ts`); a reload with an expired grant
|
|
19
|
+
* and the console cookie is re-minted ({@link frameGrantDecision}).
|
|
20
|
+
*
|
|
21
|
+
* Plain ESM so the Next.js proxy (middleware), the route handlers and the TLS wrapper's
|
|
22
|
+
* WebSocket bridge share one definition.
|
|
23
|
+
*/
|
|
24
|
+
import { createHmac } from 'node:crypto';
|
|
25
|
+
import { SignJWT, jwtVerify } from 'jose';
|
|
26
|
+
import { readDashboardEnvironment } from './runtime-environment.mjs';
|
|
27
|
+
import { verifyLocalSession } from './runtime-local-sessions.mjs';
|
|
28
|
+
import { resolveSessionSecret } from './runtime-session-secret.mjs';
|
|
29
|
+
|
|
30
|
+
/** Proxy base path of each embedded dashboard. */
|
|
31
|
+
export const EMBEDDED_DASHBOARDS = Object.freeze({
|
|
32
|
+
hermes: '/api/hermes/dashboard',
|
|
33
|
+
router: '/api/hive-router/dashboard',
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
/** Path segment that introduces a frame grant. */
|
|
37
|
+
export const FRAME_SEGMENT = '_frame';
|
|
38
|
+
|
|
39
|
+
/** Lifetime of one frame grant. The console frame renews it well before it ends. */
|
|
40
|
+
export const FRAME_GRANT_TTL_SECONDS = 10 * 60;
|
|
41
|
+
|
|
42
|
+
/** How often an open Hermes WebSocket re-checks that its console session still exists. */
|
|
43
|
+
export const FRAME_SESSION_RECHECK_MS = 30_000;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* What the sandboxed Hermes page sees instead of the dashboard's real session token. The proxy
|
|
47
|
+
* and the WebSocket bridge swap it for the real one, which never leaves the server.
|
|
48
|
+
*/
|
|
49
|
+
export const FRAME_TOKEN_PLACEHOLDER = 'magnus-frame';
|
|
50
|
+
|
|
51
|
+
const GRANT_AUDIENCE = 'magnus-embedded-dashboard';
|
|
52
|
+
const GRANT_KEY_LABEL = 'magnus-embedded-dashboard-grant/v1';
|
|
53
|
+
|
|
54
|
+
/** `sandbox` attribute for the console's `<iframe>`: scripts run, but in an opaque origin. */
|
|
55
|
+
export const EMBED_IFRAME_SANDBOX = 'allow-scripts allow-forms allow-popups allow-downloads';
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Response policy for every proxied dashboard response. `sandbox` applies even when the page
|
|
59
|
+
* is opened in its own tab; popups inherit it (no `allow-popups-to-escape-sandbox`).
|
|
60
|
+
*/
|
|
61
|
+
export const EMBED_CONTENT_SECURITY_POLICY = [
|
|
62
|
+
`sandbox ${EMBED_IFRAME_SANDBOX} allow-modals`,
|
|
63
|
+
"connect-src 'self'",
|
|
64
|
+
"frame-ancestors 'self'",
|
|
65
|
+
"object-src 'none'",
|
|
66
|
+
"base-uri 'self'",
|
|
67
|
+
].join('; ');
|
|
68
|
+
|
|
69
|
+
function grantKey(env = process.env) {
|
|
70
|
+
// Derived, so a grant can never verify as a session cookie and the reverse.
|
|
71
|
+
return createHmac('sha256', resolveSessionSecret(env)).update(GRANT_KEY_LABEL).digest();
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function grantIssuer() {
|
|
75
|
+
return String(readDashboardEnvironment('SESSION_ISSUER'));
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const nowSeconds = () => Math.floor(Date.now() / 1000);
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Mint a frame grant for one embedded dashboard from a verified console session.
|
|
82
|
+
* @param {{ app: 'hermes' | 'router', installationId?: string | null, session: { username: string, sessionId?: string, provider?: string, exp: number } }} input
|
|
83
|
+
*/
|
|
84
|
+
export async function mintFrameGrant({ app, installationId = null, session }) {
|
|
85
|
+
if (!Object.hasOwn(EMBEDDED_DASHBOARDS, app)) throw new Error(`Unknown embedded dashboard: ${app}`);
|
|
86
|
+
// Named (Hive) sessions delegate through the Control API only; they never reach these proxies.
|
|
87
|
+
if (session.provider === 'hive' || !session.sessionId) throw new Error('A local console session is required');
|
|
88
|
+
const claims = {
|
|
89
|
+
app,
|
|
90
|
+
u: session.username,
|
|
91
|
+
sid: session.sessionId,
|
|
92
|
+
sexp: session.exp,
|
|
93
|
+
...(installationId ? { ins: installationId } : {}),
|
|
94
|
+
};
|
|
95
|
+
return new SignJWT(claims)
|
|
96
|
+
.setProtectedHeader({ alg: 'HS256' })
|
|
97
|
+
.setIssuer(grantIssuer())
|
|
98
|
+
.setAudience(GRANT_AUDIENCE)
|
|
99
|
+
.setIssuedAt()
|
|
100
|
+
.setExpirationTime(Math.min(session.exp, nowSeconds() + FRAME_GRANT_TTL_SECONDS))
|
|
101
|
+
.sign(grantKey());
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Verify a frame grant for `app`. Returns its scope, or null when the grant is forged, minted for
|
|
106
|
+
* another dashboard, or its console session has ended or expired. An expired grant is returned
|
|
107
|
+
* (with `expired: true`) only when `allowExpired` is set, for the narrow uses in
|
|
108
|
+
* {@link frameGrantDecision}.
|
|
109
|
+
* @param {string} token
|
|
110
|
+
* @param {'hermes' | 'router'} app
|
|
111
|
+
* @param {{ allowExpired?: boolean }} [options]
|
|
112
|
+
*/
|
|
113
|
+
export async function verifyFrameGrant(token, app, { allowExpired = false } = {}) {
|
|
114
|
+
if (typeof token !== 'string' || !token || token.length > 2048) return null;
|
|
115
|
+
let payload;
|
|
116
|
+
let expired = false;
|
|
117
|
+
try {
|
|
118
|
+
({ payload } = await jwtVerify(token, grantKey(), {
|
|
119
|
+
algorithms: ['HS256'],
|
|
120
|
+
issuer: grantIssuer(),
|
|
121
|
+
audience: GRANT_AUDIENCE,
|
|
122
|
+
}));
|
|
123
|
+
} catch (error) {
|
|
124
|
+
// The signature is checked before the claims, so an expired grant's payload is authentic.
|
|
125
|
+
if (!allowExpired || error?.code !== 'ERR_JWT_EXPIRED' || !error.payload) return null;
|
|
126
|
+
payload = error.payload;
|
|
127
|
+
if (payload['iss'] !== grantIssuer() || payload['aud'] !== GRANT_AUDIENCE) return null;
|
|
128
|
+
expired = true;
|
|
129
|
+
}
|
|
130
|
+
try {
|
|
131
|
+
if (payload['app'] !== app || typeof payload['u'] !== 'string' || typeof payload['sid'] !== 'string') return null;
|
|
132
|
+
const sessionExpiresAt = typeof payload['sexp'] === 'number' ? payload['sexp'] : Number(payload['exp']);
|
|
133
|
+
if (!(sessionExpiresAt > nowSeconds())) return null;
|
|
134
|
+
const installationId = typeof payload['ins'] === 'string' ? payload['ins'] : null;
|
|
135
|
+
if (!(await verifyLocalSession({ username: payload['u'], sessionId: payload['sid'] }))) return null;
|
|
136
|
+
return {
|
|
137
|
+
app,
|
|
138
|
+
username: payload['u'],
|
|
139
|
+
sessionId: payload['sid'],
|
|
140
|
+
installationId,
|
|
141
|
+
expired,
|
|
142
|
+
expiresAt: Number(payload['exp']),
|
|
143
|
+
sessionExpiresAt,
|
|
144
|
+
};
|
|
145
|
+
} catch {
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Whether the console session behind a grant still exists. Throws when the session store cannot
|
|
152
|
+
* be read, so callers can tell "signed out" from "Redis briefly unavailable".
|
|
153
|
+
* @param {{ username: string, sessionId: string }} grant
|
|
154
|
+
*/
|
|
155
|
+
export async function frameSessionAlive(grant) {
|
|
156
|
+
return verifyLocalSession({ username: grant.username, sessionId: grant.sessionId });
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Split a request path into an embedded dashboard frame path, or return null.
|
|
161
|
+
* @param {string} pathname
|
|
162
|
+
*/
|
|
163
|
+
export function parseFramePath(pathname) {
|
|
164
|
+
for (const [app, base] of Object.entries(EMBEDDED_DASHBOARDS)) {
|
|
165
|
+
const prefix = `${base}/${FRAME_SEGMENT}/`;
|
|
166
|
+
if (!pathname.startsWith(prefix)) continue;
|
|
167
|
+
const rest = pathname.slice(prefix.length);
|
|
168
|
+
const slash = rest.indexOf('/');
|
|
169
|
+
const grant = slash === -1 ? rest : rest.slice(0, slash);
|
|
170
|
+
if (!grant) return null;
|
|
171
|
+
return {
|
|
172
|
+
app,
|
|
173
|
+
base,
|
|
174
|
+
grant,
|
|
175
|
+
frameBase: `${prefix}${grant}`,
|
|
176
|
+
upstreamPath: slash === -1 ? '/' : rest.slice(slash),
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
return null;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Split a catch-all route's segments (`[[...path]]`) into a grant and the upstream segments.
|
|
184
|
+
* @param {string[] | undefined} segments
|
|
185
|
+
* @returns {{ grant: string, rest: string[] } | null}
|
|
186
|
+
*/
|
|
187
|
+
export function splitFrameSegments(segments) {
|
|
188
|
+
if (!segments || segments[0] !== FRAME_SEGMENT || !segments[1]) return null;
|
|
189
|
+
return { grant: segments[1], rest: segments.slice(2) };
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Static build files a page may still load with an expired grant (lazily imported chunks, fonts,
|
|
194
|
+
* images): they carry no data and no authority. Everything else needs a current grant.
|
|
195
|
+
* @param {string} upstreamPath
|
|
196
|
+
*/
|
|
197
|
+
export function frameStaticAsset(upstreamPath) {
|
|
198
|
+
// Decided on the path exactly as it will be forwarded: no percent-encoding (the proxies decode
|
|
199
|
+
// once, and an upstream URL parser may decode and normalise again), no backslash, and no `.`,
|
|
200
|
+
// `..` or empty segments, in any spelling.
|
|
201
|
+
if (/[%\\?#]/.test(upstreamPath)) return false;
|
|
202
|
+
if (upstreamPath.slice(1).split('/').some((segment) => segment === '' || segment === '.' || segment === '..')) return false;
|
|
203
|
+
return /^\/(?:assets|fonts-terminal)\/[^?#]+$/.test(upstreamPath)
|
|
204
|
+
|| upstreamPath === '/favicon.ico'
|
|
205
|
+
|| /^\/dashboard-plugins\/[^?#]+\.(?:js|mjs|css|map|svg|png|woff2?)$/.test(upstreamPath);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* The upstream path for a frame request's decoded path segments, encoded so that no parser along
|
|
210
|
+
* the way can reinterpret it, or null when a segment is `.`, `..` or empty, or holds a slash,
|
|
211
|
+
* a backslash or a NUL (a traversal, once encoded or not). Every proxied request goes through it.
|
|
212
|
+
* @param {string[]} segments
|
|
213
|
+
*/
|
|
214
|
+
export function frameUpstreamPath(segments) {
|
|
215
|
+
for (const segment of segments) {
|
|
216
|
+
if (segment === '.' || segment === '..' || /[/\\\0]/.test(segment)) return null;
|
|
217
|
+
}
|
|
218
|
+
if (segments.slice(0, -1).some((segment) => segment === '')) return null;
|
|
219
|
+
const path = `/${segments.map((segment) => encodeURIComponent(segment)).join('/')}`;
|
|
220
|
+
// WHATWG URL parsing (undici, the Hermes HTTP client) must leave it exactly as it is.
|
|
221
|
+
return new URL(path, 'http://upstream.invalid').pathname === path ? path : null;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Decide a frame request: `allow` with a current grant (or an expired one for a static asset),
|
|
226
|
+
* `remint` for a navigation with an expired grant (the route re-mints it when the request also
|
|
227
|
+
* carries the console cookie for the same session), otherwise `refuse`.
|
|
228
|
+
* @param {{ grant: string, app: 'hermes' | 'router', method: string, headers: { get(name: string): string | null }, upstreamPath: string }} request
|
|
229
|
+
*/
|
|
230
|
+
export async function frameGrantDecision({ grant, app, method, headers, upstreamPath }) {
|
|
231
|
+
const verified = await verifyFrameGrant(grant, app, { allowExpired: true });
|
|
232
|
+
if (!verified) return { action: 'refuse', error: 'frame_grant_invalid', grant: null };
|
|
233
|
+
if (!verified.expired) return { action: 'allow', grant: verified };
|
|
234
|
+
const read = method === 'GET' || method === 'HEAD';
|
|
235
|
+
if (read && frameStaticAsset(upstreamPath)) return { action: 'allow', grant: verified };
|
|
236
|
+
if (read && headers.get('sec-fetch-mode') === 'navigate') return { action: 'remint', grant: verified };
|
|
237
|
+
return { action: 'refuse', error: 'frame_grant_expired', grant: verified };
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Whether a cookie-authenticated request may mint a frame grant. Only the console itself (a
|
|
242
|
+
* same-origin page) or the operator (a typed or bookmarked address) may: a sandboxed dashboard
|
|
243
|
+
* navigating to the entry URL is a cross-site request, so it cannot mint a grant for another
|
|
244
|
+
* installation. Clients without Fetch Metadata (curl, older browsers) are allowed.
|
|
245
|
+
* @param {{ get(name: string): string | null }} headers
|
|
246
|
+
*/
|
|
247
|
+
export function frameEntryAllowed(headers) {
|
|
248
|
+
if (headers.get('origin') === 'null') return false;
|
|
249
|
+
const site = headers.get('sec-fetch-site');
|
|
250
|
+
return site === null || site === 'same-origin' || site === 'none';
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Apply the isolation headers to a proxied dashboard response. An opaque-origin page sends
|
|
255
|
+
* `Origin: null`; the dashboards fetch with credentials, so CORS must name `null` exactly.
|
|
256
|
+
* These responses carry no console credential: the grant in the URL is the only authority.
|
|
257
|
+
* @param {Headers} headers
|
|
258
|
+
* @param {string | null} requestOrigin
|
|
259
|
+
*/
|
|
260
|
+
export function applyFrameHeaders(headers, requestOrigin) {
|
|
261
|
+
headers.set('content-security-policy', EMBED_CONTENT_SECURITY_POLICY);
|
|
262
|
+
headers.set('referrer-policy', 'no-referrer');
|
|
263
|
+
headers.set('x-content-type-options', 'nosniff');
|
|
264
|
+
headers.set('x-frame-options', 'SAMEORIGIN');
|
|
265
|
+
headers.delete('set-cookie');
|
|
266
|
+
if (requestOrigin === 'null') {
|
|
267
|
+
headers.set('access-control-allow-origin', 'null');
|
|
268
|
+
headers.set('access-control-allow-credentials', 'true');
|
|
269
|
+
}
|
|
270
|
+
headers.append('vary', 'Origin');
|
|
271
|
+
return headers;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Answer a CORS preflight for a frame path.
|
|
276
|
+
* @param {{ get(name: string): string | null }} requestHeaders
|
|
277
|
+
*/
|
|
278
|
+
export function framePreflightHeaders(requestHeaders) {
|
|
279
|
+
const headers = applyFrameHeaders(new Headers(), requestHeaders.get('origin'));
|
|
280
|
+
headers.set('access-control-allow-methods', 'GET, HEAD, POST, PUT, PATCH, DELETE');
|
|
281
|
+
const asked = requestHeaders.get('access-control-request-headers');
|
|
282
|
+
if (asked && /^[A-Za-z0-9-]+(\s*,\s*[A-Za-z0-9-]+)*$/.test(asked) && asked.length <= 1024) {
|
|
283
|
+
headers.set('access-control-allow-headers', asked);
|
|
284
|
+
}
|
|
285
|
+
headers.set('access-control-max-age', '600');
|
|
286
|
+
return headers;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Replace the sandboxed page's placeholder `token` query parameter (Hermes sends its session
|
|
291
|
+
* token that way on WebSockets and downloads) with the real token kept on the server.
|
|
292
|
+
* @param {string} search `URLSearchParams` text, with or without the leading `?`
|
|
293
|
+
* @param {string | null | undefined} token
|
|
294
|
+
*/
|
|
295
|
+
export function swapFrameToken(search, token) {
|
|
296
|
+
const params = new URLSearchParams(search);
|
|
297
|
+
if (token && params.get('token') === FRAME_TOKEN_PLACEHOLDER) params.set('token', token);
|
|
298
|
+
return params.toString();
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
// ── Server-side state per console session ───────────────────────────────────
|
|
302
|
+
// The Hermes session tokens and router cookies the sandboxed pages cannot hold. On globalThis
|
|
303
|
+
// under a registered symbol, so every route bundle and the TLS wrapper share one copy.
|
|
304
|
+
|
|
305
|
+
const STATE = Symbol.for('magnus.embeddedDashboardState');
|
|
306
|
+
const MAX_STATE_SESSIONS = 256;
|
|
307
|
+
|
|
308
|
+
/** @returns {Map<string, { username: string, expiresAt: number, hermesTokens: Map<string, string>, routerCookies: Map<string, string> }>} */
|
|
309
|
+
function stateStore() {
|
|
310
|
+
const holder = /** @type {Record<symbol, any>} */ (globalThis);
|
|
311
|
+
return (holder[STATE] ??= new Map());
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
function purgeExpiredState(store) {
|
|
315
|
+
const now = nowSeconds();
|
|
316
|
+
for (const [sessionId, entry] of store) if (entry.expiresAt <= now) store.delete(sessionId);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* The server-side state of one console session's embedded dashboards, created on first use.
|
|
321
|
+
* @param {{ sessionId: string, sessionExpiresAt: number, username: string }} grant
|
|
322
|
+
*/
|
|
323
|
+
export function frameSessionState(grant) {
|
|
324
|
+
const store = stateStore();
|
|
325
|
+
purgeExpiredState(store);
|
|
326
|
+
let entry = store.get(grant.sessionId);
|
|
327
|
+
if (entry) {
|
|
328
|
+
store.delete(grant.sessionId);
|
|
329
|
+
} else {
|
|
330
|
+
entry = { username: grant.username, expiresAt: grant.sessionExpiresAt, hermesTokens: new Map(), routerCookies: new Map() };
|
|
331
|
+
while (store.size >= MAX_STATE_SESSIONS) store.delete(store.keys().next().value);
|
|
332
|
+
}
|
|
333
|
+
entry.expiresAt = Math.max(entry.expiresAt, grant.sessionExpiresAt);
|
|
334
|
+
store.set(grant.sessionId, entry);
|
|
335
|
+
return entry;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* The state of a console session, or null; never creates one.
|
|
340
|
+
* @param {string} sessionId
|
|
341
|
+
*/
|
|
342
|
+
export function peekFrameSessionState(sessionId) {
|
|
343
|
+
const entry = stateStore().get(sessionId);
|
|
344
|
+
return entry && entry.expiresAt > nowSeconds() ? entry : null;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Forget a console session's dashboard state on sign-out.
|
|
349
|
+
* @param {string} sessionId
|
|
350
|
+
*/
|
|
351
|
+
export function clearFrameSessionState(sessionId) {
|
|
352
|
+
stateStore().delete(sessionId);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Forget every session of one console user (sign-out of all sessions); other users keep theirs.
|
|
357
|
+
* @param {string} username
|
|
358
|
+
*/
|
|
359
|
+
export function clearFrameUserState(username) {
|
|
360
|
+
const store = stateStore();
|
|
361
|
+
for (const [sessionId, entry] of store) if (entry.username === username) store.delete(sessionId);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/** Forget all dashboard state (tests). */
|
|
365
|
+
export function resetFrameState() {
|
|
366
|
+
stateStore().clear();
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* Inline script for every sandboxed page:
|
|
371
|
+
* - in an opaque origin `localStorage`, `sessionStorage` and `document.cookie` throw, so give the
|
|
372
|
+
* page per-document stand-ins;
|
|
373
|
+
* - renew the frame grant before it expires: ask the console frame (`postMessage` to the parent,
|
|
374
|
+
* echoing the current grant) and, once a new one arrives, send every later fetch, XHR,
|
|
375
|
+
* WebSocket and EventSource with it. In its own tab there is no console frame: when a fetch or
|
|
376
|
+
* XHR is refused with `frame_grant_expired`, the page reloads itself (a top-level navigation
|
|
377
|
+
* carries the console cookie, so the grant is re-minted), at most once a minute.
|
|
378
|
+
*/
|
|
379
|
+
export const FRAME_COMPAT_SCRIPT = '<script>(function(){'
|
|
380
|
+
+ 'function m(){var d=Object.create(null);return{get length(){return Object.keys(d).length},'
|
|
381
|
+
+ 'key:function(i){var k=Object.keys(d);return i<k.length?k[i]:null},'
|
|
382
|
+
+ 'getItem:function(k){k=String(k);return k in d?d[k]:null},'
|
|
383
|
+
+ 'setItem:function(k,v){d[String(k)]=String(v)},'
|
|
384
|
+
+ 'removeItem:function(k){delete d[String(k)]},clear:function(){d=Object.create(null)}}}'
|
|
385
|
+
+ "['localStorage','sessionStorage'].forEach(function(n){try{void window[n].length}catch(e){"
|
|
386
|
+
+ 'try{Object.defineProperty(window,n,{value:m(),configurable:true})}catch(_){}}});'
|
|
387
|
+
+ "try{void document.cookie}catch(e){try{Object.defineProperty(document,'cookie',"
|
|
388
|
+
+ "{get:function(){return''},set:function(){},configurable:true})}catch(_){}}"
|
|
389
|
+
+ "var g=(location.pathname.match(/\\/_frame\\/([^/?#]+)/)||[])[1];if(!g)return;"
|
|
390
|
+
+ "function x(t){try{return JSON.parse(atob(t.split('.')[1].replace(/-/g,'+').replace(/_/g,'/'))).exp||0}catch(e){return 0}}"
|
|
391
|
+
+ "function s(u){return typeof u==='string'?u.replace(/(\\/_frame\\/)[^/?#]+/,'$1'+g):u}"
|
|
392
|
+
+ 'var T=window.parent===window;'
|
|
393
|
+
// In its own tab: reload on an expired grant, rate-limited across reloads through window.name.
|
|
394
|
+
+ "function q(b){if(!T||String(b).indexOf('frame_grant_expired')<0)return;"
|
|
395
|
+
+ "var k='magnus-frame-reload:',n=String(window.name||''),t=n.indexOf(k)===0?+n.slice(k.length):0;"
|
|
396
|
+
+ 'if(Date.now()-t<60000)return;window.name=k+Date.now();location.reload()}'
|
|
397
|
+
+ 'var F=window.fetch;if(F)window.fetch=function(i,o){'
|
|
398
|
+
+ "if(typeof i==='string')i=s(i);else if(i instanceof URL)i=s(i.href);"
|
|
399
|
+
+ 'else if(i instanceof Request&&s(i.url)!==i.url)i=new Request(s(i.url),i);'
|
|
400
|
+
+ 'return F.call(this,i,o).then(function(r){if(T&&r.status===401)r.clone().text().then(q,function(){});return r})};'
|
|
401
|
+
+ 'var O=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=function(){'
|
|
402
|
+
+ "var a=[].slice.call(arguments);a[1]=s(String(a[1]));if(T)this.addEventListener('load',function(){"
|
|
403
|
+
+ 'try{if(this.status===401)q(this.responseText)}catch(_){}});return O.apply(this,a)};'
|
|
404
|
+
+ "['WebSocket','EventSource'].forEach(function(n){var C=window[n];if(!C)return;"
|
|
405
|
+
+ 'var P=function(u,p){return arguments.length>1?new C(s(String(u)),p):new C(s(String(u)))};'
|
|
406
|
+
+ "P.prototype=C.prototype;['CONNECTING','OPEN','CLOSING','CLOSED'].forEach(function(k){if(k in C)P[k]=C[k]});"
|
|
407
|
+
+ 'window[n]=P});'
|
|
408
|
+
// Links baked with an older grant follow the current one.
|
|
409
|
+
+ "document.addEventListener('click',function(e){var a=e.target&&e.target.closest&&e.target.closest('a[href]');"
|
|
410
|
+
+ 'if(a&&a.href&&s(a.href)!==a.href)a.href=s(a.href)},true);'
|
|
411
|
+
+ 'if(T)return;'
|
|
412
|
+
+ "window.addEventListener('message',function(e){var d=e.data;"
|
|
413
|
+
+ "if(e.source!==window.parent||!d||d.type!=='magnus-frame-grant'||typeof d.grant!=='string')return;"
|
|
414
|
+
+ "g=d.grant;try{history.replaceState(history.state,'',s(location.href))}catch(_){}"
|
|
415
|
+
+ "window.dispatchEvent(new Event('magnus:frame-grant'))});"
|
|
416
|
+
+ "function r(){if(x(g)*1000-Date.now()<" + String(FRAME_GRANT_TTL_SECONDS * 500) + ')'
|
|
417
|
+
+ "window.parent.postMessage({type:'magnus-frame-refresh',grant:g},'*')}"
|
|
418
|
+
+ 'r();setInterval(r,15000)'
|
|
419
|
+
+ '})();</script>';
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Page for a navigation inside the console frame whose grant has expired (the frame's own
|
|
423
|
+
* reload carries no console cookie): ask the console frame for a new grant, then load the same
|
|
424
|
+
* address with it. It asks again every 3 seconds, up to 20 times, until a grant arrives or the
|
|
425
|
+
* console answers that it cannot mint one; then it says so.
|
|
426
|
+
*/
|
|
427
|
+
export const FRAME_RECONNECT_PAGE = '<!doctype html><html><head><meta charset="utf-8"><title>Reconnecting</title>'
|
|
428
|
+
+ '<script>(function(){var g=(location.pathname.match(/\\/_frame\\/([^/?#]+)/)||[])[1];'
|
|
429
|
+
+ "if(!g||window.parent===window)return;var n=0,i;function stop(m){clearInterval(i);"
|
|
430
|
+
+ "var p=document.getElementById('state');if(p)p.textContent=m}"
|
|
431
|
+
+ "window.addEventListener('message',function(e){var d=e.data;if(e.source!==window.parent||!d)return;"
|
|
432
|
+
+ "if(d.type==='magnus-frame-refused'){stop('The console could not renew the dashboard session. Reconnect the frame from the console.');return}"
|
|
433
|
+
+ "if(d.type!=='magnus-frame-grant'||typeof d.grant!=='string')return;clearInterval(i);"
|
|
434
|
+
+ "location.replace(location.href.replace(/(\\/_frame\\/)[^/?#]+/,'$1'+d.grant))});"
|
|
435
|
+
+ "function ask(){if(++n>20){stop('The dashboard session expired. Reconnect the frame from the console.');return}"
|
|
436
|
+
+ "window.parent.postMessage({type:'magnus-frame-refresh',grant:g},'*')}"
|
|
437
|
+
+ "ask();i=setInterval(ask,3000)})();</script></head>"
|
|
438
|
+
+ '<body><p id="state">The dashboard session expired. Reconnecting.</p></body></html>';
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* Insert {@link FRAME_COMPAT_SCRIPT} before any of the page's own scripts.
|
|
442
|
+
* @param {string} html
|
|
443
|
+
*/
|
|
444
|
+
export function injectFrameCompat(html) {
|
|
445
|
+
const head = /<head(\s[^>]*)?>/i.exec(html);
|
|
446
|
+
if (head) return html.slice(0, head.index + head[0].length) + FRAME_COMPAT_SCRIPT + html.slice(head.index + head[0].length);
|
|
447
|
+
const doctype = /^\s*<!doctype[^>]*>/i.exec(html);
|
|
448
|
+
if (doctype) return doctype[0] + FRAME_COMPAT_SCRIPT + html.slice(doctype[0].length);
|
|
449
|
+
return FRAME_COMPAT_SCRIPT + html;
|
|
450
|
+
}
|
|
@@ -38,7 +38,7 @@ export const dashboardEnvironmentSchema = Object.freeze({
|
|
|
38
38
|
SSH_HOST_KEY_PINNING: string({ default: 'enforce', purpose: 'Terminal SSH host-key pinning: enforce refuses a host whose key differs from the pinned one; warn only logs the mismatch and connects anyway (never use warn in production). Any other value means enforce.' }),
|
|
39
39
|
SSH_HOST_KEYS_FILE: path({ default: 'terminal-audit/known-hosts.json', purpose: 'Pinned terminal SSH host keys (trust on first use), relative to the working directory.' }),
|
|
40
40
|
TERMINAL_AUDIT_DIR: path({ default: 'terminal-audit', purpose: 'Directory of the terminal host-key trust audit log, relative to the working directory.' }),
|
|
41
|
-
DASHBOARD_DEPENDENCY_TIMEOUT_MS: integer({ default: 8_000, minimum: 1, purpose: 'Timeout of console requests to the Control API and
|
|
41
|
+
DASHBOARD_DEPENDENCY_TIMEOUT_MS: integer({ default: 8_000, minimum: 1, purpose: 'Timeout of console requests to the Control API and the Emberpath admin plane, in milliseconds.' }),
|
|
42
42
|
MAGNUS_CONTROL_NODES_CONFIG_DIR: path({ optional: true, purpose: 'Test-only override of the control-node registry directory; honoured only with NODE_ENV=test (otherwise .magnus/ in the working directory).' }),
|
|
43
43
|
DASHBOARD_SSH_PRIVATE_KEY_PATH: path({ optional: true, requirement: 'Required for the terminal and Hermes proxy (or DASHBOARD_SSH_PASSWORD)', purpose: 'Restricted dashboard-proxy private key with no deployment privileges.' }),
|
|
44
44
|
NEXT_PUBLIC_API_URL: url({ default: 'https://localhost:4000', public: true, purpose: 'Legacy build-time Control API URL; must never contain a secret.' }),
|
|
@@ -36,7 +36,7 @@ export function securityConsoleUrl(env = process.env) {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
39
|
+
* Admin-plane base URL of an older Emberpath release (HIVE_ROUTER_ADMIN_URL), or null. Deprecated.
|
|
40
40
|
* @param {Record<string, string | undefined>} [env]
|
|
41
41
|
*/
|
|
42
42
|
export function hiveRouterAdminUrl(env = process.env) {
|
|
@@ -44,7 +44,7 @@ export function hiveRouterAdminUrl(env = process.env) {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
|
-
* Named
|
|
47
|
+
* Named OIDC login (for example Oathweave) is configured.
|
|
48
48
|
* @param {Record<string, string | undefined>} [env]
|
|
49
49
|
*/
|
|
50
50
|
export function hiveLoginConfigured(env = process.env) {
|
|
@@ -81,8 +81,8 @@ export function describeIntegrations(env = process.env) {
|
|
|
81
81
|
const flags = readIntegrations(env);
|
|
82
82
|
return [
|
|
83
83
|
{ name: 'Security console', enabled: flags.securityConsoleUrl !== null, via: 'MAGNUS_SECURITY_CONSOLE_URL' },
|
|
84
|
-
{ name: '
|
|
85
|
-
{ name: '
|
|
84
|
+
{ name: 'Emberpath admin (deprecated)', enabled: flags.hiveRouter, via: 'HIVE_ROUTER_ADMIN_URL' },
|
|
85
|
+
{ name: 'OIDC login', enabled: flags.hiveLogin, via: 'HIVE_OAUTH_* + DASHBOARD_PUBLIC_ORIGIN' },
|
|
86
86
|
{ name: 'Hermes Agent', enabled: flags.hermes, via: 'MAGNUS_HERMES_ENABLED=true' },
|
|
87
87
|
];
|
|
88
88
|
}
|