Skip to content

Document Content-Security-Policy directives for the widget - #2

Merged
stromcom merged 1 commit into
masterfrom
feature/csp-support
Aug 7, 2026
Merged

Document Content-Security-Policy directives for the widget#2
stromcom merged 1 commit into
masterfrom
feature/csp-support

Conversation

@stromcom

@stromcom stromcom commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Řeší část stromcom/www.stromcom.cz#10 týkající se React balíčku. Jen dokumentace, žádná změna kódu.

Co přibylo do README

  • sekce Content Security Policy se seznamem direktiv pro produkci i staging
  • explicitní věta, že 'unsafe-inline' pro script-src potřeba není — provider vkládá loader přes createElement('script') v useEffect, na rozdíl od stromcom/php-snippet, který generuje inline <script>
  • „co povolovat nemusíte" — avatary, přílohy, fonty a media se načítají uvnitř iframu na naší origin, takže se na ně CSP hostitelské stránky nevztahuje
  • Next.js blok přes next.config.js headers(); 'unsafe-inline' v něm jsou vlastní požadavky Next.js, ne naše, a je to v komentáři označené
  • řádka do troubleshootingu

Ověřeno

Seznam direktiv je ověřený Playwright testem proti stránce s reálně vynucenou striktní CSP (default-src 'none'), ne odvozený od stolu. Lokálně prošly všechny kroky CI: lint, format:check, test (26 testů), build.

Adds a Content Security Policy section covering the production and staging
origins the customer page must allow (script-src, connect-src, style-src,
img-src, frame-src), spells out that neither script-src nor style-src needs
'unsafe-inline', and clarifies that avatars, attachments, fonts and media
load inside the iframe and are covered by the app-domain policy.

Includes a copy-paste next.config.js headers() block and a troubleshooting
entry for CSP violations.

Refs stromcom/www.stromcom.cz#10
@stromcom
stromcom merged commit 55a1749 into master Aug 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant