diff --git a/aidlc-docs/features/contact-form-cms/construction/contact-form/privacy-statement-draft.md b/aidlc-docs/features/contact-form-cms/construction/contact-form/privacy-statement-draft.md new file mode 100644 index 0000000..ed0d763 --- /dev/null +++ b/aidlc-docs/features/contact-form-cms/construction/contact-form/privacy-statement-draft.md @@ -0,0 +1,36 @@ +# Privacy statement: draft text for the contact form (needs Bryan's approval) + +Status: DRAFT. Nothing of this is in the site yet: the page `/privacyverklaring` is still the placeholder "Deze pagina is nog in de maak". The text is site copy in Dutch, so Bryan (and Andrea, as the controller) decide the wording. Items marked **[CHECK]** are facts that must be confirmed before publishing; they are not guessed here. + +## What the form sends and stores (from the API contract v0.3.x) +- Sent: name, e-mail address, the chosen shoot (the readable label, e.g. "Newborn"), the message, a signed time token, and (when the captcha is on) the captcha response. +- Stored by the CMS: the four fields, the time of receipt, a status and the mail status. **No IP address is stored** by the contact module (contract section 4.2). Retention period: **[CHECK]** (`retentionUntil` is fixed per message from the server setting; the value for ASF is not decided yet). +- Mail: each message is sent to Andrea's mailbox. **[CHECK]** mail provider and where it processes the data. +- The reply: Andrea answers by e-mail to the address given. + +## Captcha (only when switched on) +- Provider: Friendly Captcha (Friendly Captcha GmbH, Germany). Region: the server decides. With the **global** endpoint (free key, tests only) the visitor's IP address can be processed outside the EU; the EU endpoint (`eu`, paid plan) keeps it in the EU. According to the provider the widget uses no cookies and does no tracking (Bryan's note via SLS-Main). **[CHECK]** exactly what the widget sends to the provider (quote the provider's privacy documentation) and whether a processing agreement is needed. +- Commercial use of the free tier is not allowed (Bryan's note): the captcha stays off in production until a paid plan exists, so this paragraph is only published together with the captcha. + +## Draft text (Dutch) + +### Contactformulier +Als je het contactformulier gebruikt, verwerk ik de gegevens die je invult: je naam, je e-mailadres, de soort shoot waarvoor je interesse hebt en je bericht. Ik gebruik die gegevens alleen om te reageren op je vraag. Het bericht wordt opgeslagen in het beheersysteem van deze website en als e-mail naar mij gestuurd. Je IP-adres wordt daarbij niet bewaard. Ik bewaar je bericht **[CHECK: bewaartermijn]** en verwijder het daarna. + +Je kunt me ook gewoon mailen via de knop onder het formulier; dan gebruik je het formulier niet. + +### Beveiliging tegen spam +Om spam tegen te gaan gebruikt het formulier een onzichtbaar veld en een korte wachttijd voordat je kunt versturen. **[Alleen bij ingeschakelde captcha:]** Daarnaast controleert de dienst Friendly Captcha (Friendly Captcha GmbH, Duitsland) of je een persoon bent. Volgens de aanbieder gebruikt die controle geen cookies en volgt hij je niet. Daarbij wordt wel je IP-adres naar de dienst gestuurd. **[Bij het gratis `global`-endpoint kan dat buiten de EU verwerkt worden; bij het EU-endpoint blijft het binnen de EU. Kies de zin die past.]** **[CHECK: welke gegevens deze dienst precies ontvangt, dit uit hun privacyinformatie overnemen]** + +### Je rechten +Je kunt me vragen welke gegevens ik van je heb, ze te laten corrigeren of verwijderen. Mail daarvoor naar het adres onder het formulier. + +## Where it appears +1. `PrivacyNote` under the form already links to `/privacyverklaring`; no change to that line is needed. +2. The page `routes/privacyverklaring.tsx` still has to be written; this draft is the part about the form. A full privacy statement (analytics: Umami without cookies, Sentry, hosting) is a separate piece of content. + +## Questions for Bryan (via SLP Software - SLS - Main) +1. Retention period of contact messages for ASF (server setting `retentionUntil`). +2. Is Andrea the controller, and which contact address goes into the text? +3. Approve the wording, or change it. +4. The privacy page is still a placeholder: should the full privacy page be a separate feature, and is the form allowed to go live (test only) before it exists? diff --git a/aidlc-docs/features/contact-form-cms/construction/plans/contact-form-code-generation-plan.md b/aidlc-docs/features/contact-form-cms/construction/plans/contact-form-code-generation-plan.md index 6a1a754..81943c8 100644 --- a/aidlc-docs/features/contact-form-cms/construction/plans/contact-form-code-generation-plan.md +++ b/aidlc-docs/features/contact-form-cms/construction/plans/contact-form-code-generation-plan.md @@ -17,7 +17,7 @@ Order matters: steps 1-2 can start with the current package (without captcha); t - [x] **9. Final package** (after SLS-Main's message): replace `src/cms-client/` by the final version (captcha slot, `initialSubject`); re-run boundary and package tests. - [x] **10. CaptchaWidget**: new lazy chunk `src/components/ContactForm/CaptchaWidget.tsx` using `@friendlycaptcha/sdk` (`createWidget`, `startMode: focus`, `language: nl`, `apiEndpoint` per Bryan's host choice); complete -> `setCaptchaToken(response)`; expire/error -> `setCaptchaToken(null)` and `reset()`; `destroy()` on unmount; reserved height; add the pinned dependency (check `minimumReleaseAge` rules of pnpm). Tests with a fake SDK: expired token not sent, error resets, unsupported or missing provider keeps the gate, submit blocked with message until solved. - [x] **11. Preselect with `initialSubject`**: Panel passes the remembered preselect to the form, the form to the hook; test "Boek..." before the form is mounted. -- [ ] **12. Privacy text**: PrivacyNote and the privacy page name the captcha provider and what the form stores (wording needs Bryan's approval; draft goes to SLS-Main for routing). +- [x] **12. Privacy text (draft, for Bryan's approval; not in the site)**: PrivacyNote and the privacy page name the captcha provider and what the form stores (wording needs Bryan's approval; draft goes to SLS-Main for routing). - [ ] **13. PBT and e2e**: fast-check properties (PBT-02/03/07/08/09) for the label/payload mapping and trim; e2e with a mocked `/api` route: token 200 -> form, 404 -> gate, 202 success, 400 expired -> retry, prerendered HTML check; extend `noJs` e2e (gate and mail button without JS). - [ ] **14. Documentation**: update `LAYOUT.md` if the contact block changes; README note for the copied package (source and sync rule); `aidlc-docs` code summary. - [ ] **15. Automatic build and test (Step 13.5)**: `pnpm` typecheck, lint, unit tests, e2e where available, build and prerender; fix and repeat; report any decision only Bryan can make. diff --git a/web/config/securityHeaders.test.ts b/web/config/securityHeaders.test.ts index b51c328..0a47e65 100644 --- a/web/config/securityHeaders.test.ts +++ b/web/config/securityHeaders.test.ts @@ -3,6 +3,11 @@ import { contentSecurityPolicy, securityHeaders } from './securityHeaders'; const umami = 'https://analytics.slpsoftware.nl'; const sentry = 'https://o4511795618185216.ingest.de.sentry.io'; +const captchaFrames = [ + 'https://global.frcapi.com', + 'https://global0.frcapi.com', + 'https://global1.frcapi.com', +]; const directive = (csp: string, name: string) => csp.split('; ').find((d) => d.startsWith(name + ' ')) ?? ''; @@ -21,19 +26,35 @@ describe('securityHeaders', () => { it('productie-CSP opent alleen Umami en Sentry, op de juiste plekken (M7)', () => { const csp = contentSecurityPolicy('production'); const externalHosts = new Set(csp.match(/https:\/\/[^\s;]+/g)); - expect([...externalHosts].sort()).toEqual([sentry, umami].sort()); + expect([...externalHosts].sort()).toEqual( + [sentry, umami, ...captchaFrames].sort(), + ); expect(directive(csp, 'connect-src')).toBe( `connect-src 'self' ${umami} ${sentry}`, ); - // Alleen script-src en connect-src noemen een externe host + // Alleen script-src, connect-src en frame-src noemen een externe host for (const d of csp.split('; ')) { - if (!/^(script|connect)-src /.test(d)) { + if (!/^(script|connect|frame)-src /.test(d)) { expect(d).not.toContain('https://'); } } expect(csp).not.toContain('*'); }); + it('productie-CSP laat het captcha-venster alleen van de drie vaste hosts toe', () => { + const csp = contentSecurityPolicy('production'); + expect(directive(csp, 'frame-src')).toBe( + `frame-src ${captchaFrames.join(' ')}`, + ); + // Geen wildcard en niets extra's totdat een echte browser het eist + expect(csp).not.toContain('*'); + expect(directive(csp, 'script-src')).toBe(`script-src 'self' ${umami}`); + expect(directive(csp, 'worker-src')).toBe(''); + expect(directive(csp, 'connect-src')).toBe( + `connect-src 'self' ${umami} ${sentry}`, + ); + }); + it('dev-CSP voegt alleen toe wat Vite nodig heeft', () => { const csp = contentSecurityPolicy('development'); expect(directive(csp, 'script-src')).toBe( diff --git a/web/config/securityHeaders.ts b/web/config/securityHeaders.ts index 8575f7b..cf7766a 100644 --- a/web/config/securityHeaders.ts +++ b/web/config/securityHeaders.ts @@ -8,6 +8,19 @@ type Mode = 'production' | 'development'; // Chakra/Emotion zetten tijdens runtime