ez_logs_agent 0.1.9 → 0.1.10
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/CHANGELOG.md +20 -0
- data/lib/ez_logs_agent/sanitizer.rb +44 -0
- data/lib/ez_logs_agent/version.rb +1 -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: 2a7479b12ee7dd0814929516f0474d7e05e393410d86a1c6d56117c854945809
|
|
4
|
+
data.tar.gz: 54af5890799ca5614373dae0e66d1b422b3abab3dee7d9d0f95c7f23039ffdd7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a68790e445b19ba92f2df2d0733fe6ae7e6d9c43f2ff854eed01fced091cb7d62aa1c0377429c44d3250abc515d5a1bb45056f1087eb0e2b8d491461fdd94843
|
|
7
|
+
data.tar.gz: f4208dc88f566f28e1ec24288533468fb3f99d268a77d4f3030da19fc4fc77fe8e36a39052516ddc94def977f03012d8bc157fccb319161a06d4889f52cd37e5
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.1.10] — 2026-06-05
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- `Sanitizer` no longer collapses ActiveJob keyword-argument hashes
|
|
9
|
+
(those tagged with `_aj_ruby2_keywords`) to `"[Object]"` at the
|
|
10
|
+
depth-3 cap. ActionMailer puts kwargs at two wrapper layers — an
|
|
11
|
+
outer `{"args" => [kwargs_hash], "_aj_ruby2_keywords" => ["args"]}`
|
|
12
|
+
payload and the kwargs hash itself, also marked. Each layer is
|
|
13
|
+
framework noise; the depth budget now skips them so real kwargs
|
|
14
|
+
survive the wire (e.g. `CompanyMailer.deleted(admin_email:, ...)`
|
|
15
|
+
now ships `admin_email`/`company_name`/`deleted_at` instead of a
|
|
16
|
+
single `"[Object]"`).
|
|
17
|
+
|
|
18
|
+
The carve-out is narrow: only hashes that actually carry the
|
|
19
|
+
`_aj_ruby2_keywords` marker are exempt. Customer-data hashes
|
|
20
|
+
without the marker still hit the depth cap unchanged, and
|
|
21
|
+
sensitive-key filtering (passwords, tokens, …) still runs on the
|
|
22
|
+
real kwargs entries — the wrapper is free to descend into, but
|
|
23
|
+
nothing inside it is exempt from masking. No wire-format change.
|
|
24
|
+
|
|
5
25
|
## [0.1.9] — 2026-06-05
|
|
6
26
|
|
|
7
27
|
### Fixed
|
|
@@ -102,6 +102,17 @@ module EzLogsAgent
|
|
|
102
102
|
# record the job ran on. Display formatting (gid → "User #42") is
|
|
103
103
|
# the server's job; the agent's job is to keep the data on the wire.
|
|
104
104
|
return hash if global_id_hash?(hash)
|
|
105
|
+
|
|
106
|
+
# ActiveJob wraps keyword args at TWO layers: the outer mailer
|
|
107
|
+
# payload `{"args" => [kwargs_hash], "_aj_ruby2_keywords" => ["args"]}`
|
|
108
|
+
# and the inner kwargs hash itself, also tagged `_aj_ruby2_keywords`.
|
|
109
|
+
# Each wrapper layer is framework noise — recursing into it without
|
|
110
|
+
# spending depth budget keeps the real kwargs from collapsing to
|
|
111
|
+
# "[Object]" at depth 3. Sensitive-key filtering still runs on the
|
|
112
|
+
# real entries (passwords don't leak; the wrapper just doesn't cost
|
|
113
|
+
# a depth level).
|
|
114
|
+
return sanitize_ruby2_keywords_wrapper(hash, depth) if ruby2_keywords_wrapper?(hash)
|
|
115
|
+
|
|
105
116
|
return "[Object]" if depth >= MAX_NESTING_DEPTH
|
|
106
117
|
return {} if hash.empty?
|
|
107
118
|
|
|
@@ -110,6 +121,24 @@ module EzLogsAgent
|
|
|
110
121
|
end
|
|
111
122
|
end
|
|
112
123
|
|
|
124
|
+
# Sanitize the entries of an _aj_ruby2_keywords wrapper at the SAME
|
|
125
|
+
# depth as the wrapper itself, then re-attach the marker. This is what
|
|
126
|
+
# lets kwargs survive past the depth-3 cap when they're wrapped at
|
|
127
|
+
# depth 2-3 by the outer mailer payload.
|
|
128
|
+
def sanitize_ruby2_keywords_wrapper(hash, depth)
|
|
129
|
+
result = {}
|
|
130
|
+
hash.each do |key, value|
|
|
131
|
+
if ruby2_keywords_marker_key?(key)
|
|
132
|
+
# Preserve the marker verbatim — it's used to identify the
|
|
133
|
+
# wrapper on the receiving side, not to display.
|
|
134
|
+
result[key] = value
|
|
135
|
+
else
|
|
136
|
+
result[key] = sanitize_value(key, value, depth)
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
result
|
|
140
|
+
end
|
|
141
|
+
|
|
113
142
|
def sanitize_array_value(array, depth)
|
|
114
143
|
return [] if array.empty?
|
|
115
144
|
|
|
@@ -161,6 +190,21 @@ module EzLogsAgent
|
|
|
161
190
|
gid = hash["_aj_globalid"] || hash[:_aj_globalid]
|
|
162
191
|
gid.is_a?(String) && gid.start_with?("gid://")
|
|
163
192
|
end
|
|
193
|
+
|
|
194
|
+
# True iff `hash` carries the `_aj_ruby2_keywords` marker. ActiveJob
|
|
195
|
+
# uses this marker on any hash that originated as a keyword-argument
|
|
196
|
+
# splat (so the framework can re-splat on deserialize). Used to skip
|
|
197
|
+
# the depth penalty for these framework wrappers — the marker's
|
|
198
|
+
# presence is the unambiguous signal we're inside an ActiveJob
|
|
199
|
+
# serialization layer, not customer data.
|
|
200
|
+
def ruby2_keywords_wrapper?(hash)
|
|
201
|
+
return false unless hash.is_a?(Hash)
|
|
202
|
+
hash.key?("_aj_ruby2_keywords") || hash.key?(:_aj_ruby2_keywords)
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
def ruby2_keywords_marker_key?(key)
|
|
206
|
+
key.to_s == "_aj_ruby2_keywords"
|
|
207
|
+
end
|
|
164
208
|
end
|
|
165
209
|
end
|
|
166
210
|
end
|