sensu-settings 9.3.0 → 9.4.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/validators/client.rb +32 -0
- data/sensu-settings.gemspec +1 -1
- 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: b484614c3fc088d87d77d21681a542f1960830e9
|
4
|
+
data.tar.gz: e4a2b62b17eb316e05a32ed8bbccf47a38dba3ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/sensu-settings.gemspec
CHANGED
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.
|
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-
|
11
|
+
date: 2016-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sensu-json
|