Skip to content
Snippets Groups Projects
Unverified Commit f36b9efa authored by Noah Moss's avatar Noah Moss Committed by GitHub
Browse files

Override IP address in Snowplow logging (#20082)

parent d31fac77
No related branches found
No related tags found
No related merge requests found
......@@ -79,6 +79,8 @@
[user-id]
(-> (Subject$SubjectBuilder.)
(.userId (str user-id))
;; Override with localhost IP to avoid logging actual user IP addresses
(.ipAddress "127.0.0.1")
.build))
(def ^:private schema->version
......
......@@ -79,6 +79,13 @@
:token-features (public-settings/token-features)}}
(:context (first @*snowplow-collector*)))))))
(deftest ip-address-override-test
(testing "IP address on Snowplow subject is overridden with a dummy value (127.0.0.1)"
(with-fake-snowplow-collector
(snowplow/track-event! ::snowplow/dashboard-created 1 {:dashboard-id 1})
(is (partial= {:uid "1", :ip "127.0.0.1"}
(:subject (first @*snowplow-collector*)))))))
(deftest track-event-test
(with-fake-snowplow-collector
(testing "Data sent into [[snowplow/track-event!]] for each event type is propagated to the Snowplow collector,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment