Class: Datadog::AppSec::Configuration::DSL
- Inherits:
-
Object
- Object
- Datadog::AppSec::Configuration::DSL
- Defined in:
- lib/datadog/appsec/configuration.rb
Overview
Configuration DSL implementation
Constant Summary collapse
- Instrument =
Struct constant whisker cast for Steep
_ = Struct.new(:name, :options)
Instance Attribute Summary collapse
-
#instruments ⇒ Object
readonly
Returns the value of attribute instruments.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #enabled=(value) ⇒ Object
-
#initialize ⇒ DSL
constructor
A new instance of DSL.
- #instrument(name, options = {}) ⇒ Object
- #ip_denylist=(value) ⇒ Object
- #obfuscator_key_regex=(value) ⇒ Object
- #obfuscator_value_regex=(value) ⇒ Object
- #ruleset=(value) ⇒ Object
- #trace_rate_limit=(value) ⇒ Object
- #user_id_denylist=(value) ⇒ Object
- #waf_debug=(value) ⇒ Object
-
#waf_timeout=(value) ⇒ Object
in microseconds.
Constructor Details
#initialize ⇒ DSL
Returns a new instance of DSL.
18 19 20 21 |
# File 'lib/datadog/appsec/configuration.rb', line 18 def initialize @instruments = [] @options = {} end |
Instance Attribute Details
#instruments ⇒ Object (readonly)
Returns the value of attribute instruments.
23 24 25 |
# File 'lib/datadog/appsec/configuration.rb', line 23 def instruments @instruments end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
23 24 25 |
# File 'lib/datadog/appsec/configuration.rb', line 23 def @options end |
Instance Method Details
#[](key) ⇒ Object
66 67 68 69 70 |
# File 'lib/datadog/appsec/configuration.rb', line 66 def [](key) found = @instruments.find { |e| e.name == key } found. if found end |
#enabled=(value) ⇒ Object
29 30 31 |
# File 'lib/datadog/appsec/configuration.rb', line 29 def enabled=(value) [:enabled] = value end |
#instrument(name, options = {}) ⇒ Object
25 26 27 |
# File 'lib/datadog/appsec/configuration.rb', line 25 def instrument(name, = {}) @instruments << Instrument.new(name, ) end |
#ip_denylist=(value) ⇒ Object
37 38 39 |
# File 'lib/datadog/appsec/configuration.rb', line 37 def ip_denylist=(value) [:ip_denylist] = value end |
#obfuscator_key_regex=(value) ⇒ Object
58 59 60 |
# File 'lib/datadog/appsec/configuration.rb', line 58 def obfuscator_key_regex=(value) [:obfuscator_key_regex] = value end |
#obfuscator_value_regex=(value) ⇒ Object
62 63 64 |
# File 'lib/datadog/appsec/configuration.rb', line 62 def obfuscator_value_regex=(value) [:obfuscator_value_regex] = value end |
#ruleset=(value) ⇒ Object
33 34 35 |
# File 'lib/datadog/appsec/configuration.rb', line 33 def ruleset=(value) [:ruleset] = value end |
#trace_rate_limit=(value) ⇒ Object
54 55 56 |
# File 'lib/datadog/appsec/configuration.rb', line 54 def trace_rate_limit=(value) [:trace_rate_limit] = value end |
#user_id_denylist=(value) ⇒ Object
41 42 43 |
# File 'lib/datadog/appsec/configuration.rb', line 41 def user_id_denylist=(value) [:user_id_denylist] = value end |
#waf_debug=(value) ⇒ Object
50 51 52 |
# File 'lib/datadog/appsec/configuration.rb', line 50 def waf_debug=(value) [:waf_debug] = value end |
#waf_timeout=(value) ⇒ Object
in microseconds
46 47 48 |
# File 'lib/datadog/appsec/configuration.rb', line 46 def waf_timeout=(value) [:waf_timeout] = value end |