Skip to content

Commit 6d78f43

Browse files
committed
Replace track_user_events usage with new setting
1 parent 8f00db5 commit 6d78f43

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

lib/datadog/appsec/contrib/devise/patcher/registration_controller_patch.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,26 @@ def create
4646
yield resource if block_given?
4747
end
4848
end
49+
50+
private
51+
52+
# NOTE: DEV-3 replace method use with `auto_user_instrumentation.enabled?`
53+
def auto_user_instrumentation_enabled?
54+
Datadog.configuration.appsec.auto_user_instrumentation.enabled? &&
55+
Datadog.configuration.appsec.track_user_events.enabled
56+
end
57+
58+
# NOTE: DEV-3 replace method use with `auto_user_instrumentation.mode`
59+
def auto_user_instrumentation_mode
60+
case Datadog.configuration.appsec.track_user_events.mode
61+
when Configuration::Settings::SAFE_TRACK_USER_EVENTS_MODE
62+
Configuration::Settings::ANONYMIZATION_AUTO_USER_INSTRUMENTATION_MODE
63+
when Configuration::Settings::EXTENDED_TRACK_USER_EVENTS_MODE
64+
Configuration::Settings::IDENTIFICATION_AUTO_USER_INSTRUMENTATION_MODE
65+
else
66+
Datadog.configuration.appsec.auto_user_instrumentation.mode
67+
end
68+
end
4969
end
5070
end
5171
end

0 commit comments

Comments
 (0)