logstash-mixin-validator_support 1.1.0-java → 1.1.1-java

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
  SHA256:
3
- metadata.gz: d4d92360f385e48ab2bd2b76d890fb2adb0fe23d0d93bbfb3e342396f3541b69
4
- data.tar.gz: ae728708dc2ec8e9ef0781633f607ef5edb3b5621ae403ea94f9d1526f129214
3
+ metadata.gz: 159f311b4e84d43448ee190e79e43a7cb357e8428375e2a0a4df1c8d9410b4c3
4
+ data.tar.gz: 3ccacc4edcd70fe348ef64e5881149568dbe472bfec9cf932fc731f6440cc776
5
5
  SHA512:
6
- metadata.gz: 7f08e80456c929b66a6451d7d84beb44a12b3b4b10894e961a834f3548e564f21b22bef80b0145f739208988503329039f9cb0a18cc2016f3cd769900b966559
7
- data.tar.gz: 46fcfc6f9f888c9ab3962b540334b0e5347ac7154ef4c553e875986ce712cdf193f8c28774fe05c7f04e014b79c92258f389ac6b1960d0b36b7be9ed6e335e59
6
+ metadata.gz: f0599cb15cf09c700a401d14bc023aec8afee421a1d169654fa396e479544a0fec6a6a7bd754d0e503afb020f4f3b30eec144298be1910c900f1c258bedb34fc
7
+ data.tar.gz: d251678e6c755bc20887fc94fe9cdc51b11e8a5a6415169599b4554e9d47dfce3fc949ad3a5151c37e84c8b9625287a5887705dc9368c53a859101356d921812
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 1.1.1
2
+ - allow single word host names [#7](https://github.com/logstash-plugins/logstash-mixin-validator_support/pull/7)
3
+
1
4
  ## 1.1.0
2
5
  - Introduces `:required_host_optional_port` validator [#4](https://github.com/logstash-plugins/logstash-mixin-validator_support/pull/4)
3
6
 
@@ -13,7 +13,9 @@ module LogStash
13
13
  is_valid_ipv4 = ->(candidate) { Resolv::IPv4::Regex.match?(candidate) && Resolv::IPv4.create(candidate) rescue false}
14
14
  is_valid_ipv6 = ->(candidate) { Resolv::IPv6::Regex.match?(candidate) && Resolv::IPv6.create(candidate) rescue false}
15
15
 
16
- is_valid_hostname = ->(candidate) { (%r{\A([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}\Z}i).match?(candidate) }
16
+ # RFC1123 validated at https://regexr.com/7n2ce
17
+ rfc1123_hostname_pattern = %r{\A(?=.{1,255}\z)(?:(?=[^.]{1,63}(?:[.]|\z))[a-z0-9]+(?:[a-z0-9\-]+[a-z0-9])?(?:[.]|\z))+\z}i
18
+ is_valid_hostname = ->(candidate) { rfc1123_hostname_pattern.match?(candidate) }
17
19
 
18
20
  # the normalized tuple from valid values
19
21
  host_port_pair = Struct.new(:host, :port)
@@ -12,6 +12,7 @@ describe LogStash::PluginMixins::ValidatorSupport::RequiredHostOptionalPortValid
12
12
  {
13
13
  "127.0.0.1:1234" => {:host => "127.0.0.1", :port => 1234},
14
14
  "82.31.1.3:9800" => {:host => "82.31.1.3", :port => 9800},
15
+ "localhost:1234" => {:host => "localhost", :port => 1234},
15
16
  "foo.com:1234" => {:host => "foo.com", :port => 1234},
16
17
  "foo-bar-domain.com:9800" => {:host => "foo-bar-domain.com", :port => 9800},
17
18
  "[::1]:1234" => {:host => "::1", :port => 1234},
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-mixin-validator_support
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: java
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-02 00:00:00.000000000 Z
11
+ date: 2023-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement