Class: Provenance::Configuration
- Inherits:
-
Object
- Object
- Provenance::Configuration
- Defined in:
- lib/provenance/configuration.rb
Overview
Holds the global configuration: the data source name, the list of sensitive attributes, the delivery hooks and the value providers used to enrich every audit event.
Instance Attribute Summary collapse
-
#audit_hooks ⇒ Object
Returns the value of attribute audit_hooks.
-
#bulk_operations_max_ids ⇒ Object
Returns the value of attribute bulk_operations_max_ids.
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#origin_ip_provider ⇒ Object
Returns the value of attribute origin_ip_provider.
-
#remote_ip_provider ⇒ Object
Returns the value of attribute remote_ip_provider.
-
#roles_provider ⇒ Object
Returns the value of attribute roles_provider.
-
#sensitive_attributes ⇒ Object
Returns the value of attribute sensitive_attributes.
-
#session_id_provider ⇒ Object
Returns the value of attribute session_id_provider.
-
#source_name ⇒ Object
Returns the value of attribute source_name.
-
#track_bulk_operations ⇒ Object
Returns the value of attribute track_bulk_operations.
-
#username_provider ⇒ Object
Returns the value of attribute username_provider.
Instance Method Summary collapse
- #add_audit_hook(&block) ⇒ Object
- #clear_audit_hooks ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/provenance/configuration.rb', line 12 def initialize @source_name = "app_#{Rails.env}" @sensitive_attributes = [] @audit_hooks = [] @enabled = !Rails.env.test? @track_bulk_operations = false @bulk_operations_max_ids = 1000 @username_provider = nil @roles_provider = nil @remote_ip_provider = nil @origin_ip_provider = nil @session_id_provider = nil end |
Instance Attribute Details
#audit_hooks ⇒ Object
Returns the value of attribute audit_hooks.
8 9 10 |
# File 'lib/provenance/configuration.rb', line 8 def audit_hooks @audit_hooks end |
#bulk_operations_max_ids ⇒ Object
Returns the value of attribute bulk_operations_max_ids.
8 9 10 |
# File 'lib/provenance/configuration.rb', line 8 def bulk_operations_max_ids @bulk_operations_max_ids end |
#enabled ⇒ Object
Returns the value of attribute enabled.
8 9 10 |
# File 'lib/provenance/configuration.rb', line 8 def enabled @enabled end |
#origin_ip_provider ⇒ Object
Returns the value of attribute origin_ip_provider.
8 9 10 |
# File 'lib/provenance/configuration.rb', line 8 def origin_ip_provider @origin_ip_provider end |
#remote_ip_provider ⇒ Object
Returns the value of attribute remote_ip_provider.
8 9 10 |
# File 'lib/provenance/configuration.rb', line 8 def remote_ip_provider @remote_ip_provider end |
#roles_provider ⇒ Object
Returns the value of attribute roles_provider.
8 9 10 |
# File 'lib/provenance/configuration.rb', line 8 def roles_provider @roles_provider end |
#sensitive_attributes ⇒ Object
Returns the value of attribute sensitive_attributes.
8 9 10 |
# File 'lib/provenance/configuration.rb', line 8 def sensitive_attributes @sensitive_attributes end |
#session_id_provider ⇒ Object
Returns the value of attribute session_id_provider.
8 9 10 |
# File 'lib/provenance/configuration.rb', line 8 def session_id_provider @session_id_provider end |
#source_name ⇒ Object
Returns the value of attribute source_name.
8 9 10 |
# File 'lib/provenance/configuration.rb', line 8 def source_name @source_name end |
#track_bulk_operations ⇒ Object
Returns the value of attribute track_bulk_operations.
8 9 10 |
# File 'lib/provenance/configuration.rb', line 8 def track_bulk_operations @track_bulk_operations end |
#username_provider ⇒ Object
Returns the value of attribute username_provider.
8 9 10 |
# File 'lib/provenance/configuration.rb', line 8 def username_provider @username_provider end |
Instance Method Details
#add_audit_hook(&block) ⇒ Object
26 27 28 |
# File 'lib/provenance/configuration.rb', line 26 def add_audit_hook(&block) @audit_hooks << block end |
#clear_audit_hooks ⇒ Object
30 31 32 |
# File 'lib/provenance/configuration.rb', line 30 def clear_audit_hooks @audit_hooks.clear end |