logstash-mixin-validator_support 1.0.1-java → 1.0.2-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: c5e8b335df368ec737d61dcb43db27b9876979758c615b69ade06865a973e8b8
4
- data.tar.gz: b8668657d6af8402ed487f959750d03d49156d22f52304b4c463a8a7e0d1214f
3
+ metadata.gz: 13ac395ad145d01d61c2bdabe650b196c4be7acb6c368da1243b0a3631cc014b
4
+ data.tar.gz: 12e1918821bb58ce03193385764288bbd947441466d7be1140f5f0722ccadb4d
5
5
  SHA512:
6
- metadata.gz: 48b38367a6d71c35ad0fa8d65c898e01f13ef54c8e018259c01d7b620b43398d421735b853699b813af40630f60730a1ad34fc83ba1b57ea2d277781e5a2056e
7
- data.tar.gz: a6953c1504f89a087df7b9ffd890c8dc8db21cca1665eafed30c39d514c763315d77733637d0dc7a0fb710f25aec2c47da929c04e82f844588b6e9ceed8afc6d
6
+ metadata.gz: c82c7c247334d02711f10e1ff3074b10cb01dc06932b6582cfee6199171ab28619e978eaf47799e32f2e3f13fb9e3ead252490f2cf01ce8937d7e3a7ca6380dd
7
+ data.tar.gz: add01c80a60310c57de1e4b0cf459ff78da4ad1f6cb97fdebbdff43757552ef2bdb897d0f0e61408b1323f79d1fd7182afdf870de65ab94288a4b076703c1792
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
- # v1.0.0
1
+ # 1.0.2
2
+
3
+ - Fix: '' value behavior in `field_reference` validator [#2](https://github.com/logstash-plugins/logstash-mixin-validator_support/pull/2)
4
+
5
+ # 1.0.1
2
6
 
3
7
  - Introduces plugin parameter validation adapters, including initial backport for `:field_reference` validator.
@@ -16,10 +16,11 @@ module LogStash
16
16
 
17
17
  FieldReferenceValidationAdapter = NamedValidationAdapter.new(:field_reference) do |value|
18
18
  break ValidationResult.failure("Expected exactly one field reference, got `#{value.inspect}`") unless value.kind_of?(Array) && value.size <= 1
19
- break ValidationResult.success(nil) if value.empty? || value.first.nil?
20
19
 
21
20
  candidate = value.first
22
21
 
22
+ break ValidationResult.success(nil) if value.empty? || candidate.nil? || candidate.empty?
23
+
23
24
  break ValidationResult.failure("Expected a valid field reference, got `#{candidate.inspect}`") unless field_reference_pattern =~ candidate
24
25
 
25
26
  break ValidationResult.success(candidate)
@@ -28,6 +28,16 @@ describe LogStash::PluginMixins::ValidatorSupport::FieldReferenceValidationAdapt
28
28
  end
29
29
  end
30
30
 
31
+ context "valid input `''`" do
32
+ # failed in version 1.0.x which was not compatible with LS 7.x behavior
33
+ it 'correctly reports the value as valid' do
34
+ is_valid_result, coerced_or_error = described_class.validate ['']
35
+
36
+ expect(is_valid_result).to be true
37
+ expect(coerced_or_error).to be nil
38
+ end
39
+ end
40
+
31
41
  [
32
42
  ['link[0]'],
33
43
  ['][N\\//\\L][D'],
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.0.1
4
+ version: 1.0.2
5
5
  platform: java
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-15 00:00:00.000000000 Z
11
+ date: 2021-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -87,8 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
89
  requirements: []
90
- rubyforge_project:
91
- rubygems_version: 2.6.11
90
+ rubygems_version: 3.1.6
92
91
  signing_key:
93
92
  specification_version: 4
94
93
  summary: Support for the plugin parameter validations introduced in recent releases