Class: PxModule::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/perimeterx/configuration.rb

Constant Summary collapse

PX_DEFAULT =
{
  :app_id                   => nil,
  :cookie_key               => nil,
  :auth_token               => nil,
  :module_enabled           => true,
  :captcha_enabled          => true,
  :challenge_enabled        => true,
  :encryption_enabled       => true,
  :blocking_score           => 70,
  :sensitive_headers        => ["http-cookie", "http-cookies"],
  :api_connect_timeout      => 0,
  :api_timeout              => 0,
  :max_buffer_len           => 30,
  :send_page_activities     => false,
  :send_block_activities    => true,
  :sdk_name                 => PxModule::SDK_NAME,
  :debug                    => false,
  :module_mode              => PxModule::ACTIVE_MODE,
  :local_proxy              => false
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Configuration

Returns a new instance of Configuration.



31
32
33
34
35
# File 'lib/perimeterx/configuration.rb', line 31

def initialize(params)
  PX_DEFAULT[:perimeterx_server_host] = "https://sapi-#{params[:app_id].downcase}.perimeterx.net"
  @configuration = PX_DEFAULT.merge(params);
  @configuration[:logger] = PxLogger.new(@configuration[:debug])
end

Instance Attribute Details

#configurationObject

Returns the value of attribute configuration.



7
8
9
# File 'lib/perimeterx/configuration.rb', line 7

def configuration
  @configuration
end

#PX_DEFAULTObject

Returns the value of attribute PX_DEFAULT.



8
9
10
# File 'lib/perimeterx/configuration.rb', line 8

def PX_DEFAULT
  @PX_DEFAULT
end