logstash-mixin-validator_support 1.0.1-java → 1.0.2-java
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13ac395ad145d01d61c2bdabe650b196c4be7acb6c368da1243b0a3631cc014b
|
4
|
+
data.tar.gz: 12e1918821bb58ce03193385764288bbd947441466d7be1140f5f0722ccadb4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c82c7c247334d02711f10e1ff3074b10cb01dc06932b6582cfee6199171ab28619e978eaf47799e32f2e3f13fb9e3ead252490f2cf01ce8937d7e3a7ca6380dd
|
7
|
+
data.tar.gz: add01c80a60310c57de1e4b0cf459ff78da4ad1f6cb97fdebbdff43757552ef2bdb897d0f0e61408b1323f79d1fd7182afdf870de65ab94288a4b076703c1792
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
-
#
|
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)
|
data/spec/logstash/plugin_mixins/validator_support/field_reference_validation_adapter_spec.rb
CHANGED
@@ -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.
|
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:
|
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
|
-
|
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
|