refactor(gateway): share Control UI bootstrap contract and CSP

This commit is contained in:
Peter Steinberger
2026-02-16 03:35:11 +01:00
parent 6e7c1c16e7
commit c6e6023e3a
4 changed files with 42 additions and 18 deletions

View File

@@ -0,0 +1,15 @@
export function buildControlUiCspHeader(): string {
// Control UI: block framing, block inline scripts, keep styles permissive
// (UI uses a lot of inline style attributes in templates).
return [
"default-src 'self'",
"base-uri 'none'",
"object-src 'none'",
"frame-ancestors 'none'",
"script-src 'self'",
"style-src 'self' 'unsafe-inline'",
"img-src 'self' data: https:",
"font-src 'self'",
"connect-src 'self' ws: wss:",
].join("; ");
}