sensu-settings 3.1.0 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sensu/settings/loader.rb +2 -1
- data/lib/sensu/settings/validators/client.rb +10 -0
- data/sensu-settings.gemspec +1 -1
- data/spec/validator_spec.rb +6 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2a3bc1839a6bb401f3c669c081d03416855d502
|
4
|
+
data.tar.gz: a7741e0e1e8f4a0a836cc45f00c88617dded54f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1dd681e6a477fd9321b4daaaf2340d8bf7d31eda31e90ac2686a805c5cab55f6ae5150b16a9be553799ebca5df7a6e840a7c7a5853190fce6d1ff6946eed22d8
|
7
|
+
data.tar.gz: 0847523f88e6ae486a6efcfe3e4690db7d49ece84ba8272b48851eb9bb68c0bb2ce074c8b6a522be9958fe058aebac39cc3acf5137a9f703347448ea6af347f4
|
@@ -332,8 +332,9 @@ module Sensu
|
|
332
332
|
#
|
333
333
|
# @return [String] tempfile path.
|
334
334
|
def create_loaded_tempfile!
|
335
|
+
dir = ENV["SENSU_LOADED_TEMPFILE_DIR"] || Dir.tmpdir
|
335
336
|
file_name = "sensu_#{sensu_service_name}_loaded_files"
|
336
|
-
path = File.join(
|
337
|
+
path = File.join(dir, file_name)
|
337
338
|
File.open(path, "w") do |file|
|
338
339
|
file.write(@loaded_files.join(":"))
|
339
340
|
end
|
@@ -96,6 +96,15 @@ module Sensu
|
|
96
96
|
end
|
97
97
|
end
|
98
98
|
|
99
|
+
# Validate client signature.
|
100
|
+
# Validates: signature
|
101
|
+
#
|
102
|
+
# @param client [Hash] sensu client definition.
|
103
|
+
def validate_client_signature(client)
|
104
|
+
must_be_a_string_if_set(client[:signature]) ||
|
105
|
+
invalid(client, "client signature must be a string")
|
106
|
+
end
|
107
|
+
|
99
108
|
# Validate a Sensu client definition.
|
100
109
|
# Validates: name, address, safe_mode
|
101
110
|
#
|
@@ -115,6 +124,7 @@ module Sensu
|
|
115
124
|
validate_client_socket(client)
|
116
125
|
validate_client_keepalive(client)
|
117
126
|
validate_client_redact(client)
|
127
|
+
validate_client_signature(client)
|
118
128
|
end
|
119
129
|
end
|
120
130
|
end
|
data/sensu-settings.gemspec
CHANGED
data/spec/validator_spec.rb
CHANGED
@@ -519,6 +519,12 @@ describe "Sensu::Settings::Validator" do
|
|
519
519
|
client[:safe_mode] = false
|
520
520
|
@validator.validate_client(client)
|
521
521
|
expect(@validator.reset).to eq(0)
|
522
|
+
client[:signature] = 1
|
523
|
+
@validator.validate_client(client)
|
524
|
+
expect(@validator.reset).to eq(1)
|
525
|
+
client[:signature] = "foo"
|
526
|
+
@validator.validate_client(client)
|
527
|
+
expect(@validator.reset).to eq(0)
|
522
528
|
end
|
523
529
|
|
524
530
|
it "can validate client socket" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-settings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Porter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
140
|
version: '0'
|
141
141
|
requirements: []
|
142
142
|
rubyforge_project:
|
143
|
-
rubygems_version: 2.
|
143
|
+
rubygems_version: 2.4.5.1
|
144
144
|
signing_key:
|
145
145
|
specification_version: 4
|
146
146
|
summary: The Sensu settings library, loader and validator
|
@@ -157,3 +157,4 @@ test_files:
|
|
157
157
|
- spec/rules_spec.rb
|
158
158
|
- spec/settings_spec.rb
|
159
159
|
- spec/validator_spec.rb
|
160
|
+
has_rdoc:
|