sensu-settings 9.3.0 → 9.4.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c4404b91a440da9acdb694c506073a3702ef40ca
4
- data.tar.gz: d4aac5f73fef35b3147e51ad6cdab419f506994f
3
+ metadata.gz: b484614c3fc088d87d77d21681a542f1960830e9
4
+ data.tar.gz: e4a2b62b17eb316e05a32ed8bbccf47a38dba3ac
5
5
  SHA512:
6
- metadata.gz: cb3cd3de879fd8c2694922b92667a938e03b4ee9e5c5a77d762a335fe98cada55c5411a080097297d947387b6662a71f8a98f2bbc059924330b02ea2b83843dc
7
- data.tar.gz: 9b019fd3ffdf115e0e56ac3cdedb76dcd06156d0f6f2921e990d6f80ccfa407d6e384892913db54fc2a3065dc2c4eb459c76efd6790805259a3e7de789085f05
6
+ metadata.gz: d646ab412368b058ae7e1fef88ef97a2f17380d00d47af6687cd64fdab7d033a21d6237214c0e81dd8879531f383d9be7f5935ef7e7c6337e9c935a321a4653e
7
+ data.tar.gz: fca1f7742e5e88b5699987b673c4ed1816351dfc30b81af8356551380a366d41eeb621cb830bc94df1ec55bd566c5d64faf040ddc92a7fb1de0037bc7d6770c5
@@ -138,6 +138,37 @@ module Sensu
138
138
  invalid(client, "client registration must be a hash")
139
139
  if is_a_hash?(client[:registration])
140
140
  validate_client_registration_handlers(client)
141
+ must_be_an_integer_if_set(client[:registration][:status]) ||
142
+ invalid(client, "client registration status must be an integer")
143
+ end
144
+ end
145
+
146
+ # Validate client deregistration handlers.
147
+ # Validates: deregistration (handler, handlers)
148
+ #
149
+ # @param client [Hash] sensu client definition.
150
+ def validate_client_deregistration_handlers(client)
151
+ must_be_a_string_if_set(client[:deregistration][:handler]) ||
152
+ invalid(client, "client deregistration handler must be a string")
153
+ must_be_an_array_if_set(client[:deregistration][:handlers]) ||
154
+ invalid(client, "client deregistration handlers must be an array")
155
+ if is_an_array?(client[:deregistration][:handlers])
156
+ items_must_be_strings(client[:deregistration][:handlers]) ||
157
+ invalid(client, "client deregistration handlers must each be a string")
158
+ end
159
+ end
160
+
161
+ # Validate client deregistration.
162
+ # Validates: deregistration
163
+ #
164
+ # @param client [Hash] sensu client definition.
165
+ def validate_client_deregistration(client)
166
+ must_be_a_hash_if_set(client[:deregistration]) ||
167
+ invalid(client, "client deregistration must be a hash")
168
+ if is_a_hash?(client[:deregistration])
169
+ validate_client_deregistration_handlers(client)
170
+ must_be_an_integer_if_set(client[:deregistration][:status]) ||
171
+ invalid(client, "client deregistration status must be an integer")
141
172
  end
142
173
  end
143
174
 
@@ -163,6 +194,7 @@ module Sensu
163
194
  validate_client_redact(client)
164
195
  validate_client_signature(client)
165
196
  validate_client_registration(client)
197
+ validate_client_deregistration(client)
166
198
  end
167
199
  end
168
200
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "sensu-settings"
5
- spec.version = "9.3.0"
5
+ spec.version = "9.4.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"
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: 9.3.0
4
+ version: 9.4.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: 2016-11-21 00:00:00.000000000 Z
11
+ date: 2016-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-json