soar_auditing_provider 1.8.0 → 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fa21dcc13f23cdb76ed8a5e73fe8a61e55e31613
4
- data.tar.gz: c9817e2b952fab882ed024dcdc6a41db402f4454
3
+ metadata.gz: 0f14d5868f0105a39ea7c8f63f42084861fb3051
4
+ data.tar.gz: 96645fed67236c12fd3be8fb6595a7510a129a5e
5
5
  SHA512:
6
- metadata.gz: d09d988d482f05af2a3fef01e46d00e96195ea88411877d71859927ccc149953ea17dd75a847bd74846809991bd08275364d6f3772cfb271485c78f9ce39c3ab
7
- data.tar.gz: 91a9f79b34e03b04a5167553db5690286681c276b474069503f2e54b981283de7730dc73b4c08164864600e9f0e2f72741e97e8e96ce6f854a9859cc7f918de6
6
+ metadata.gz: 830824ca942484ef3b0c7afb6ef2bc55c8fbe2594397a748ba1c09d11be6afdb398dd1676a0dfc24e85d7f49c196ec7f2dea35bc4fa98bbe4b2ab2a7b8c6427c
7
+ data.tar.gz: 0b0fe84d33b7bf79506fcfdcaebae9877fc037ea92a27f66bc44b00bdaaed950ea7bff375a276f8c25d1935ebf42451e2e956b673a10bff05b3987a9c60fbd68
@@ -20,17 +20,22 @@ module SoarAuditingProvider
20
20
 
21
21
  DEFAULT_FLOW_ID_GENERATOR = -> { SoarFlow::ID::generate_flow_id } unless defined?(DEFAULT_FLOW_ID_GENERATOR)
22
22
  DEFAULT_LEVEL = :info unless defined?(DEFAULT_LEVEL)
23
+ DEFAULT_QUEUE_WORKER_CONFIG = {
24
+ "queue_size" => 1000,
25
+ "initial_back_off_in_seconds" => 1,
26
+ "back_off_multiplier" => 2,
27
+ "back_off_attempts" => 5
28
+ } unless defined?(DEFAULT_QUEUE_WORKER_CONFIG)
23
29
 
24
30
  attr_accessor :service_identifier
25
31
  attr_reader :configuration
26
32
  attr_writer :startup_flow_id
27
33
 
28
34
  def initialize(configuration)
29
- validate_provider_configuration(configuration)
30
35
  @configuration = configuration
31
- @flow_id_generator = @configuration["flow_id_generator"] || DEFAULT_FLOW_ID_GENERATOR
32
36
  super(create_auditors(configuration))
33
37
  select_auditor(configuration['default_nfrs'])
38
+ @flow_id_generator = @configuration["flow_id_generator"] || DEFAULT_FLOW_ID_GENERATOR
34
39
  create_auditing_worker
35
40
  @buffer_overflow_count = 0
36
41
  install_at_exit_handler
@@ -145,18 +150,15 @@ module SoarAuditingProvider
145
150
  @buffer_overflow_count += 1
146
151
  end
147
152
 
148
- def validate_provider_configuration(configuration)
149
- raise 'queue_worker required when direct_auditor_call is false' if configuration['direct_auditor_call'] != 'true' and !configuration['queue_worker']
150
- end
151
-
152
153
  def format(level, data, flow_identifier)
153
154
  SoarAuditingFormatter::Formatter.format(level,@service_identifier,flow_identifier,Time.now.utc.iso8601(3),data)
154
155
  end
155
156
 
156
157
  def create_auditing_worker
157
- if 'true' != @configuration['direct_auditor_call']
158
+ if !direct_auditor_call?
159
+ config = @configuration['queue_worker'] || DEFAULT_QUEUE_WORKER_CONFIG
158
160
  @worker = AuditingWorker.instance
159
- @worker.configure(queue_worker_configuration: @configuration['queue_worker'], auditor_audit_method: method(:super_class_caller))
161
+ @worker.configure(queue_worker_configuration: config, auditor_audit_method: method(:super_class_caller))
160
162
  @worker.start
161
163
  else
162
164
  @worker = nil
@@ -188,6 +190,11 @@ module SoarAuditingProvider
188
190
  raise
189
191
  end
190
192
 
193
+ def direct_auditor_call?(configuration = @configuration)
194
+ configuration['direct_auditor_call'] == 'true' or
195
+ (configuration['direct_auditor_call'].nil? and @auditor.respond_to?(:prefer_direct_call?) and @auditor.prefer_direct_call?)
196
+ end
197
+
191
198
  def initialize_metrics
192
199
  @startup_timestamp = Time.now.utc.iso8601(3)
193
200
  @enqueued_audit_events = 0
@@ -1,3 +1,3 @@
1
1
  module SoarAuditingProvider
2
- VERSION = "1.8.0"
2
+ VERSION = "1.9.0"
3
3
  end
@@ -26,6 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.add_development_dependency 'soar_xt', '~> 0.0.3'
27
27
 
28
28
  spec.add_dependency 'soar_auditing_provider_api', '~> 0.9.0'
29
+ spec.add_dependency 'soar_auditor_api', '~> 0.0'
29
30
  spec.add_dependency 'soar_auditing_format', '~> 0.0.5'
30
31
  spec.add_dependency 'soar_flow', '~> 0.1.1'
31
32
  spec.add_dependency 'soar_thread_worker', '~> 0.2.0'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soar_auditing_provider
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.0
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ernst van Graan
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2017-02-06 00:00:00.000000000 Z
12
+ date: 2017-02-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -109,6 +109,20 @@ dependencies:
109
109
  - - "~>"
110
110
  - !ruby/object:Gem::Version
111
111
  version: 0.9.0
112
+ - !ruby/object:Gem::Dependency
113
+ name: soar_auditor_api
114
+ requirement: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - "~>"
117
+ - !ruby/object:Gem::Version
118
+ version: '0.0'
119
+ type: :runtime
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - "~>"
124
+ - !ruby/object:Gem::Version
125
+ version: '0.0'
112
126
  - !ruby/object:Gem::Dependency
113
127
  name: soar_auditing_format
114
128
  requirement: !ruby/object:Gem::Requirement