Class: UserPattern::Configuration
- Inherits:
-
Object
- Object
- UserPattern::Configuration
- Defined in:
- lib/userpattern/configuration.rb
Instance Attribute Summary collapse
-
#anonymous_salt ⇒ Object
Returns the value of attribute anonymous_salt.
-
#block_unknown_endpoints ⇒ Object
Returns the value of attribute block_unknown_endpoints.
-
#buffer_size ⇒ Object
Returns the value of attribute buffer_size.
- #dashboard_auth ⇒ Object
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#flush_interval ⇒ Object
Returns the value of attribute flush_interval.
-
#ignored_paths ⇒ Object
Returns the value of attribute ignored_paths.
-
#logout_method ⇒ Object
Returns the value of attribute logout_method.
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#on_threshold_exceeded ⇒ Object
Returns the value of attribute on_threshold_exceeded.
-
#rate_limiter_store ⇒ Object
Returns the value of attribute rate_limiter_store.
-
#retention_period ⇒ Object
Returns the value of attribute retention_period.
-
#session_detection ⇒ Object
Returns the value of attribute session_detection.
-
#threshold_multiplier ⇒ Object
Returns the value of attribute threshold_multiplier.
-
#threshold_refresh_interval ⇒ Object
Returns the value of attribute threshold_refresh_interval.
-
#tracked_models ⇒ Object
Returns the value of attribute tracked_models.
-
#violation_actions ⇒ Object
Returns the value of attribute violation_actions.
Instance Method Summary collapse
- #alert_mode? ⇒ Boolean
- #ignored?(path) ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/userpattern/configuration.rb', line 16 def initialize @tracked_models = [{ name: 'User', current_method: :current_user }] @flush_interval = 30 @buffer_size = 100 @retention_period = 30 @dashboard_auth = nil @anonymous_salt = nil @session_detection = :auto @enabled = true @ignored_paths = [] initialize_alert_defaults end |
Instance Attribute Details
#anonymous_salt ⇒ Object
Returns the value of attribute anonymous_salt.
7 8 9 |
# File 'lib/userpattern/configuration.rb', line 7 def anonymous_salt @anonymous_salt end |
#block_unknown_endpoints ⇒ Object
Returns the value of attribute block_unknown_endpoints.
7 8 9 |
# File 'lib/userpattern/configuration.rb', line 7 def block_unknown_endpoints @block_unknown_endpoints end |
#buffer_size ⇒ Object
Returns the value of attribute buffer_size.
7 8 9 |
# File 'lib/userpattern/configuration.rb', line 7 def buffer_size @buffer_size end |
#dashboard_auth ⇒ Object
33 34 35 |
# File 'lib/userpattern/configuration.rb', line 33 def dashboard_auth @dashboard_auth || default_dashboard_auth end |
#enabled ⇒ Object
Returns the value of attribute enabled.
7 8 9 |
# File 'lib/userpattern/configuration.rb', line 7 def enabled @enabled end |
#flush_interval ⇒ Object
Returns the value of attribute flush_interval.
7 8 9 |
# File 'lib/userpattern/configuration.rb', line 7 def flush_interval @flush_interval end |
#ignored_paths ⇒ Object
Returns the value of attribute ignored_paths.
7 8 9 |
# File 'lib/userpattern/configuration.rb', line 7 def ignored_paths @ignored_paths end |
#logout_method ⇒ Object
Returns the value of attribute logout_method.
7 8 9 |
# File 'lib/userpattern/configuration.rb', line 7 def logout_method @logout_method end |
#mode ⇒ Object
Returns the value of attribute mode.
7 8 9 |
# File 'lib/userpattern/configuration.rb', line 7 def mode @mode end |
#on_threshold_exceeded ⇒ Object
Returns the value of attribute on_threshold_exceeded.
7 8 9 |
# File 'lib/userpattern/configuration.rb', line 7 def on_threshold_exceeded @on_threshold_exceeded end |
#rate_limiter_store ⇒ Object
Returns the value of attribute rate_limiter_store.
7 8 9 |
# File 'lib/userpattern/configuration.rb', line 7 def rate_limiter_store @rate_limiter_store end |
#retention_period ⇒ Object
Returns the value of attribute retention_period.
7 8 9 |
# File 'lib/userpattern/configuration.rb', line 7 def retention_period @retention_period end |
#session_detection ⇒ Object
Returns the value of attribute session_detection.
7 8 9 |
# File 'lib/userpattern/configuration.rb', line 7 def session_detection @session_detection end |
#threshold_multiplier ⇒ Object
Returns the value of attribute threshold_multiplier.
7 8 9 |
# File 'lib/userpattern/configuration.rb', line 7 def threshold_multiplier @threshold_multiplier end |
#threshold_refresh_interval ⇒ Object
Returns the value of attribute threshold_refresh_interval.
7 8 9 |
# File 'lib/userpattern/configuration.rb', line 7 def threshold_refresh_interval @threshold_refresh_interval end |
#tracked_models ⇒ Object
Returns the value of attribute tracked_models.
5 6 7 |
# File 'lib/userpattern/configuration.rb', line 5 def tracked_models @tracked_models end |
#violation_actions ⇒ Object
Returns the value of attribute violation_actions.
7 8 9 |
# File 'lib/userpattern/configuration.rb', line 7 def violation_actions @violation_actions end |
Instance Method Details
#alert_mode? ⇒ Boolean
29 30 31 |
# File 'lib/userpattern/configuration.rb', line 29 def alert_mode? @mode == :alert end |
#ignored?(path) ⇒ Boolean
45 46 47 48 49 50 51 52 |
# File 'lib/userpattern/configuration.rb', line 45 def ignored?(path) ignored_paths.any? do |pattern| case pattern when Regexp then pattern.match?(path) when String then pattern == path end end end |