Setup CSP to allow Snowplow Micro in development env
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
- Enable Snowplow Micro:
$ export SNOWPLOW_MICRO_ENABLE=1
- Restart GDK:
$ gdk restart
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Eugie Limpin