feat: tablero como Server Component, CSP y stores sin re-render
La página /tablero lee sesión y trae módulos (15s) + stats (30s) en el servidor; TableroView recibe props y el navegador ya no pollea al deployer. CSP endurecido compatible con estáticas (connect/form/img acotados, sin exfiltración externa). Logout limpia el usuario cacheado, los stores comparan contenido antes de notificar y formato en actualizar.
This commit is contained in:
1 parent
926d41dc51
commit
ab6a5a148c
7 files changed
+111
-32
No files matched your search
@@ -3,6 +3,25 @@ import type { NextConfig } from "next";
|
||||
const nextConfig: NextConfig = {
|
||||
output: "standalone",
|
||||
async headers() {
|
||||
// CSP de endurecimiento compatible con páginas estáticas.
|
||||
// Sin nonces a propósito: los nonces exigen render dinámico en
|
||||
// todas las páginas (rompería el caché del índice) y style-src
|
||||
// estricto bloquearía los `style` inline de la UI. `connect-src`,
|
||||
// `form-action` e `img-src` acotan el impacto de un XSS
|
||||
// (sin exfiltración a orígenes externos).
|
||||
const csp = [
|
||||
"default-src 'self'",
|
||||
"script-src 'self' 'unsafe-inline'",
|
||||
"style-src 'self' 'unsafe-inline'",
|
||||
"img-src 'self' data: blob:",
|
||||
"font-src 'self' data:",
|
||||
"connect-src 'self'",
|
||||
"object-src 'none'",
|
||||
"base-uri 'self'",
|
||||
"form-action 'self'",
|
||||
"frame-ancestors 'none'",
|
||||
"upgrade-insecure-requests",
|
||||
].join("; ");
|
||||
return [
|
||||
{
|
||||
source: "/:path*",
|
||||
@@ -10,6 +29,7 @@ const nextConfig: NextConfig = {
|
||||
{ key: "X-Content-Type-Options", value: "nosniff" },
|
||||
{ key: "Referrer-Policy", value: "strict-origin-when-cross-origin" },
|
||||
{ key: "X-Frame-Options", value: "DENY" },
|
||||
{ key: "Content-Security-Policy", value: csp },
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
Reference in new issue
Block a user