eventhub-processor2 1.29.0 → 1.29.1
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 +4 -0
- data/lib/eventhub/docs_renderer.rb +10 -3
- data/lib/eventhub/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: ebef86c063318afa67b5cc9413207ff62b476b2d21f74b273bc38a6e4f1e27f0
|
|
4
|
+
data.tar.gz: 07d8a05aa5b8e9b1ded3c8ecef9ebf57e7d1863a0da9befb29872037126c57f2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: aa5d0e5a661e0517bd7742844aa8bada9649605113bbf1aa4ca8a750b09a199552aeda5bbcbc8d9c833b1c8c39ae32551d4c6fa99c9cd0836a08fd1ab9349751
|
|
7
|
+
data.tar.gz: adc18094fa6813a9273259491cc4ed546ce00371b677b221b9153785c8a8d08ac6def9a7416ba41c619a5a48ac085a550d3e1a2f894f2b5d3bdc13ef6e2d6d87
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog of EventHub::Processor2
|
|
2
2
|
|
|
3
|
+
# 1.29.1 / 2026-08-26
|
|
4
|
+
|
|
5
|
+
* Docs configuration page: sensitive keywords now only redact leaf values, not hash sections named after one (e.g. `database.pool` stays visible, `database.password` stays redacted).
|
|
6
|
+
|
|
3
7
|
# 1.29.0 / 2026-08-26
|
|
4
8
|
|
|
5
9
|
* Docs configuration page: sensitive keys now match by substring with an extended default list (e.g. `base_url`, `api_port` are redacted automatically). Exceptions like `vhost` stay visible and can be customized via `non_sensitive_keys`, analogous to `sensitive_keys`. See README for details.
|
|
@@ -162,7 +162,7 @@ module EventHub
|
|
|
162
162
|
def config_to_html_table(hash, depth = 0, prefix = "", redact: false)
|
|
163
163
|
rows = hash.map do |key, value|
|
|
164
164
|
full_key = prefix.empty? ? key.to_s : "#{prefix}.#{key}"
|
|
165
|
-
hide =
|
|
165
|
+
hide = redact_value?(key, value, redact)
|
|
166
166
|
if depth == 0 && value.is_a?(Hash) && !value.empty?
|
|
167
167
|
"<tr class=\"is-section is-section-top\"><td colspan=\"2\"><strong>#{ERB::Util.html_escape(full_key)}</strong></td></tr>\n" \
|
|
168
168
|
"#{config_to_html_table(value, 1, full_key, redact: hide)}"
|
|
@@ -207,7 +207,7 @@ module EventHub
|
|
|
207
207
|
def format_array_item(item, redact: false)
|
|
208
208
|
if item.is_a?(Hash)
|
|
209
209
|
rows = item.map do |k, v|
|
|
210
|
-
hide =
|
|
210
|
+
hide = redact_value?(k, v, redact)
|
|
211
211
|
"<tr><td>#{ERB::Util.html_escape(k)}</td><td>#{format_nested_value(v, redact: hide)}</td></tr>"
|
|
212
212
|
end.join
|
|
213
213
|
"<li><table class=\"table is-bordered is-narrow config-subtable\">#{rows}</table></li>"
|
|
@@ -222,7 +222,7 @@ module EventHub
|
|
|
222
222
|
def format_nested_value(value, redact: false)
|
|
223
223
|
if value.is_a?(Hash)
|
|
224
224
|
rows = value.map do |k, v|
|
|
225
|
-
hide =
|
|
225
|
+
hide = redact_value?(k, v, redact)
|
|
226
226
|
"<tr><td>#{ERB::Util.html_escape(k)}</td><td>#{format_nested_value(v, redact: hide)}</td></tr>"
|
|
227
227
|
end.join
|
|
228
228
|
"<table class=\"table is-bordered is-narrow config-subtable\">#{rows}</table>"
|
|
@@ -255,6 +255,13 @@ module EventHub
|
|
|
255
255
|
DEFAULT_SENSITIVE_KEYS = %w[password secret token api_key credential user login host port database instance url endpoint scheme].freeze
|
|
256
256
|
DEFAULT_NON_SENSITIVE_KEYS = %w[vhost].freeze
|
|
257
257
|
|
|
258
|
+
# A sensitive keyword only triggers redaction on leaf nodes (scalars and
|
|
259
|
+
# arrays). A hash named e.g. "database" stays visible; its keys are
|
|
260
|
+
# checked individually instead.
|
|
261
|
+
def redact_value?(key, value, inherited)
|
|
262
|
+
inherited || (!value.is_a?(Hash) && sensitive_key?(key))
|
|
263
|
+
end
|
|
264
|
+
|
|
258
265
|
def sensitive_key?(key)
|
|
259
266
|
normalized = key.to_s.downcase
|
|
260
267
|
return false if non_sensitive_keys.any? { |exception| normalized == exception.downcase }
|
data/lib/eventhub/version.rb
CHANGED