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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ea3160019d1e51d06445c7127de83cee7b3b2ed8
4
- data.tar.gz: e11e7fa4e4b5249952e5282c75202e85f0a74db5
3
+ metadata.gz: a2a3bc1839a6bb401f3c669c081d03416855d502
4
+ data.tar.gz: a7741e0e1e8f4a0a836cc45f00c88617dded54f3
5
5
  SHA512:
6
- metadata.gz: a505d51dfe881de20edfd91c4759dd3df12f29884ad27c1f3ce5663b19fcf4acfee79d5b5757a8330deb38624222818c8656fef40eeae527c4daa7f25861c788
7
- data.tar.gz: 2b3f4cca5fa7372596aa0c58eb973dd2081333df062c96ccc13e5b0ae45f93a4d14d5e4ded40dc5b0a59ded6f3eb0aa4002f3ce8727ef10c5512cce1df424516
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(Dir.tmpdir, file_name)
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "sensu-settings"
5
- spec.version = "3.1.0"
5
+ spec.version = "3.2.0"
6
6
  spec.authors = ["Sean Porter"]
7
7
  spec.email = ["portertech@gmail.com"]
8
8
  spec.summary = "The Sensu settings library, loader and validator"
@@ -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.1.0
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: 2015-08-06 00:00:00.000000000 Z
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.2.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: