-
Notifications
You must be signed in to change notification settings - Fork 381
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4352 from DataDog/appsec-56683-update-auto-user-i…
…nstrumentation-mode-configuration [APPSEC-56683] Add `appsec.auto_user_instrumentation.mode` setting
- Loading branch information
Showing
14 changed files
with
906 additions
and
467 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# frozen_string_literal: true | ||
|
||
module Datadog | ||
module AppSec | ||
module Contrib | ||
module Devise | ||
# A temporary configuration module to accomodate new RFC changes. | ||
# NOTE: DEV-3 Remove module | ||
module Configuration | ||
module_function | ||
|
||
# NOTE: DEV-3 Replace method use with `auto_user_instrumentation.enabled?` | ||
def auto_user_instrumentation_enabled? | ||
Datadog.configuration.appsec.auto_user_instrumentation.enabled? && | ||
Datadog.configuration.appsec.track_user_events.enabled | ||
end | ||
|
||
# NOTE: DEV-3 Replace method use with `auto_user_instrumentation.mode` | ||
def auto_user_instrumentation_mode | ||
case Datadog.configuration.appsec.track_user_events.mode | ||
when AppSec::Configuration::Settings::SAFE_TRACK_USER_EVENTS_MODE | ||
AppSec::Configuration::Settings::ANONYMIZATION_AUTO_USER_INSTRUMENTATION_MODE | ||
when AppSec::Configuration::Settings::EXTENDED_TRACK_USER_EVENTS_MODE | ||
AppSec::Configuration::Settings::IDENTIFICATION_AUTO_USER_INSTRUMENTATION_MODE | ||
else | ||
Datadog.configuration.appsec.auto_user_instrumentation.mode | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module Datadog | ||
module AppSec | ||
module Contrib | ||
module Devise | ||
module Configuration | ||
def self?.auto_user_instrumentation_enabled?: () -> bool | ||
|
||
def self?.auto_user_instrumentation_mode: () -> ::String | ||
end | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.