artifactory 2.8.2 → 3.0.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +5 -5
  2. data/lib/artifactory.rb +3 -2
  3. data/lib/artifactory/client.rb +16 -7
  4. data/lib/artifactory/collections/artifact.rb +1 -1
  5. data/lib/artifactory/collections/base.rb +1 -1
  6. data/lib/artifactory/collections/build.rb +1 -1
  7. data/lib/artifactory/configurable.rb +15 -15
  8. data/lib/artifactory/defaults.rb +2 -2
  9. data/lib/artifactory/errors.rb +6 -6
  10. data/lib/artifactory/resources/artifact.rb +17 -19
  11. data/lib/artifactory/resources/backup.rb +3 -1
  12. data/lib/artifactory/resources/base.rb +17 -7
  13. data/lib/artifactory/resources/build.rb +6 -6
  14. data/lib/artifactory/resources/build_component.rb +1 -0
  15. data/lib/artifactory/resources/certificate.rb +90 -0
  16. data/lib/artifactory/resources/group.rb +2 -1
  17. data/lib/artifactory/resources/layout.rb +2 -1
  18. data/lib/artifactory/resources/ldap_setting.rb +3 -1
  19. data/lib/artifactory/resources/mail_server.rb +2 -1
  20. data/lib/artifactory/resources/permission_target.rb +18 -2
  21. data/lib/artifactory/resources/plugin.rb +1 -1
  22. data/lib/artifactory/resources/repository.rb +5 -1
  23. data/lib/artifactory/resources/system.rb +1 -1
  24. data/lib/artifactory/resources/url_base.rb +2 -1
  25. data/lib/artifactory/resources/user.rb +2 -1
  26. data/lib/artifactory/util.rb +4 -3
  27. data/lib/artifactory/version.rb +2 -2
  28. metadata +11 -131
  29. data/.gitignore +0 -27
  30. data/.travis.yml +0 -28
  31. data/CHANGELOG.md +0 -141
  32. data/Gemfile +0 -14
  33. data/README.md +0 -288
  34. data/Rakefile +0 -28
  35. data/appveyor.yml +0 -30
  36. data/artifactory.gemspec +0 -25
  37. data/spec/integration/resources/artifact_spec.rb +0 -99
  38. data/spec/integration/resources/backup.rb +0 -22
  39. data/spec/integration/resources/build_component_spec.rb +0 -64
  40. data/spec/integration/resources/build_spec.rb +0 -38
  41. data/spec/integration/resources/group_spec.rb +0 -45
  42. data/spec/integration/resources/layout_spec.rb +0 -22
  43. data/spec/integration/resources/ldap_setting_spec.rb +0 -22
  44. data/spec/integration/resources/mail_server_spec.rb +0 -22
  45. data/spec/integration/resources/permission_target_spec.rb +0 -75
  46. data/spec/integration/resources/repository_spec.rb +0 -40
  47. data/spec/integration/resources/system_spec.rb +0 -58
  48. data/spec/integration/resources/url_base_spec.rb +0 -22
  49. data/spec/integration/resources/user_spec.rb +0 -45
  50. data/spec/spec_helper.rb +0 -52
  51. data/spec/support/api_server.rb +0 -49
  52. data/spec/support/api_server/artifact_endpoints.rb +0 -186
  53. data/spec/support/api_server/build_component_endpoints.rb +0 -44
  54. data/spec/support/api_server/build_endpoints.rb +0 -240
  55. data/spec/support/api_server/group_endpoints.rb +0 -53
  56. data/spec/support/api_server/permission_target_endpoints.rb +0 -53
  57. data/spec/support/api_server/repository_endpoints.rb +0 -114
  58. data/spec/support/api_server/status_endpoints.rb +0 -11
  59. data/spec/support/api_server/system_endpoints.rb +0 -104
  60. data/spec/support/api_server/user_endpoints.rb +0 -59
  61. data/spec/unit/artifactory_spec.rb +0 -73
  62. data/spec/unit/client_spec.rb +0 -132
  63. data/spec/unit/resources/artifact_spec.rb +0 -608
  64. data/spec/unit/resources/backup_spec.rb +0 -61
  65. data/spec/unit/resources/base_spec.rb +0 -180
  66. data/spec/unit/resources/build_component_spec.rb +0 -118
  67. data/spec/unit/resources/build_spec.rb +0 -347
  68. data/spec/unit/resources/defaults_spec.rb +0 -27
  69. data/spec/unit/resources/group_spec.rb +0 -108
  70. data/spec/unit/resources/layout_spec.rb +0 -61
  71. data/spec/unit/resources/ldap_setting_spec.rb +0 -65
  72. data/spec/unit/resources/mail_server_spec.rb +0 -57
  73. data/spec/unit/resources/permission_target_spec.rb +0 -189
  74. data/spec/unit/resources/plugin_spec.rb +0 -25
  75. data/spec/unit/resources/repository_spec.rb +0 -217
  76. data/spec/unit/resources/system_spec.rb +0 -90
  77. data/spec/unit/resources/url_base_spec.rb +0 -53
  78. data/spec/unit/resources/user_spec.rb +0 -115
@@ -1,44 +0,0 @@
1
- module Artifactory
2
- module APIServer::BuildComponentEndpoints
3
- def self.registered(app)
4
- app.get("/api/build") do
5
- content_type "application/vnd.org.jfrog.build.Builds+json"
6
- JSON.fast_generate(
7
- "uri" => server_url.join("/api/build"),
8
- "builds" => [
9
- {
10
- "uri" => "/wicket",
11
- "lastStarted" => "2015-06-19T20:13:20.222Z",
12
- },
13
- {
14
- "uri" => "/jackrabbit",
15
- "lastStarted" => "2015-06-20T20:13:20.333Z",
16
- },
17
- ]
18
- )
19
- end
20
-
21
- app.post("/api/build/rename/:name") do
22
- content_type "text/plain"
23
- body "Build renaming of '#{params['name']}' to '#{params['to']}' was successfully started."
24
- end
25
-
26
- app.delete("/api/build/:name") do
27
- content_type "text/plain"
28
-
29
- if params["deleteAll"]
30
- body "All '#{params['name']}' builds have been deleted successfully."
31
- elsif params["buildNumbers"].nil?
32
- status 400
33
- body "Please provide at least one build number to delete."
34
- else
35
- message = params["buildNumbers"].split(",").map do |n|
36
- "#{params['name']}##{n}"
37
- end.join(", ")
38
-
39
- body "The following builds has been deleted successfully: #{message}."
40
- end
41
- end
42
- end
43
- end
44
- end
@@ -1,240 +0,0 @@
1
- module Artifactory
2
- module APIServer::BuildEndpoints
3
- def self.registered(app)
4
- app.get("/api/build/wicket") do
5
- content_type "application/vnd.org.jfrog.build.BuildsByName+json"
6
- JSON.fast_generate(
7
- "uri" => server_url.join("/api/build/wicket"),
8
- "buildsNumbers" => [
9
- {
10
- "uri" => "/51",
11
- "started" => "2014-09-30T12:00:19.893+0300",
12
- },
13
- ]
14
- )
15
- end
16
-
17
- app.get("/api/build/wicket/51") do
18
- content_type "application/vnd.org.jfrog.build.BuildInfo+json"
19
- JSON.fast_generate(
20
- "uri" => server_url.join("/api/build/wicket/51"),
21
- "buildInfo" => {
22
- "properties" => {
23
- "buildInfo.env.JAVA_HOME" => "/usr/jdk/latest",
24
- },
25
- "version" => "1.0.1",
26
- "name" => "wicket",
27
- "number" => "51",
28
- "type" => "MAVEN",
29
- "buildAgent" => {
30
- "name" => "Maven",
31
- "version" => "3.0.5",
32
- },
33
- "agent" => {
34
- "name" => "Jenkins",
35
- "version" => "1.565.2",
36
- },
37
- "started" => "2014-09-30T12:00:19.893+0300",
38
- "durationMillis" => 8926,
39
- "artifactoryPrincipal" => "admin",
40
- "url" => "http://localhost:8080/job/Maven2-3/9/",
41
- "vcsRevision" => "83049487ecc61bef3dce798838e7a9457e174a5a",
42
- "vcsUrl" => "https://github.com/aseftel/project-examples",
43
- "licenseControl" => {
44
- "runChecks" => false,
45
- "includePublishedArtifacts" => false,
46
- "autoDiscover" => true,
47
- "scopesList" => "",
48
- "licenseViolationsRecipientsList" => "",
49
- },
50
- "buildRetention" => {
51
- "count" => -1,
52
- "deleteBuildArtifacts" => true,
53
- "buildNumbersNotToBeDiscarded" => [],
54
- },
55
- "modules" => [
56
- {
57
- "properties" => {
58
- "project.build.sourceEncoding" => "UTF-8",
59
- },
60
- "id" => "org.jfrog.test:multi:2.19-SNAPSHOT",
61
- "artifacts" => [
62
- {
63
- "type" => "pom",
64
- "sha1" => "045b66ebbf8504002b626f592d087612aca36582",
65
- "md5" => "c25542a353dab1089cd186465dc47a68",
66
- "name" => "multi-2.19-SNAPSHOT.pom",
67
- },
68
- ],
69
- },
70
- {
71
- "properties" => {
72
- "project.build.sourceEncoding" => "UTF-8",
73
- },
74
- "id" => "org.jfrog.test:multi1:2.19-SNAPSHOT",
75
- "artifacts" => [
76
- {
77
- "type" => "jar",
78
- "sha1" => "f4c5c9cb3091011ec2a895b3dedd7f10d847361c",
79
- "md5" => "d1fd850a3582efba41092c624e0b46b8",
80
- "name" => "multi1-2.19-SNAPSHOT.jar",
81
- },
82
- {
83
- "type" => "pom",
84
- "sha1" => "2ddbf9824676f548d637726d3bcbb494ba823090",
85
- "md5" => "a64aa7f305f63a85e63a0155ff0fb404",
86
- "name" => "multi1-2.19-SNAPSHOT.pom",
87
- },
88
- {
89
- "type" => "jar",
90
- "sha1" => "6fdd143a44cea3a2636660c5c266c95c27e50abc",
91
- "md5" => "12a1e438f4bef8c4b740fe848a1704a4",
92
- "id" => "org.slf4j:slf4j-simple:1.4.3",
93
- "scopes" => [ "compile" ],
94
- },
95
- {
96
- "type" => "jar",
97
- "sha1" => "496e91f7df8a0417e00cecdba840cdf0e5f2472c",
98
- "md5" => "76a412a37c9d18659d2dacccdb1c24ff",
99
- "id" => "org.jenkins-ci.lib:dry-run-lib:0.1",
100
- "scopes" => [ "compile" ],
101
- },
102
- ],
103
- },
104
- {
105
- "properties" => {
106
- "daversion" => "2.19-SNAPSHOT",
107
- "project.build.sourceEncoding" => "UTF-8",
108
- },
109
- "id" => "org.jfrog.test:multi2:2.19-SNAPSHOT",
110
- "artifacts" => [
111
- {
112
- "type" => "txt",
113
- "name" => "multi2-2.19-SNAPSHOT.txt",
114
- },
115
- {
116
- "type" => "java-source-jar",
117
- "sha1" => "49108b0c7db5fdb4efe3c29a5a9f54e806aecb62",
118
- "md5" => "0e2c5473cf2a9b694afb4a2e8da34b53",
119
- "name" => "multi2-2.19-SNAPSHOT-sources.jar" },
120
- {
121
- "type" => "jar",
122
- "sha1" => "476e89d290ae36dabb38ff22f75f264ae019d542",
123
- "md5" => "fa9b3df58ac040fffcff9310f261be80",
124
- "name" => "multi2-2.19-SNAPSHOT.jar",
125
- },
126
- {
127
- "type" => "pom",
128
- "sha1" => "b719b90364e5ae38cda358072f61f821bdae5d5d",
129
- "md5" => "8d5060005235d75907baca4490cf60bf",
130
- "name" => "multi2-2.19-SNAPSHOT.pom",
131
- },
132
- ],
133
- "dependencies" => [
134
- {
135
- "type" => "jar",
136
- "sha1" => "19d4e90b43059058f6e056f794f0ea4030d60b86",
137
- "md5" => "dcd95bcb84b09897b2b66d4684c040da",
138
- "id" => "xpp3:xpp3_min:1.1.4c",
139
- "scopes" => [ "provided" ],
140
- },
141
- {
142
- "type" => "jar",
143
- "sha1" => "e2d866af5518e81282838301b49a1bd2452619d3",
144
- "md5" => "e9e4b59c69305ba3698dd61c5dfc4fc8",
145
- "id" => "org.jvnet.hudson.plugins:perforce:1.3.7",
146
- "scopes" => [ "compile" ],
147
- },
148
- {
149
- "type" => "jar",
150
- "sha1" => "6fdd143a44cea3a2636660c5c266c95c27e50abc",
151
- "md5" => "12a1e438f4bef8c4b740fe848a1704a4",
152
- "id" => "org.slf4j:slf4j-simple:1.4.3",
153
- "scopes" => [ "compile" ],
154
- },
155
- {
156
- "type" => "jar",
157
- "sha1" => "496e91f7df8a0417e00cecdba840cdf0e5f2472c",
158
- "md5" => "76a412a37c9d18659d2dacccdb1c24ff",
159
- "id" => "org.jenkins-ci.lib:dry-run-lib:0.1",
160
- "scopes" => [ "compile" ],
161
- },
162
- ],
163
- },
164
- {
165
- "properties" => {
166
- "project.build.sourceEncoding" => "UTF-8",
167
- },
168
- "id" => "org.jfrog.test:multi3:2.19-SNAPSHOT",
169
- "artifacts" => [
170
- {
171
- "type" => "java-source-jar",
172
- "sha1" => "3cd104785167ac37ef999431f308ffef10810348",
173
- "md5" => "c683276f8dda97078ae8eb5e26bb3ee5",
174
- "name" => "multi3-2.19-SNAPSHOT-sources.jar",
175
- },
176
- {
177
- "type" => "war",
178
- "sha1" => "34aeebeb805b23922d9d05507404533518cf81e4",
179
- "md5" => "55af06a2175cfb23cc6dc3931475b57c",
180
- "name" => "multi3-2.19-SNAPSHOT.war",
181
- },
182
- {
183
- "type" => "jar",
184
- "sha1" => "496e91f7df8a0417e00cecdba840cdf0e5f2472c",
185
- "md5" => "76a412a37c9d18659d2dacccdb1c24ff",
186
- "id" => "org.jenkins-ci.lib:dry-run-lib:0.1",
187
- "scopes" => [ "compile" ],
188
- },
189
- {
190
- "type" => "jar",
191
- "sha1" => "7e9978fdb754bce5fcd5161133e7734ecb683036",
192
- "md5" => "7df83e09e41d742cc5fb20d16b80729c",
193
- "id" => "hsqldb:hsqldb:1.8.0.10",
194
- "scopes" => [ "runtime" ],
195
- },
196
- ],
197
- },
198
- ],
199
- "governance" => {
200
- "blackDuckProperties" => {
201
- "runChecks" => false,
202
- "includePublishedArtifacts" => false,
203
- "autoCreateMissingComponentRequests" => false,
204
- "autoDiscardStaleComponentRequests" => false,
205
- },
206
- },
207
- "statuses" => [ {
208
- "status" => "promoted",
209
- "comment" => "",
210
- "repository" => "omnibus-stable-local",
211
- "timestamp" => "2017-02-20T12:33:59.570+0100",
212
- "user" => "doge",
213
- "ciUser" => "doge",
214
- "timestampDate" => 1487590439570,
215
- } ],
216
- }
217
- )
218
- end
219
-
220
- app.put("/api/build") do
221
- status 204
222
- body ""
223
- end
224
-
225
- app.post("/api/build/promote/wicket/51") do
226
- content_type "application/vnd.org.jfrog.artifactory.build.PromotionResult+json"
227
-
228
- JSON.fast_generate(
229
- "uri" => server_url.join("/api/build/wicket"),
230
- "buildsNumbers" => [
231
- {
232
- "uri" => "/51",
233
- "started" => "2014-09-30T12:00:19.893+0300",
234
- },
235
- ]
236
- )
237
- end
238
- end
239
- end
240
- end
@@ -1,53 +0,0 @@
1
- module Artifactory
2
- module APIServer::GroupEndpoints
3
- def self.registered(app)
4
- app.get("/api/security/groups") do
5
- content_type "application/vnd.org.jfrog.artifactory.security.Groups+json"
6
- JSON.fast_generate([
7
- {
8
- "name" => "readers",
9
- "uri" => server_url.join("/api/security/groups/readers"),
10
- },
11
- {
12
- "name" => "tech-leads",
13
- "uri" => server_url.join("/api/security/groups/tech-leads"),
14
- },
15
- ])
16
- end
17
-
18
- app.get("/api/security/groups/readers") do
19
- content_type "application/vnd.org.jfrog.artifactory.security.Group+json"
20
- JSON.fast_generate(
21
- "name" => "readers",
22
- "description" => "This list of read-only users",
23
- "autoJoin" => true,
24
- "realm" => "artifactory",
25
- "realmAttributes" => nil
26
- )
27
- end
28
-
29
- app.get("/api/security/groups/tech-leads") do
30
- content_type "application/vnd.org.jfrog.artifactory.security.Group+json"
31
- JSON.fast_generate(
32
- "name" => "tech-leads",
33
- "description" => "This development leads group",
34
- "autoJoin" => false,
35
- "realm" => "artifactory",
36
- "realmAttributes" => nil
37
- )
38
- end
39
-
40
- app.put("/api/security/groups/:name") do
41
- return 415 unless request.content_type == "application/vnd.org.jfrog.artifactory.security.Group+json"
42
-
43
- # Attempt to parse the response; if this succeeds, all is well...
44
- JSON.parse(request.body.read)
45
- nil
46
- end
47
-
48
- app.delete("/api/security/groups/:name") do
49
- nil
50
- end
51
- end
52
- end
53
- end
@@ -1,53 +0,0 @@
1
- module Artifactory
2
- module APIServer::PermissionTargetEndpoints
3
- def self.registered(app)
4
- app.get("/api/security/permissions") do
5
- content_type "application/vnd.org.jfrog.artifactory.security.PermissionTargets+json"
6
- JSON.fast_generate([
7
- {
8
- "name" => "Anything",
9
- "uri" => server_url.join("/api/security/permissions/Anything"),
10
- },
11
- {
12
- "name" => "Any Remote",
13
- "uri" => server_url.join("/api/security/permissions/Any%20Remote"),
14
- },
15
- ])
16
- end
17
-
18
- app.get("/api/security/permissions/Any%20Remote") do
19
- content_type "application/vnd.org.jfrog.artifactory.security.PermissionTargets+json"
20
- JSON.fast_generate(
21
- "name" => "Any Remote",
22
- "includes_pattern" => nil,
23
- "excludes_pattern" => "",
24
- "repositories" => ["ANY REMOTE"],
25
- "principals" => { "users" => { "anonymous" => %w{w r} }, "groups" => nil }
26
- )
27
- end
28
-
29
- app.get("/api/security/permissions/Anything") do
30
- content_type "application/vnd.org.jfrog.artifactory.security.PermissionTargets+json"
31
- JSON.fast_generate(
32
- "name" => "Anything",
33
- "includes_pattern" => nil,
34
- "excludes_pattern" => "",
35
- "repositories" => ["ANY"],
36
- "principals" => { "users" => { "anonymous" => ["r"] }, "groups" => { "readers" => %w{r m} } }
37
- )
38
- end
39
-
40
- app.put("/api/security/permissions/:name") do
41
- return 415 unless request.content_type == "application/vnd.org.jfrog.artifactory.security.PermissionTarget+json"
42
-
43
- # Attempt to parse the response; if this succeeds, all is well...
44
- JSON.parse(request.body.read)
45
- nil
46
- end
47
-
48
- app.delete("/api/security/permissions/:name") do
49
- nil
50
- end
51
- end
52
- end
53
- end
@@ -1,114 +0,0 @@
1
- module Artifactory
2
- module APIServer::RepositoryEndpoints
3
- def self.registered(app)
4
- app.get("/api/repositories") do
5
- content_type "application/vnd.org.jfrog.artifactory.repositories.RepositoryDetailsList+json"
6
- JSON.fast_generate([
7
- {
8
- "key" => "libs-release-local",
9
- "type" => "LOCAL",
10
- "description" => "Local repository for in-house libraries",
11
- "url" => server_url.join("libs-release-local"),
12
- },
13
- {
14
- "key" => "libs-snapshots-local",
15
- "type" => "LOCAL",
16
- "description" => "Local repository for in-house snapshots",
17
- "url" => server_url.join("libs-snapshots-local"),
18
- },
19
- ])
20
- end
21
-
22
- app.get("/api/repositories/libs-release-local") do
23
- content_type "application/vnd.org.jfrog.artifactory.repositories.LocalRepositoryConfiguration+json"
24
- JSON.fast_generate({
25
- "key" => "libs-release-local",
26
- "description" => "Local repository for in-house libraries",
27
- "notes" => "",
28
- "includesPattern" => "**/*",
29
- "excludesPattern" => "",
30
- "repoLayoutRef" => "simple-default",
31
- "enableNuGetSupport" => false,
32
- "enableGemsSupport" => false,
33
- "checksumPolicyType" => "client-checksums",
34
- "handleReleases" => true,
35
- "handleSnapshots" => false,
36
- "maxUniqueSnapshots" => 0,
37
- "snapshotVersionBehavior" => "unique",
38
- "suppressPomConsistencyChecks" => false,
39
- "blackedOut" => false,
40
- "propertySets" => ["artifactory"],
41
- "archiveBrowsingEnabled" => false,
42
- "calculateYumMetadata" => false,
43
- "yumRootDepth" => 0,
44
- "rclass" => "local",
45
- "packageType" => "generic",
46
- })
47
- end
48
-
49
- app.get("/api/repositories/libs-snapshots-local") do
50
- content_type "application/vnd.org.jfrog.artifactory.repositories.LocalRepositoryConfiguration+json"
51
- JSON.fast_generate({
52
- "key" => "libs-snapshots-local",
53
- "description" => "Local repository for in-house snapshots",
54
- "notes" => "",
55
- "includesPattern" => "**/*",
56
- "excludesPattern" => "",
57
- "repoLayoutRef" => "simple-default",
58
- "enableNuGetSupport" => false,
59
- "enableGemsSupport" => false,
60
- "checksumPolicyType" => "client-checksums",
61
- "handleReleases" => false,
62
- "handleSnapshots" => true,
63
- "maxUniqueSnapshots" => 10,
64
- "snapshotVersionBehavior" => "unique",
65
- "suppressPomConsistencyChecks" => false,
66
- "blackedOut" => false,
67
- "propertySets" => ["artifactory"],
68
- "archiveBrowsingEnabled" => false,
69
- "calculateYumMetadata" => false,
70
- "yumRootDepth" => 0,
71
- "rclass" => "local",
72
- "packageType" => "generic",
73
- })
74
- end
75
-
76
- app.get("/api/repositories/libs-debian-local") do
77
- content_type "application/vnd.org.jfrog.artifactory.repositories.LocalRepositoryConfiguration+json"
78
- JSON.fast_generate({
79
- "key" => "libs-debian-local",
80
- "description" => "Local repository for in-house snapshots",
81
- "notes" => "",
82
- "includesPattern" => "**/*",
83
- "excludesPattern" => "",
84
- "repoLayoutRef" => "simple-default",
85
- "enableNuGetSupport" => false,
86
- "enableGemsSupport" => false,
87
- "checksumPolicyType" => "client-checksums",
88
- "handleReleases" => false,
89
- "handleSnapshots" => true,
90
- "maxUniqueSnapshots" => 10,
91
- "snapshotVersionBehavior" => "unique",
92
- "suppressPomConsistencyChecks" => false,
93
- "blackedOut" => false,
94
- "propertySets" => ["artifactory"],
95
- "archiveBrowsingEnabled" => false,
96
- "calculateYumMetadata" => false,
97
- "yumRootDepth" => 0,
98
- "rclass" => "local",
99
- "packageType" => "debian",
100
- })
101
- end
102
-
103
- # Simulate a non-existent repository
104
- app.get("/api/repositories/libs-testing-local") do
105
- status 400
106
- end
107
-
108
- app.put("/api/repositories/libs-testing-local") do
109
- content_type "text/plain"
110
- "Repository libs-resting-local created successfully!\n"
111
- end
112
- end
113
- end
114
- end