velocity_audited 5.1.5 → 6.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 45a7f9290cee6aae7cd334dcb7ad8caa04499b1b7dfbded332b9610edafb0cdf
4
- data.tar.gz: f61d64e7ca9fd56f06b0b7c3d50a2fb05b4a8557a9c12ae84913f2be4e0ba462
3
+ metadata.gz: e058582ca733876bad833335b319e2da7351a1a712ec4d4702c16a85973190e2
4
+ data.tar.gz: 3bb43b22af1c2cb17cd9fe23c927d25e8a084c5aadded00d937c8f2c75e24733
5
5
  SHA512:
6
- metadata.gz: f120f84272a20e9eb9eac563c31600076fb7853b5f104d649455ea4cf248515688f988a826bbf7663479fc1fad52b95ba4bd70e1e53e876daab58865b8056520
7
- data.tar.gz: 37f3937367adee851552565841a7041d52491a9dc637ced5971185aff206371663861698dd11f5cfc53a59c2e270bfe78e14e6a2d895c19ea8b735d2e5e247e3
6
+ metadata.gz: c5a0f851ecd39cd7090d16afb241176f7d01252febf0fc11ad0951f08858491d475c9805d4fc8915d33a1612499af294ebfe0ce1209809602eafba3e8534c22e
7
+ data.tar.gz: 71e71db5ffa01a88a23df2787be6ca5d062a67e1090deb28b256fb88ce6160efc4e39f63cb9ac7e408a47cc384d88668306d8103bde445cb178e1305c1090a1f
@@ -309,11 +309,13 @@ module VelocityAudited
309
309
 
310
310
  def write_audit(attrs)
311
311
  self.audit_comment = nil
312
- attrs[:db_audit] = true
312
+ attrs[:log_type] = "db_audit"
313
+ attrs[:record_id] = id
314
+ attrs[:model] = self.class.base_class.name
313
315
  attrs = add_metadata(attrs)
314
316
  if auditing_enabled
315
317
  attrs[:associated] = send(audit_associated_with) unless audit_associated_with.nil?
316
- logger.audit(attrs.to_json)
318
+ logger.info(attrs.to_json)
317
319
  end
318
320
  end
319
321
 
@@ -321,8 +323,9 @@ module VelocityAudited
321
323
  attrs[:client] = ::VelocityAudited.store[:client]
322
324
  attrs[:origin] = ::VelocityAudited.store[:origin]
323
325
  attrs[:user_agent] = ::VelocityAudited.store[:user_agent]
324
- attrs[:ip] = ::VelocityAudited.store[:ip]
326
+ attrs[:ip] = ::VelocityAudited.store[:current_remote_address]
325
327
  attrs[:uid] = ::VelocityAudited.store[:uid]
328
+ attrs[:request_id] = ::VelocityAudited.store[:request_id]
326
329
  attrs
327
330
  end
328
331
 
@@ -8,9 +8,9 @@ module VelocityAudited
8
8
  current_user: :current_user,
9
9
  origin: :origin,
10
10
  user_agent: :user_agent,
11
- ip: :ip,
12
11
  uid: :uid,
13
- client: :client
12
+ client: :client,
13
+ request_id: :request_id
14
14
  }
15
15
 
16
16
  delegate :store, to: ::VelocityAudited
@@ -43,11 +43,7 @@ module VelocityAudited
43
43
  def user_agent
44
44
  controller.try(:request).try(:headers)['User-Agent']
45
45
  end
46
-
47
- def ip
48
- controller.try(:request).try(:headers)['HTTP_X_FORWARDED_FOR']
49
- end
50
-
46
+
51
47
  def uid
52
48
  controller.try(:request).try(:headers)['uid']
53
49
  end
@@ -56,6 +52,10 @@ module VelocityAudited
56
52
  controller.try(:request).try(:headers)['client']
57
53
  end
58
54
 
55
+ def request_id
56
+ controller.try(:request).try(:uuid)
57
+ end
58
+
59
59
  def controller
60
60
  store[:current_controller]
61
61
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module VelocityAudited
4
- VERSION = "5.1.5"
4
+ VERSION = "6.0.4"
5
5
  end
Binary file
Binary file
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: velocity_audited
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.5
4
+ version: 6.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Keepers
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2021-12-29 00:00:00.000000000 Z
17
+ date: 2022-01-18 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: activerecord
@@ -233,6 +233,9 @@ files:
233
233
  - test/install_generator_test.rb
234
234
  - test/test_helper.rb
235
235
  - test/upgrade_generator_test.rb
236
+ - velocity_audited-6.0.1.gem
237
+ - velocity_audited-6.0.2.gem
238
+ - velocity_audited-6.0.3.gem
236
239
  homepage: https://github.com/Velocity-Engineering/audited
237
240
  licenses:
238
241
  - MIT