Headless pakket src/cms-client met importgrens, formulier dat pas verschijnt als de API antwoordt (anders blijft de mailto-knop), honeypot, idempotentie, token-vernieuwing en property-based tests. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
4.5 KiB
4.5 KiB
Infrastructure Design — contact-form (U4)
The frontend introduces no new infrastructure. The form needs only the same-origin API prefix that the offerings call already uses.
Confirmed
- The example nginx configs in
aidlc-docs/features/react-frontend/operations/deployment/nginx/only show/to the web server and/sentry-tunnel; they contain no/api/v1/location and no security-header directives. That repository documentation may be outdated compared with the real Pi configuration. - The user: SLP Software already has an API that does not have to move.
- The session "CMS & API" (2026-11-10): the release going to production now contains no contact routes; they arrive with the contact feature and are switched on in production only after Bryan's go.
Confirmed later the same day (via "CMS & API", from Pi-Main and the CMS code at 2818b74)
- The SLP .NET apps listen on Pi-Main: test
:5100, production:5101(0.0.0.0, ufw only allows 192.168.1.102, the proxy Pi "Pi-Entry"). TLS ends on Pi-Entry; the app seeshttpwithHost: test.slpsoftware.nl/slpsoftware.nl. - Pi-Main's journal shows requests under both
/api/v1and/reaching the same .NET app, so/api/v1/evidently reaches the app on test; the real Pi-Entry config is not visible to the AI sessions. - Pi-Main's nginx sets no security headers for the SLP sites (only
Cache-Control: publicon static assets). The CMS host sets them itself (SecurityHeadersMiddleware, optionsSecurityHeaders: Enabled, DefaultPolicy Relaxed, PathPolicies with/admin,/api/v1,/health= Strict, AllowedScriptOrigins, AllowedConnectOrigins; CSP definitions in code;TryAdd, so headers set earlier by nginx win). Pi-Entry may set headers too (unknown). Api.SlpSoftwareserves/only as SPA fallback fromwwwroot/webwhen present (WebsiteMode SpaFallback); only the Andrea host runs PrerenderedPages.
Still unconfirmed (do not treat as fact)
- Which application delivers the public pages of slpsoftware.nl today (the CMS
wwwroot/webfallback or a separate static web server) and therefore which header policy applies to the HTML of this site; the site CSP below applies to that delivering server (for the CMS host:SecurityHeaders:DefaultPolicyandAllowedScriptOrigins/AllowedConnectOriginsmust allow the Umami host). - The Pi-Entry configuration (routing of
/api/v1/vs/, headers). To be confirmed by the user; the form itself only needsconnect-src 'self'because/api/v1is on the same host.
Required configuration (for deployment / Operations list)
- Reverse proxy:
/api/v1/must be forwarded as a prefix to the existing SLP API (no new route if that is already the case), preservingHost,X-Forwarded-For,X-Forwarded-Proto; request body limit of at least 32 KB; no response caching for/api/v1/offeringsand/api/v1/contact-messages*. The API needs the real client IP for per-client rate limiting (ForwardedHeaders:KnownProxieson the API host). - Security headers (SECURITY-04) on HTML responses, if not present yet:
Content-Security-Policy(e.g.default-src 'self'; script-src 'self' <umami-host>; connect-src 'self' <umami-host>; img-src 'self' data:; style-src 'self' 'unsafe-inline'; font-src 'self'; frame-ancestors 'none'),Strict-Transport-Security: max-age=31536000; includeSubDomains,X-Content-Type-Options: nosniff,X-Frame-Options: DENY,Referrer-Policy: strict-origin-when-cross-origin. The form itself needs onlyconnect-src 'self'; fonts are self-hosted;/theme-init.jsis same-origin.style-src 'unsafe-inline'is needed for inline style attributes (progress bars) and is an accepted, documented exception until those are replaced. - Environment: no new variables.
VITE_API_BASE_URLstays a local-development override only. - Switches: the form appears only when the CMS host switch
Contact:Enabledand the CMS switch are both on (token route answers 200); enabling is an Operations step after per-client rate limiting is on the API host. - Observability: Umami events
contact-sent/contact-failed(no data); Sentry without bodies; reverse-proxy access logging is an Operations item (SECURITY-02).
Security Baseline — Infrastructure scope
SECURITY-04: open until confirmed (unknown whether the real servers set the headers; the repository examples do not). Tracked for Operations (still undecided) and flagged to the user. SECURITY-07: only 80/443 exposed by the reverse proxy; the API upstream stays internal. Other rules N/A for this unit.