dependabot-maven 0.141.1 → 0.143.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16fd9bc66bd0adf75ddf046b3c3d16a62eb23129bd3125ffee8c0cf874567153
|
4
|
+
data.tar.gz: 731a3832bc1433f5ca981ab0d20a02d81ccd22c9750178afc2175e76a6ed125c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6d17ebf6c3b84d430cdd1bae7f7ec2a8e2f1f0bf5805c012082b960fda9172e8a466fd2264d25b52c198dcc9b7e9f484ac704289dc143a819a49e4afe12b768
|
7
|
+
data.tar.gz: bd6887791bdccb84c820077f7ecece2d4d9673a5123d4e42e9910ab2dcd7165ad568cebbd918dd1fa78afbef35a00ac5bc18216764ca43361c58021648e2adc5
|
@@ -7,6 +7,7 @@ module Dependabot
|
|
7
7
|
module Maven
|
8
8
|
class Requirement < Gem::Requirement
|
9
9
|
quoted = OPS.keys.map { |k| Regexp.quote k }.join("|")
|
10
|
+
OR_SYNTAX = /(?<=\]|\)),/.freeze
|
10
11
|
PATTERN_RAW =
|
11
12
|
"\\s*(#{quoted})?\\s*(#{Maven::Version::VERSION_PATTERN})\\s*"
|
12
13
|
PATTERN = /\A#{PATTERN_RAW}\z/.freeze
|
@@ -46,7 +47,9 @@ module Dependabot
|
|
46
47
|
private
|
47
48
|
|
48
49
|
def self.split_java_requirement(req_string)
|
49
|
-
req_string.
|
50
|
+
return [req_string] unless req_string.match?(OR_SYNTAX)
|
51
|
+
|
52
|
+
req_string.split(OR_SYNTAX).flat_map do |str|
|
50
53
|
next str if str.start_with?("(", "[")
|
51
54
|
|
52
55
|
exacts, *rest = str.split(/,(?=\[|\()/)
|
@@ -62,9 +65,14 @@ module Dependabot
|
|
62
65
|
raise "Can't convert multiple Java reqs to a single Ruby one"
|
63
66
|
end
|
64
67
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
+
# NOTE: Support ruby-style version requirements that are created from
|
69
|
+
# PR ignore conditions
|
70
|
+
version_reqs = req_string.split(",").map(&:strip)
|
71
|
+
if req_string.include?(",") && !version_reqs.all? { |s| PATTERN.match?(s) }
|
72
|
+
convert_java_range_to_ruby_range(req_string) if req_string.include?(",")
|
73
|
+
else
|
74
|
+
version_reqs.map { |r| convert_java_equals_req_to_ruby(r) }
|
75
|
+
end
|
68
76
|
end
|
69
77
|
|
70
78
|
def convert_java_range_to_ruby_range(req_string)
|
@@ -95,10 +103,11 @@ module Dependabot
|
|
95
103
|
end
|
96
104
|
|
97
105
|
def convert_wildcard_req(req_string)
|
98
|
-
version = req_string.
|
99
|
-
return ">= 0" if version.empty?
|
106
|
+
version = req_string.split("+").first
|
107
|
+
return ">= 0" if version.nil? || version.empty?
|
100
108
|
|
101
|
-
"
|
109
|
+
version += "0" if version.end_with?(".")
|
110
|
+
"~> #{version}"
|
102
111
|
end
|
103
112
|
end
|
104
113
|
end
|
@@ -14,8 +14,6 @@ module Dependabot
|
|
14
14
|
class VersionFinder
|
15
15
|
TYPE_SUFFICES = %w(jre android java).freeze
|
16
16
|
|
17
|
-
MAVEN_RANGE_REGEX = /[\(\[].*,.*[\)\]]/.freeze
|
18
|
-
|
19
17
|
def initialize(dependency:, dependency_files:, credentials:,
|
20
18
|
ignored_versions:, security_advisories:,
|
21
19
|
raise_on_ignored: false)
|
@@ -95,10 +93,10 @@ module Dependabot
|
|
95
93
|
filtered = possible_versions
|
96
94
|
|
97
95
|
ignored_versions.each do |req|
|
98
|
-
|
96
|
+
ignore_requirements = Maven::Requirement.requirements_array(req)
|
99
97
|
filtered =
|
100
98
|
filtered.
|
101
|
-
reject { |v|
|
99
|
+
reject { |v| ignore_requirements.any? { |r| r.satisfied_by?(v.fetch(:version)) } }
|
102
100
|
end
|
103
101
|
|
104
102
|
raise AllVersionsIgnored if @raise_on_ignored && filtered.empty? && possible_versions.any?
|
@@ -106,12 +104,6 @@ module Dependabot
|
|
106
104
|
filtered
|
107
105
|
end
|
108
106
|
|
109
|
-
def parse_requirement_string(string)
|
110
|
-
return string if string.match?(MAVEN_RANGE_REGEX)
|
111
|
-
|
112
|
-
string.split(",").map(&:strip)
|
113
|
-
end
|
114
|
-
|
115
107
|
def filter_vulnerable_versions(possible_versions)
|
116
108
|
versions_array = possible_versions
|
117
109
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dependabot-maven
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.143.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dependabot
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-04-
|
11
|
+
date: 2021-04-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dependabot-common
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.143.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.143.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: byebug
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 1.
|
103
|
+
version: 1.13.0
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 1.
|
110
|
+
version: 1.13.0
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: simplecov
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -220,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
220
220
|
- !ruby/object:Gem::Version
|
221
221
|
version: 2.5.0
|
222
222
|
requirements: []
|
223
|
-
rubygems_version: 3.2.
|
223
|
+
rubygems_version: 3.2.15
|
224
224
|
signing_key:
|
225
225
|
specification_version: 4
|
226
226
|
summary: Maven support for dependabot
|