Skip to content

Setup CSP to allow Snowplow Micro in development env

Eugie Limpin requested to merge snowplow-micro-csp into master

What does this MR do and why?

Add the URI of Snowplow Micro to connect-src CSP directive when in development environment and Snowplow Micro is enabled (using ENV[SNOWPLOW_MICRO_ENABLE]). This saves us from manually updating the CSP directive as described in this Snowplow Micro troubleshooting guide.

How to set up and validate locally

  1. Enable Snowplow Micro: $ export SNOWPLOW_MICRO_ENABLE=1
  2. Restart GDK: $ gdk restart
  3. Open Chrome Developer Tools Console and validate that there are no CSP errors that look like:
    Refused to connect to 'http://localhost:9090/com.snowplowanalytics.snowplow/tp2' because it violates the following Content Security Policy directive: "connect-src 'self' http://127.0.0.1:3808 ws://127.0.0.1:3808 ws://127.0.0.1:3000".

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Eugie Limpin

Merge request reports