sensu-settings 9.4.0 → 9.5.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: b484614c3fc088d87d77d21681a542f1960830e9
4
- data.tar.gz: e4a2b62b17eb316e05a32ed8bbccf47a38dba3ac
3
+ metadata.gz: cb593d35d703e565905e1a504e8102dccdc1d5e3
4
+ data.tar.gz: 8ce06fcb16b890779027f9ba261e7302acb9f386
5
5
  SHA512:
6
- metadata.gz: d646ab412368b058ae7e1fef88ef97a2f17380d00d47af6687cd64fdab7d033a21d6237214c0e81dd8879531f383d9be7f5935ef7e7c6337e9c935a321a4653e
7
- data.tar.gz: fca1f7742e5e88b5699987b673c4ed1816351dfc30b81af8356551380a366d41eeb621cb830bc94df1ec55bd566c5d64faf040ddc92a7fb1de0037bc7d6770c5
6
+ metadata.gz: 89cc81fa0b7c686a42980321a38822fb570cc7fb05980824224c68f494fb28cee86d9d9db2172c0dcdfda7eb3baadb5d6774783ba82c1fc7a874ef39466cfff4
7
+ data.tar.gz: 1a39bf6ebac14bac2779029bfd02b7e985dd9b39cdde129b0d135c3ccb1e1f90f271c2432038691d90f3f878e429cad91040c0387c1612fa3c8c57b3a96aa680
@@ -39,6 +39,28 @@ module Sensu
39
39
  end
40
40
  end
41
41
 
42
+ # Validate client http_socket.
43
+ # Validates: http_socket (bind, port, user, password)
44
+ #
45
+ # @param client [Hash] sensu client definition.
46
+ def validate_client_http_socket(client)
47
+ http_socket = client[:http_socket]
48
+ must_be_a_hash_if_set(http_socket) ||
49
+ invalid(client, "client http_socket must be a hash")
50
+ if is_a_hash?(http_socket)
51
+ must_be_a_string_if_set(http_socket[:bind]) ||
52
+ invalid(client, "client http_socket bind must be a string")
53
+ must_be_an_integer_if_set(http_socket[:port]) ||
54
+ invalid(client, "client http_socket port must be an integer")
55
+ if either_are_set?(http_socket[:user], http_socket[:password])
56
+ must_be_a_string(http_socket[:user]) ||
57
+ invalid(client, "client http_socket user must be a string")
58
+ must_be_a_string(http_socket[:password]) ||
59
+ invalid(client, "client http_socket password must be a string")
60
+ end
61
+ end
62
+ end
63
+
42
64
  # Validate client keepalives.
43
65
  # Validates: keepalives
44
66
  #
@@ -189,6 +211,7 @@ module Sensu
189
211
  validate_client_safe_mode(client)
190
212
  validate_client_subscriptions(client)
191
213
  validate_client_socket(client)
214
+ validate_client_http_socket(client)
192
215
  validate_client_keepalives(client)
193
216
  validate_client_keepalive(client)
194
217
  validate_client_redact(client)
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "sensu-settings"
5
- spec.version = "9.4.0"
5
+ spec.version = "9.5.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,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-settings
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.4.0
4
+ version: 9.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Porter