artifactory 3.0.5 → 3.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/artifactory.rb +1 -1
- data/lib/artifactory/client.rb +2 -2
- data/lib/artifactory/configurable.rb +14 -14
- data/lib/artifactory/defaults.rb +1 -1
- data/lib/artifactory/errors.rb +1 -1
- data/lib/artifactory/resources/artifact.rb +8 -10
- data/lib/artifactory/resources/backup.rb +2 -0
- data/lib/artifactory/resources/base.rb +4 -2
- data/lib/artifactory/resources/build.rb +4 -4
- data/lib/artifactory/resources/build_component.rb +1 -0
- data/lib/artifactory/resources/certificate.rb +2 -1
- data/lib/artifactory/resources/group.rb +1 -0
- data/lib/artifactory/resources/layout.rb +1 -0
- data/lib/artifactory/resources/ldap_setting.rb +2 -0
- data/lib/artifactory/resources/mail_server.rb +1 -0
- data/lib/artifactory/resources/permission_target.rb +3 -1
- data/lib/artifactory/resources/repository.rb +1 -0
- data/lib/artifactory/resources/url_base.rb +1 -0
- data/lib/artifactory/resources/user.rb +1 -0
- data/lib/artifactory/util.rb +2 -1
- data/lib/artifactory/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f2ac1ef78888d5d68cd444274bfdc534226285b1680c3dbd5051e588a7e782c
|
4
|
+
data.tar.gz: 73dd6f6671ed821caf2bb0a2d209011848d62f7a2b29377d32b0b28ae672cf70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 547a6b02af33b3c6ae0dcef9f696bda622664256953963a93537075c84f5951eadc0191465598608a79ba7c4efe0441d03eb92e918df1812c70edc854bc83621
|
7
|
+
data.tar.gz: 0ef42dcf24579618c86fd7e8512021e4eef5c16cdc4dcef65116da36cab77403dc704b927708783c42ee8261975dce7dd14522b95db4f8dfc25fff2ec8c99989
|
data/lib/artifactory.rb
CHANGED
data/lib/artifactory/client.rb
CHANGED
@@ -208,7 +208,7 @@ module Artifactory
|
|
208
208
|
end
|
209
209
|
|
210
210
|
# Setup PATCH/POST/PUT
|
211
|
-
if
|
211
|
+
if %i{patch post put}.include?(verb)
|
212
212
|
if data.respond_to?(:read)
|
213
213
|
request.content_length = data.size
|
214
214
|
request.body_stream = data
|
@@ -314,7 +314,7 @@ module Artifactory
|
|
314
314
|
#
|
315
315
|
def build_uri(verb, path, params = {})
|
316
316
|
# Add any query string parameters
|
317
|
-
if
|
317
|
+
if %i{delete get}.include?(verb)
|
318
318
|
path = [path, to_query_string(params)].compact.join("?")
|
319
319
|
end
|
320
320
|
|
@@ -27,20 +27,20 @@ module Artifactory
|
|
27
27
|
# @return [Array<Symbol>]
|
28
28
|
#
|
29
29
|
def keys
|
30
|
-
@keys ||=
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
30
|
+
@keys ||= %i{
|
31
|
+
endpoint
|
32
|
+
username
|
33
|
+
password
|
34
|
+
api_key
|
35
|
+
proxy_address
|
36
|
+
proxy_password
|
37
|
+
proxy_port
|
38
|
+
proxy_username
|
39
|
+
ssl_pem_file
|
40
|
+
ssl_verify
|
41
|
+
user_agent
|
42
|
+
read_timeout
|
43
|
+
}
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
data/lib/artifactory/defaults.rb
CHANGED
data/lib/artifactory/errors.rb
CHANGED
@@ -98,8 +98,7 @@ module Artifactory
|
|
98
98
|
group: :g,
|
99
99
|
name: :a,
|
100
100
|
version: :v,
|
101
|
-
classifier: :c
|
102
|
-
)
|
101
|
+
classifier: :c)
|
103
102
|
params = Util.slice(options, :g, :a, :v, :c, :repos)
|
104
103
|
format_repos!(params)
|
105
104
|
|
@@ -293,14 +292,14 @@ module Artifactory
|
|
293
292
|
options = Util.rename_keys(options,
|
294
293
|
group: :g,
|
295
294
|
name: :a,
|
296
|
-
version: :v
|
297
|
-
)
|
295
|
+
version: :v)
|
298
296
|
params = Util.slice(options, :g, :a, :v, :repos)
|
299
297
|
format_repos!(params)
|
300
298
|
|
301
299
|
client.get("/api/search/versions", params)["results"]
|
302
300
|
rescue Error::HTTPError => e
|
303
301
|
raise unless e.code == 404
|
302
|
+
|
304
303
|
[]
|
305
304
|
end
|
306
305
|
|
@@ -344,8 +343,7 @@ module Artifactory
|
|
344
343
|
options = Util.rename_keys(options,
|
345
344
|
group: :g,
|
346
345
|
name: :a,
|
347
|
-
version: :v
|
348
|
-
)
|
346
|
+
version: :v)
|
349
347
|
params = Util.slice(options, :g, :a, :v, :repos, :remote)
|
350
348
|
format_repos!(params)
|
351
349
|
|
@@ -356,6 +354,7 @@ module Artifactory
|
|
356
354
|
client.get("/api/search/latestVersion", params)
|
357
355
|
rescue Error::HTTPError => e
|
358
356
|
raise unless e.code == 404
|
357
|
+
|
359
358
|
nil
|
360
359
|
end
|
361
360
|
|
@@ -555,6 +554,7 @@ module Artifactory
|
|
555
554
|
response = client.put(endpoint, file, headers)
|
556
555
|
|
557
556
|
return unless response.is_a?(Hash)
|
557
|
+
|
558
558
|
self.class.from_hash(response)
|
559
559
|
end
|
560
560
|
|
@@ -608,8 +608,7 @@ module Artifactory
|
|
608
608
|
def upload_with_checksum(repo, remote_path, checksum, properties = {})
|
609
609
|
upload(repo, remote_path, properties,
|
610
610
|
"X-Checksum-Deploy" => true,
|
611
|
-
"X-Checksum-Sha1" => checksum
|
612
|
-
)
|
611
|
+
"X-Checksum-Sha1" => checksum)
|
613
612
|
end
|
614
613
|
|
615
614
|
#
|
@@ -626,8 +625,7 @@ module Artifactory
|
|
626
625
|
#
|
627
626
|
def upload_from_archive(repo, remote_path, properties = {})
|
628
627
|
upload(repo, remote_path, properties,
|
629
|
-
"X-Explode-Archive" => true
|
630
|
-
)
|
628
|
+
"X-Explode-Archive" => true)
|
631
629
|
end
|
632
630
|
|
633
631
|
private
|
@@ -59,6 +59,7 @@ module Artifactory
|
|
59
59
|
find_from_config("config/backups/backup/key[text()='#{key}']", config, options)
|
60
60
|
rescue Error::HTTPError => e
|
61
61
|
raise unless e.code == 404
|
62
|
+
|
62
63
|
nil
|
63
64
|
end
|
64
65
|
|
@@ -102,6 +103,7 @@ module Artifactory
|
|
102
103
|
def find_from_config(xpath, config, options = {})
|
103
104
|
name_node = REXML::XPath.match(config, xpath)
|
104
105
|
return nil if name_node.empty?
|
106
|
+
|
105
107
|
properties = Util.xml_to_hash(name_node[0].parent, "excludedRepositories", false)
|
106
108
|
from_hash(properties, options)
|
107
109
|
end
|
@@ -156,6 +156,7 @@ module Artifactory
|
|
156
156
|
def find_from_config(xpath, config, options = {})
|
157
157
|
name_node = REXML::XPath.match(config, xpath)
|
158
158
|
return nil if name_node.empty?
|
159
|
+
|
159
160
|
properties = {}
|
160
161
|
name_node[0].parent.each_element_with_text do |e|
|
161
162
|
properties[e.name] = Util.to_type(e.text)
|
@@ -227,6 +228,7 @@ module Artifactory
|
|
227
228
|
#
|
228
229
|
def format_repos!(options)
|
229
230
|
return options if options[:repos].nil? || options[:repos].empty?
|
231
|
+
|
230
232
|
options[:repos] = Array(options[:repos]).compact.join(",")
|
231
233
|
options
|
232
234
|
end
|
@@ -340,7 +342,7 @@ module Artifactory
|
|
340
342
|
if properties.empty?
|
341
343
|
nil
|
342
344
|
else
|
343
|
-
";#{properties.join(
|
345
|
+
";#{properties.join(";")}"
|
344
346
|
end
|
345
347
|
end
|
346
348
|
|
@@ -377,7 +379,7 @@ module Artifactory
|
|
377
379
|
end
|
378
380
|
end.compact
|
379
381
|
|
380
|
-
"#<#{short_classname} #{list.join(
|
382
|
+
"#<#{short_classname} #{list.join(", ")}>"
|
381
383
|
end
|
382
384
|
|
383
385
|
private
|
@@ -49,6 +49,7 @@ module Artifactory
|
|
49
49
|
# builds. Whoever decided that was a good idea clearly doesn't
|
50
50
|
# understand the point of REST interfaces...
|
51
51
|
raise unless e.code == 404
|
52
|
+
|
52
53
|
[]
|
53
54
|
end
|
54
55
|
|
@@ -78,6 +79,7 @@ module Artifactory
|
|
78
79
|
from_hash(response["buildInfo"], client: client)
|
79
80
|
rescue Error::HTTPError => e
|
80
81
|
raise unless e.code == 404
|
82
|
+
|
81
83
|
nil
|
82
84
|
end
|
83
85
|
|
@@ -189,8 +191,7 @@ module Artifactory
|
|
189
191
|
|
190
192
|
endpoint = "/api/build/promote/#{url_safe(name)}/#{url_safe(number)}"
|
191
193
|
client.post(endpoint, JSON.fast_generate(request_body),
|
192
|
-
"Content-Type" => "application/json"
|
193
|
-
)
|
194
|
+
"Content-Type" => "application/json")
|
194
195
|
end
|
195
196
|
|
196
197
|
#
|
@@ -206,8 +207,7 @@ module Artifactory
|
|
206
207
|
file.rewind
|
207
208
|
|
208
209
|
client.put("/api/build", file,
|
209
|
-
"Content-Type" => "application/json"
|
210
|
-
)
|
210
|
+
"Content-Type" => "application/json")
|
211
211
|
true
|
212
212
|
ensure
|
213
213
|
if file
|
@@ -49,7 +49,7 @@ module Artifactory
|
|
49
49
|
def delete
|
50
50
|
client.delete(api_path)
|
51
51
|
true
|
52
|
-
rescue Error::HTTPError
|
52
|
+
rescue Error::HTTPError
|
53
53
|
false
|
54
54
|
end
|
55
55
|
|
@@ -72,6 +72,7 @@ module Artifactory
|
|
72
72
|
response = client.post(api_path, file, headers)
|
73
73
|
|
74
74
|
return unless response.is_a?(Hash)
|
75
|
+
|
75
76
|
self.class.all.select { |x| x.certificate_alias.eql?(certificate_alias) }.first
|
76
77
|
end
|
77
78
|
|
@@ -59,6 +59,7 @@ module Artifactory
|
|
59
59
|
find_from_config("config/security/ldapSettings/ldapSetting/key[text()='#{name}']", config, options)
|
60
60
|
rescue Error::HTTPError => e
|
61
61
|
raise unless e.code == 404
|
62
|
+
|
62
63
|
nil
|
63
64
|
end
|
64
65
|
|
@@ -100,6 +101,7 @@ module Artifactory
|
|
100
101
|
def find_from_config(xpath, config, options = {})
|
101
102
|
name_node = REXML::XPath.match(config, xpath)
|
102
103
|
return nil if name_node.empty?
|
104
|
+
|
103
105
|
properties = Util.xml_to_hash(name_node[0].parent, "search")
|
104
106
|
from_hash(properties, options)
|
105
107
|
end
|
@@ -66,6 +66,7 @@ module Artifactory
|
|
66
66
|
from_hash(response, client: client)
|
67
67
|
rescue Error::HTTPError => e
|
68
68
|
raise unless e.code == 404
|
69
|
+
|
69
70
|
nil
|
70
71
|
end
|
71
72
|
|
@@ -118,8 +119,9 @@ module Artifactory
|
|
118
119
|
def abbreviate_permissions(array)
|
119
120
|
inverse = VERBOSE_PERMS.invert
|
120
121
|
if (inverse.keys & array).sort != array.sort
|
121
|
-
raise "One of your principals contains an invalid permission. Valid permissions are #{inverse.keys.join(
|
122
|
+
raise "One of your principals contains an invalid permission. Valid permissions are #{inverse.keys.join(", ")}"
|
122
123
|
end
|
124
|
+
|
123
125
|
array.map { |elt| inverse[elt] }.sort
|
124
126
|
end
|
125
127
|
|
data/lib/artifactory/util.rb
CHANGED
@@ -49,7 +49,7 @@ module Artifactory
|
|
49
49
|
result = string
|
50
50
|
.to_s
|
51
51
|
.split("_")
|
52
|
-
.map
|
52
|
+
.map(&:capitalize)
|
53
53
|
.join
|
54
54
|
|
55
55
|
if lowercase
|
@@ -144,6 +144,7 @@ module Artifactory
|
|
144
144
|
return true if string.eql?("true")
|
145
145
|
return false if string.eql?("false")
|
146
146
|
return string.to_i if numeric?(string)
|
147
|
+
|
147
148
|
string
|
148
149
|
end
|
149
150
|
|
data/lib/artifactory/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: artifactory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chef Release Engineering Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-31 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A Ruby client for Artifactory
|
14
14
|
email: releng@chef.io
|