sensu 1.2.0 → 1.2.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 +8 -1
- data/lib/sensu/constants.rb +1 -1
- data/lib/sensu/utilities.rb +18 -12
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffda8bc29ab44f27d429a83caca7dc70c779c474
|
4
|
+
data.tar.gz: 1be8182e6b77bc9ad9be630e74f5b3511d5a60f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 576a015911e86dce7699586be7904777590a47e9a6ec88f20116b569f6ce685931e426084bd15e57225a271dc9d767882968c61f3377484d49debed48e95ac2a
|
7
|
+
data.tar.gz: 9c8fcb61b2405cc8aae22ec16fe61836830c521700f9d017b21da15e705d548a4feab3273afe933f2b236194db92dc7606d5e4de83d7c3dac3f69b139050cd3d
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## 1.2.1 - 2018-02-06
|
2
|
+
|
3
|
+
### Fixes
|
4
|
+
|
5
|
+
Fixed a bug in which sensitive values deeply nested in arrays would
|
6
|
+
not have been redacted.
|
7
|
+
|
1
8
|
## 1.2.0 - 2017-12-05
|
2
9
|
|
3
10
|
### Features
|
@@ -14,7 +21,7 @@ a request ID, the API generates one for the request (UUID).
|
|
14
21
|
The Sensu API `/results/*` endpoints now include check history in the
|
15
22
|
result data.
|
16
23
|
|
17
|
-
Check token substitution is now supported in check "
|
24
|
+
Check token substitution is now supported in check "source".
|
18
25
|
|
19
26
|
## 1.1.3 - 2017-11-24
|
20
27
|
|
data/lib/sensu/constants.rb
CHANGED
data/lib/sensu/utilities.rb
CHANGED
@@ -94,29 +94,35 @@ module Sensu
|
|
94
94
|
# password, passwd, pass, api_key, api_token, access_key,
|
95
95
|
# secret_key, private_key, secret
|
96
96
|
#
|
97
|
-
# @param
|
97
|
+
# @param obj [Object] to redact sensitive value from.
|
98
98
|
# @param keys [Array] that indicate sensitive values.
|
99
99
|
# @return [Hash] hash with redacted sensitive values.
|
100
|
-
def redact_sensitive(
|
100
|
+
def redact_sensitive(obj, keys=nil)
|
101
101
|
keys ||= %w[
|
102
102
|
password passwd pass
|
103
103
|
api_key api_token
|
104
104
|
access_key secret_key private_key
|
105
105
|
secret
|
106
106
|
]
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
107
|
+
obj = obj.dup
|
108
|
+
if obj.is_a?(Hash)
|
109
|
+
obj.each do |key, value|
|
110
|
+
if keys.include?(key.to_s)
|
111
|
+
obj[key] = "REDACTED"
|
112
|
+
elsif value.is_a?(Hash) || value.is_a?(Array)
|
113
|
+
obj[key] = redact_sensitive(value, keys)
|
114
|
+
end
|
115
|
+
end
|
116
|
+
elsif obj.is_a?(Array)
|
117
|
+
obj.map! do |item|
|
118
|
+
if item.is_a?(Hash) || item.is_a?(Array)
|
119
|
+
redact_sensitive(item, keys)
|
120
|
+
else
|
121
|
+
item
|
116
122
|
end
|
117
123
|
end
|
118
124
|
end
|
119
|
-
|
125
|
+
obj
|
120
126
|
end
|
121
127
|
|
122
128
|
# Traverse a hash for an attribute value, with a fallback default
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Porter
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2018-02-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: eventmachine
|