Class: Configurable::Configuration
- Inherits:
-
Object
- Object
- Configurable::Configuration
- Defined in:
- lib/configurable.rb
Instance Attribute Summary collapse
-
#custom_datadome_payload_headers ⇒ Object
Returns the value of attribute custom_datadome_payload_headers.
-
#custom_payload ⇒ Object
Returns the value of attribute custom_payload.
-
#datadome_read_timeout ⇒ Object
Returns the value of attribute datadome_read_timeout.
-
#datadome_server_side_key ⇒ Object
Returns the value of attribute datadome_server_side_key.
-
#datadome_timeout ⇒ Object
Returns the value of attribute datadome_timeout.
-
#hidden_endpoints_regex ⇒ Object
Returns the value of attribute hidden_endpoints_regex.
-
#is_datadome_assessment_enabled ⇒ Object
Returns the value of attribute is_datadome_assessment_enabled.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#protection_api_host ⇒ Object
Returns the value of attribute protection_api_host.
-
#visible_endpoints_regex ⇒ Object
Returns the value of attribute visible_endpoints_regex.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/configurable.rb', line 34 def initialize @is_datadome_assessment_enabled = lambda { true } @logger = Logger.new($stdout) @visible_endpoints_regex = lambda { ENV.fetch('DATADOME_URL_PATTERN_INCLUSION', ALL_ENDPOINT_INCLUSION_REGEXP).to_s } @hidden_endpoints_regex = lambda { ENV.fetch('DATADOME_URL_PATTERN_EXCLUSION', STATIC_PAGE_EXCLUSION_REGEXP).to_s } @datadome_timeout = lambda { ENV.fetch('DATADOME_TIMEOUT', 300).to_i } @datadome_read_timeout = lambda { ENV.fetch('DATADOME_READ_TIMEOUT', 200).to_i } @custom_datadome_payload_headers = {} @custom_payload = lambda { {} } @protection_api_host = ENV.fetch('DATADOME_ENDPOINT', 'api.datadome.co') @datadome_server_side_key = lambda { ENV['DATADOME_SERVER_SIDE_KEY'] } end |
Instance Attribute Details
#custom_datadome_payload_headers ⇒ Object
Returns the value of attribute custom_datadome_payload_headers.
23 24 25 |
# File 'lib/configurable.rb', line 23 def custom_datadome_payload_headers @custom_datadome_payload_headers end |
#custom_payload ⇒ Object
Returns the value of attribute custom_payload.
23 24 25 |
# File 'lib/configurable.rb', line 23 def custom_payload @custom_payload end |
#datadome_read_timeout ⇒ Object
Returns the value of attribute datadome_read_timeout.
23 24 25 |
# File 'lib/configurable.rb', line 23 def datadome_read_timeout @datadome_read_timeout end |
#datadome_server_side_key ⇒ Object
Returns the value of attribute datadome_server_side_key.
23 24 25 |
# File 'lib/configurable.rb', line 23 def datadome_server_side_key @datadome_server_side_key end |
#datadome_timeout ⇒ Object
Returns the value of attribute datadome_timeout.
23 24 25 |
# File 'lib/configurable.rb', line 23 def datadome_timeout @datadome_timeout end |
#hidden_endpoints_regex ⇒ Object
Returns the value of attribute hidden_endpoints_regex.
23 24 25 |
# File 'lib/configurable.rb', line 23 def hidden_endpoints_regex @hidden_endpoints_regex end |
#is_datadome_assessment_enabled ⇒ Object
Returns the value of attribute is_datadome_assessment_enabled.
23 24 25 |
# File 'lib/configurable.rb', line 23 def is_datadome_assessment_enabled @is_datadome_assessment_enabled end |
#logger ⇒ Object
Returns the value of attribute logger.
23 24 25 |
# File 'lib/configurable.rb', line 23 def logger @logger end |
#protection_api_host ⇒ Object
Returns the value of attribute protection_api_host.
23 24 25 |
# File 'lib/configurable.rb', line 23 def protection_api_host @protection_api_host end |
#visible_endpoints_regex ⇒ Object
Returns the value of attribute visible_endpoints_regex.
23 24 25 |
# File 'lib/configurable.rb', line 23 def visible_endpoints_regex @visible_endpoints_regex end |