vcap_common 3.0.1 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/cf/version.rb +1 -1
- data/lib/vcap/component.rb +5 -25
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OTQ2YjBjZWRmYTgyZmRmZmI5MWExNDA1MGE1NjZkMTFkNGE4ZDY2MA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MGQzY2E0ODY2YzBjMjMxOTEwOGNlZGM2ZmY0MTJmNTFlNmIzOTE2OA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YjU3NDYwZGYxMjNhZmEwODRiZTg3ZTJmZDllZmVkODg3NjJkYTYzYmJmNTYx
|
10
|
+
YzhiZGQ5MGRkZTk5OTIxNTA0MGU0ZmY5OTQ2ZWE4Y2Q5NDhjNDVlYWVlMzgx
|
11
|
+
YzRjMDY4N2Q4Njg2OGY1MjgyYWE4NzExNWJjNTkwYTc3MzM2NjI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MDMxMGJlY2IxZGRhYzRjYTBiYjA2ZjlkMmRhMjc5NWQ4YjE0OTEwNDYxZjgx
|
14
|
+
ZGFjMDBmMTAyYmFlYzBlMGJhMzg1MWViZDJlNGUwYTUyYzY4MzhjOWJiMzAy
|
15
|
+
MzJlMDY1OTMzNTRkYjM2Yzg3OTQ4YmU0OWE4YTAxMzFjM2FiNTA=
|
data/lib/cf/version.rb
CHANGED
data/lib/vcap/component.rb
CHANGED
@@ -45,10 +45,6 @@ module VCAP
|
|
45
45
|
|
46
46
|
# Common component setup for discovery and monitoring
|
47
47
|
class Component
|
48
|
-
|
49
|
-
# We will suppress these from normal varz reporting by default.
|
50
|
-
CONFIG_SUPPRESS = Set.new([:message_bus_servers, :mbus, :service_mbus, :keys, :database_environment, :password, :pass, :token])
|
51
|
-
|
52
48
|
class SafeHash < BasicObject
|
53
49
|
def initialize(hash = {})
|
54
50
|
@hash = hash
|
@@ -156,6 +152,8 @@ module VCAP
|
|
156
152
|
# Returns the published configuration of the component,
|
157
153
|
# including the ephemeral port and credentials.
|
158
154
|
def register(opts)
|
155
|
+
disallow_exposing_of_config!(opts)
|
156
|
+
|
159
157
|
uuid = VCAP.secure_uuid
|
160
158
|
type = opts[:type]
|
161
159
|
index = opts[:index]
|
@@ -181,7 +179,6 @@ module VCAP
|
|
181
179
|
varz.synchronize do
|
182
180
|
varz.merge!(@discover.dup)
|
183
181
|
varz[:num_cores] = VCAP.num_cores
|
184
|
-
varz[:config] = sanitize_config(opts[:config]) if opts[:config]
|
185
182
|
varz[:log_counts] = log_counter if log_counter
|
186
183
|
end
|
187
184
|
|
@@ -209,28 +206,11 @@ module VCAP
|
|
209
206
|
@discover[:uptime] = VCAP.uptime_string(Time.now - @discover[:start])
|
210
207
|
end
|
211
208
|
|
212
|
-
|
213
|
-
h.each do |k, v|
|
214
|
-
if CONFIG_SUPPRESS.include?(k.to_sym)
|
215
|
-
h.delete(k)
|
216
|
-
else
|
217
|
-
clear_level(h[k]) if v.instance_of? Hash
|
218
|
-
end
|
219
|
-
end
|
220
|
-
end
|
209
|
+
private
|
221
210
|
|
222
|
-
def
|
223
|
-
|
224
|
-
if config[:logger]
|
225
|
-
config = config.dup
|
226
|
-
config.delete(:logger)
|
227
|
-
end
|
228
|
-
# Deep copy
|
229
|
-
config = Marshal.load(Marshal.dump(config))
|
230
|
-
clear_level(config)
|
231
|
-
config
|
211
|
+
def disallow_exposing_of_config!(opts)
|
212
|
+
raise ArgumentError.new("Exposing the config is a security concern, and disallowed.") if opts.has_key?(:config)
|
232
213
|
end
|
233
|
-
|
234
214
|
end
|
235
215
|
end
|
236
216
|
end
|