mirror of
https://github.com/kjanat/livedash-node.git
synced 2026-01-16 10:52:08 +01:00
feat: implement cache layer, CSP improvements, and database performance optimizations
- Add Redis cache implementation with LRU eviction - Enhance Content Security Policy with nonce generation - Optimize database queries with connection pooling - Add cache invalidation API endpoints - Improve security monitoring performance
This commit is contained in:
@ -3,7 +3,7 @@ import { NextRequest } from "next/server";
|
||||
import { middleware } from "@/middleware";
|
||||
|
||||
// Mock the CSP utilities
|
||||
vi.mock("@/lib/csp", () => ({
|
||||
vi.mock("@/lib/csp-server", () => ({
|
||||
buildCSP: vi.fn(({ nonce, isDevelopment, reportUri }) => {
|
||||
const base = "default-src 'self'; object-src 'none'";
|
||||
const script = isDevelopment
|
||||
|
||||
@ -1,12 +1,11 @@
|
||||
import { describe, it, expect, beforeEach } from "vitest";
|
||||
import {
|
||||
buildCSP,
|
||||
validateCSP,
|
||||
testCSPImplementation,
|
||||
generateNonce,
|
||||
detectCSPBypass,
|
||||
type CSPConfig,
|
||||
} from "../../lib/csp";
|
||||
import { buildCSP, generateNonce } from "../../lib/csp-server";
|
||||
import { cspMonitoring } from "../../lib/csp-monitoring";
|
||||
|
||||
describe("Enhanced CSP Implementation", () => {
|
||||
|
||||
Reference in New Issue
Block a user