smplkit 3.0.21 → 3.0.22
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 +4 -4
- data/lib/smplkit/audit/events.rb +11 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 81748d66161d109c1a8948824656edb9ad0fd9bef8dffd37a1969474c8a731fa
|
|
4
|
+
data.tar.gz: 188a085ba9c2c99fe3ff5c3e246a75b033e264e7d87efe9e87d94f8e46c8cb34
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 704759f5899aa706dcd6a4217634ca7ab722b452583d470a10f4dd23411f23d429b2989503658bdf6142a4b5a87e024592eceae6a22b5e33d299da7a0b9bb1b6
|
|
7
|
+
data.tar.gz: b4916402670ef7c2659a2a776388dbd4ef7954560f219f0cb62e69d69b937e24e4a8a930a8d2e2c282a35a0a04134103456d92146611968c7aa14c9a6b1b8e11
|
data/lib/smplkit/audit/events.rb
CHANGED
|
@@ -15,11 +15,18 @@ module Smplkit
|
|
|
15
15
|
|
|
16
16
|
# Enqueue an audit event for asynchronous delivery.
|
|
17
17
|
#
|
|
18
|
+
# Actor attribution (+actor_type+, +actor_id+, +actor_label+) is
|
|
19
|
+
# customer-supplied and free-form. The audit service stores
|
|
20
|
+
# whatever the caller passed and never backfills from the request
|
|
21
|
+
# credential — supply the fields explicitly when you want the
|
|
22
|
+
# event attributed.
|
|
23
|
+
#
|
|
18
24
|
# Customer attempts to record events with +resource_type+ starting
|
|
19
25
|
# with +smpl.+ are rejected by the server with a 403 (the buffer
|
|
20
26
|
# logs and drops permanent failures).
|
|
21
27
|
def record(action:, resource_type:, resource_id:,
|
|
22
|
-
occurred_at: nil,
|
|
28
|
+
occurred_at: nil, actor_type: nil, actor_id: nil,
|
|
29
|
+
actor_label: nil, data: nil, idempotency_key: nil,
|
|
23
30
|
do_not_forward: false)
|
|
24
31
|
raise ArgumentError, "action is required" if action.nil? || action.to_s.empty?
|
|
25
32
|
raise ArgumentError, "resource_type is required" if resource_type.nil? || resource_type.to_s.empty?
|
|
@@ -45,6 +52,9 @@ module Smplkit
|
|
|
45
52
|
resource_type: resource_type,
|
|
46
53
|
resource_id: resource_id,
|
|
47
54
|
occurred_at: normalized_occurred_at,
|
|
55
|
+
actor_type: actor_type,
|
|
56
|
+
actor_id: actor_id,
|
|
57
|
+
actor_label: actor_label,
|
|
48
58
|
data: data || {},
|
|
49
59
|
do_not_forward: do_not_forward
|
|
50
60
|
)
|