Cross-Cutting Concerns & Shared Infrastructure
Authentication, Sessions, MFA & RBAC
- No user authentication, JWTs, MFA, or RBAC exist in this repository. All web pages and JSON endpoints are public.
- PHP Sessions (
i18n.php:8-15): Used exclusively to persist UI language ($_SESSION['lang']). Configured withHttpOnly=1,SameSite=Lax, andSecure=1when$_SERVER['HTTPS']is on. Waitlist API endpoints (waitlist-handler.php,waitlist-qualify-handler.php) andsitemap.phpare completely stateless (do not start sessions). - Service-to-Service Auth:
contact-handler.php,includes/blog-repository.php,status.phpauthenticate to Supabase usingsupabase.key(anon/public key relying on RLS).includes/waitlist.phpauthenticates to Supabase usingwaitlist.supabase_service_key(service_role, bypassing RLS) and to Resend usingresend.api_key(Bearer token).- Step 2 waitlist authorization uses a cryptographically random 32-byte bearer token (SHA-256 hashed in DB, 24h TTL, single-use atomic CAS).
Multi-Tenancy & Data Isolation
- Single-tenant public marketing platform: No tenant/company scoping, org switching, or tenant JWTs exist in
planovi-webpage. - Database Schema Isolation (
supabase/website_schema.sql): Marketing tables reside in a dedicated PostgreSQLwebsiteschema (website.website_form_messages,website.waitlist,website.blog_posts) separate from core multi-tenant platform tables inpublic(exceptstatus.php, which readspublic.app_modules+public.app_modules_maintenance). - RLS Summary (
supabase/website_schema.sql):website.website_form_messages:anon/authenticated→INSERTonly (WITH CHECK (true));service_role→ALL.website.waitlist:service_role→ALL;anon/authenticated→ completely denied.website.blog_posts:anon/authenticated→SELECTwhereis_published = true;service_role→ALL.storage.objects(blog-media):anon/authenticated→SELECT;service_role→ALL.
Branding Rules (Zone 1 vs. Zone 2) & i18n (pl / en)
- Zone 1 (100% of
planovi-webpage):- Neutral graphite dark mode (
#09090Bmain,#121215secondary,rgba(20,20,24,0.72)glass cards) and crisp zinc light mode (#FAFAFAmain,#F4F4F5secondary,rgba(255,255,255,0.88)glass cards). - Brand accent
#32CA42(--brand-solid, Dark Mode text/borders) and#22A830(Light Mode text/links for WCAG AA). - WCAG AAA button rule:
#09090Bforeground on#32CA42solid controls (9.4:1 contrast). - Official SVG wordmark (
assets/brand/planovi-logo-currentcolor.svg) viacomponents/brand-logo.php; no.logo-dotrecreation. - Legacy CSS variable aliases
--tealand--teal-gloware preserved incss/style.css:26-27,55-56mapped directly tovar(--brand)/var(--brand-glow).
- Neutral graphite dark mode (
- Zone 2 (Not rendered here, documented in
BRANDING_GUIDE.md): White-label tenant widgets inplanovi-microservices/planovi-flutter-appuse dynamic--tenant-primaryand WCAG luminance contrast (lum > 0.42 ? #09090B : #FFFFFF). - i18n (
pl/en): JSON dictionaries inlang/pl.jsonandlang/en.json(213 lines each). Default'pl'. Switchable via?lang=pl|enwith302clean redirect and 30-daylangcookie. Blog articles override<html lang>with$post['lang']and switch across localized slugs viatranslation_key.
Global Error Handling, Logging, Retry/Timeout Policies & Security Guards
- Outbound HTTP Timeouts (cURL):
- Cloudflare Turnstile
siteverify:10s(includes/waitlist.php:116,contact-handler.php:76). - Supabase PostgREST:
10sfor waitlist/contact/status (includes/waitlist.php:173,contact-handler.php:137,status.php:22);8sfor blog list/post (includes/blog-repository.php:62,107);4sfor blog translation lookup (includes/blog-repository.php:136). - Google Chat webhook:
10s(contact-handler.php:166). - Resend API:
5s(includes/waitlist.php:232).
- Cloudflare Turnstile
- Retry Policies:
- Server-side: Zero automatic retries on external HTTP failures (waitlist handles
409insert race by performing oneGET+PATCHrecovery). - Client-side:
js/script.js:271-279andjs/waitlist.js:17-19perform 1 retry ofPOSTtoresponse.urlif the server returned an HTTP redirect (response.redirected).
- Server-side: Zero automatic retries on external HTTP failures (waitlist handles
- Logging Policy:
- Only
includes/waitlist.phpwrites structured server logs viaerror_log('[waitlist] ...')(PII-free and secret-free). contact-handler.php,includes/blog-repository.php, andstatus.phpperform zeroerror_log()calls on cURL/API failures.
- Only
- Security Guards:
- Fail-closed Cloudflare Turnstile on both forms (waitlist also enforces
action,hostname, and token<= 2048bytes). - Baseline HTTP security headers via
send_security_headers()on all pages includingi18n.php(missing onsitemap.phpand waitlist JSON endpoints). - Open Redirect guard on
?lang=redirect (i18n.php:41). - PostgREST filter sanitization + slug regex validation + DOMDocument HTML sanitizer (
includes/security.php— note DOM-unwrapping XSS bugBR-SEC-06).
- Fail-closed Cloudflare Turnstile on both forms (waitlist also enforces