cloudsmith-api 2.0.23 → 2.0.24
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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +17 -4
- data/build.json +1 -1
- data/docs/FormatSupport.md +1 -0
- data/docs/GenericPackageUpload.md +90 -0
- data/docs/GenericPackageUploadRequest.md +13 -0
- data/docs/GenericUpstream.md +33 -0
- data/docs/GenericUpstreamRequest.md +21 -0
- data/docs/GenericUpstreamRequestPatch.md +21 -0
- data/docs/MavenUpstream.md +1 -0
- data/docs/MavenUpstreamRequest.md +1 -0
- data/docs/MavenUpstreamRequestPatch.md +1 -0
- data/docs/OrganizationTeam.md +1 -1
- data/docs/OrganizationTeamRequest.md +1 -1
- data/docs/OrganizationTeamRequestPatch.md +1 -1
- data/docs/Package.md +1 -0
- data/docs/PackageCopy.md +1 -0
- data/docs/PackageCopyRequest.md +1 -1
- data/docs/PackageMove.md +1 -0
- data/docs/PackageMoveRequest.md +1 -1
- data/docs/PackageQuarantine.md +1 -0
- data/docs/PackageResync.md +1 -0
- data/docs/PackageTag.md +1 -0
- data/docs/PackagesApi.md +131 -0
- data/docs/ReposApi.md +401 -0
- data/lib/cloudsmith-api/api/packages_api.rb +123 -0
- data/lib/cloudsmith-api/api/repos_api.rb +395 -0
- data/lib/cloudsmith-api/models/format_support.rb +16 -1
- data/lib/cloudsmith-api/models/generic_package_upload.rb +992 -0
- data/lib/cloudsmith-api/models/generic_package_upload_request.rb +245 -0
- data/lib/cloudsmith-api/models/generic_upstream.rb +503 -0
- data/lib/cloudsmith-api/models/generic_upstream_request.rb +375 -0
- data/lib/cloudsmith-api/models/generic_upstream_request_patch.rb +365 -0
- data/lib/cloudsmith-api/models/maven_upstream.rb +25 -1
- data/lib/cloudsmith-api/models/maven_upstream_request.rb +25 -1
- data/lib/cloudsmith-api/models/maven_upstream_request_patch.rb +25 -1
- data/lib/cloudsmith-api/models/organization_team.rb +1 -0
- data/lib/cloudsmith-api/models/organization_team_request.rb +1 -0
- data/lib/cloudsmith-api/models/organization_team_request_patch.rb +1 -0
- data/lib/cloudsmith-api/models/package.rb +11 -1
- data/lib/cloudsmith-api/models/package_copy.rb +11 -1
- data/lib/cloudsmith-api/models/package_copy_request.rb +1 -0
- data/lib/cloudsmith-api/models/package_move.rb +11 -1
- data/lib/cloudsmith-api/models/package_move_request.rb +1 -0
- data/lib/cloudsmith-api/models/package_quarantine.rb +11 -1
- data/lib/cloudsmith-api/models/package_resync.rb +11 -1
- data/lib/cloudsmith-api/models/package_tag.rb +11 -1
- data/lib/cloudsmith-api/version.rb +1 -1
- data/lib/cloudsmith-api.rb +5 -0
- data/spec/api/packages_api_spec.rb +28 -0
- data/spec/api/repos_api_spec.rb +87 -0
- data/spec/models/format_support_spec.rb +6 -0
- data/spec/models/generic_package_upload_request_spec.rb +71 -0
- data/spec/models/generic_package_upload_spec.rb +537 -0
- data/spec/models/generic_upstream_request_patch_spec.rb +127 -0
- data/spec/models/generic_upstream_request_spec.rb +127 -0
- data/spec/models/generic_upstream_spec.rb +203 -0
- data/spec/models/maven_upstream_request_patch_spec.rb +10 -0
- data/spec/models/maven_upstream_request_spec.rb +10 -0
- data/spec/models/maven_upstream_spec.rb +10 -0
- data/spec/models/package_copy_spec.rb +6 -0
- data/spec/models/package_move_spec.rb +6 -0
- data/spec/models/package_quarantine_spec.rb +6 -0
- data/spec/models/package_resync_spec.rb +6 -0
- data/spec/models/package_spec.rb +6 -0
- data/spec/models/package_tag_spec.rb +6 -0
- data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/autotest-fsevent-0.3.1/gem_make.out +1 -1
- data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/bigdecimal-4.0.1/gem_make.out +2 -2
- data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/bigdecimal-4.0.1/mkmf.log +4 -4
- data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/ffi-1.17.3/gem_make.out +2 -2
- data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/ffi-1.17.3/mkmf.log +1 -1
- data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/json-2.7.6/gem_make.out +2 -2
- data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/json-2.7.6/mkmf.log +1 -1
- data/vendor/bundle/ruby/2.6.0/gems/bigdecimal-4.0.1/ext/bigdecimal/Makefile +2 -2
- data/vendor/bundle/ruby/2.6.0/gems/ffi-1.17.3/ext/ffi_c/Makefile +2 -2
- data/vendor/bundle/ruby/2.6.0/gems/json-2.7.6/ext/json/ext/generator/Makefile +2 -2
- data/vendor/bundle/ruby/2.6.0/gems/json-2.7.6/ext/json/ext/parser/Makefile +2 -2
- metadata +25 -5
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Cloudsmith API (v1)
|
|
3
|
+
|
|
4
|
+
#The API to the Cloudsmith Service
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: v1
|
|
7
|
+
Contact: support@cloudsmith.io
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: 2.4.50
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
|
|
15
|
+
module CloudsmithApi
|
|
16
|
+
class GenericUpstreamRequestPatch
|
|
17
|
+
# The authentication mode to use when accessing this upstream.
|
|
18
|
+
attr_accessor :auth_mode
|
|
19
|
+
|
|
20
|
+
# Secret to provide with requests to upstream.
|
|
21
|
+
attr_accessor :auth_secret
|
|
22
|
+
|
|
23
|
+
# Username to provide with requests to upstream.
|
|
24
|
+
attr_accessor :auth_username
|
|
25
|
+
|
|
26
|
+
# The key for extra header #1 to send to upstream.
|
|
27
|
+
attr_accessor :extra_header_1
|
|
28
|
+
|
|
29
|
+
# The key for extra header #2 to send to upstream.
|
|
30
|
+
attr_accessor :extra_header_2
|
|
31
|
+
|
|
32
|
+
# The value for extra header #1 to send to upstream. This is stored as plaintext, and is NOT encrypted.
|
|
33
|
+
attr_accessor :extra_value_1
|
|
34
|
+
|
|
35
|
+
# The value for extra header #2 to send to upstream. This is stored as plaintext, and is NOT encrypted.
|
|
36
|
+
attr_accessor :extra_value_2
|
|
37
|
+
|
|
38
|
+
# Whether or not this upstream is active and ready for requests.
|
|
39
|
+
attr_accessor :is_active
|
|
40
|
+
|
|
41
|
+
# The mode that this upstream should operate in. Upstream sources can be used to proxy resolved packages, as well as operate in a proxy/cache or cache only mode.
|
|
42
|
+
attr_accessor :mode
|
|
43
|
+
|
|
44
|
+
# A descriptive name for this upstream source. A shortened version of this name will be used for tagging cached packages retrieved from this upstream.
|
|
45
|
+
attr_accessor :name
|
|
46
|
+
|
|
47
|
+
# Upstream sources are selected for resolving requests by sequential order (1..n), followed by creation date.
|
|
48
|
+
attr_accessor :priority
|
|
49
|
+
|
|
50
|
+
# A unique prefix used to distinguish this upstream source within the repository. Generic upstreams can represent entirely different file servers, and we do not attempt to blend them. The prefix ensures each source remains separate, and requests including this prefix are routed to the correct upstream.
|
|
51
|
+
attr_accessor :upstream_prefix
|
|
52
|
+
|
|
53
|
+
# The URL for this upstream source. This must be a fully qualified URL including any path elements required to reach the root of the repository.
|
|
54
|
+
attr_accessor :upstream_url
|
|
55
|
+
|
|
56
|
+
# If enabled, SSL certificates are verified when requests are made to this upstream. It's recommended to leave this enabled for all public sources to help mitigate Man-In-The-Middle (MITM) attacks. Please note this only applies to HTTPS upstreams.
|
|
57
|
+
attr_accessor :verify_ssl
|
|
58
|
+
|
|
59
|
+
class EnumAttributeValidator
|
|
60
|
+
attr_reader :datatype
|
|
61
|
+
attr_reader :allowable_values
|
|
62
|
+
|
|
63
|
+
def initialize(datatype, allowable_values)
|
|
64
|
+
@allowable_values = allowable_values.map do |value|
|
|
65
|
+
case datatype.to_s
|
|
66
|
+
when /Integer/i
|
|
67
|
+
value.to_i
|
|
68
|
+
when /Float/i
|
|
69
|
+
value.to_f
|
|
70
|
+
else
|
|
71
|
+
value
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
def valid?(value)
|
|
77
|
+
!value || allowable_values.include?(value)
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
82
|
+
def self.attribute_map
|
|
83
|
+
{
|
|
84
|
+
:'auth_mode' => :'auth_mode',
|
|
85
|
+
:'auth_secret' => :'auth_secret',
|
|
86
|
+
:'auth_username' => :'auth_username',
|
|
87
|
+
:'extra_header_1' => :'extra_header_1',
|
|
88
|
+
:'extra_header_2' => :'extra_header_2',
|
|
89
|
+
:'extra_value_1' => :'extra_value_1',
|
|
90
|
+
:'extra_value_2' => :'extra_value_2',
|
|
91
|
+
:'is_active' => :'is_active',
|
|
92
|
+
:'mode' => :'mode',
|
|
93
|
+
:'name' => :'name',
|
|
94
|
+
:'priority' => :'priority',
|
|
95
|
+
:'upstream_prefix' => :'upstream_prefix',
|
|
96
|
+
:'upstream_url' => :'upstream_url',
|
|
97
|
+
:'verify_ssl' => :'verify_ssl'
|
|
98
|
+
}
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Attribute type mapping.
|
|
102
|
+
def self.swagger_types
|
|
103
|
+
{
|
|
104
|
+
:'auth_mode' => :'String',
|
|
105
|
+
:'auth_secret' => :'String',
|
|
106
|
+
:'auth_username' => :'String',
|
|
107
|
+
:'extra_header_1' => :'String',
|
|
108
|
+
:'extra_header_2' => :'String',
|
|
109
|
+
:'extra_value_1' => :'String',
|
|
110
|
+
:'extra_value_2' => :'String',
|
|
111
|
+
:'is_active' => :'BOOLEAN',
|
|
112
|
+
:'mode' => :'String',
|
|
113
|
+
:'name' => :'String',
|
|
114
|
+
:'priority' => :'Integer',
|
|
115
|
+
:'upstream_prefix' => :'String',
|
|
116
|
+
:'upstream_url' => :'String',
|
|
117
|
+
:'verify_ssl' => :'BOOLEAN'
|
|
118
|
+
}
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Initializes the object
|
|
122
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
123
|
+
def initialize(attributes = {})
|
|
124
|
+
return unless attributes.is_a?(Hash)
|
|
125
|
+
|
|
126
|
+
# convert string to symbol for hash key
|
|
127
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
128
|
+
|
|
129
|
+
if attributes.has_key?(:'auth_mode')
|
|
130
|
+
self.auth_mode = attributes[:'auth_mode']
|
|
131
|
+
else
|
|
132
|
+
self.auth_mode = 'None'
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
if attributes.has_key?(:'auth_secret')
|
|
136
|
+
self.auth_secret = attributes[:'auth_secret']
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
if attributes.has_key?(:'auth_username')
|
|
140
|
+
self.auth_username = attributes[:'auth_username']
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
if attributes.has_key?(:'extra_header_1')
|
|
144
|
+
self.extra_header_1 = attributes[:'extra_header_1']
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
if attributes.has_key?(:'extra_header_2')
|
|
148
|
+
self.extra_header_2 = attributes[:'extra_header_2']
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
if attributes.has_key?(:'extra_value_1')
|
|
152
|
+
self.extra_value_1 = attributes[:'extra_value_1']
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
if attributes.has_key?(:'extra_value_2')
|
|
156
|
+
self.extra_value_2 = attributes[:'extra_value_2']
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
if attributes.has_key?(:'is_active')
|
|
160
|
+
self.is_active = attributes[:'is_active']
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
if attributes.has_key?(:'mode')
|
|
164
|
+
self.mode = attributes[:'mode']
|
|
165
|
+
else
|
|
166
|
+
self.mode = 'Proxy Only'
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
if attributes.has_key?(:'name')
|
|
170
|
+
self.name = attributes[:'name']
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
if attributes.has_key?(:'priority')
|
|
174
|
+
self.priority = attributes[:'priority']
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
if attributes.has_key?(:'upstream_prefix')
|
|
178
|
+
self.upstream_prefix = attributes[:'upstream_prefix']
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
if attributes.has_key?(:'upstream_url')
|
|
182
|
+
self.upstream_url = attributes[:'upstream_url']
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
if attributes.has_key?(:'verify_ssl')
|
|
186
|
+
self.verify_ssl = attributes[:'verify_ssl']
|
|
187
|
+
end
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
191
|
+
# @return Array for valid properties with the reasons
|
|
192
|
+
def list_invalid_properties
|
|
193
|
+
invalid_properties = Array.new
|
|
194
|
+
invalid_properties
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# Check to see if the all the properties in the model are valid
|
|
198
|
+
# @return true if the model is valid
|
|
199
|
+
def valid?
|
|
200
|
+
auth_mode_validator = EnumAttributeValidator.new('String', ['None', 'Username and Password', 'Token'])
|
|
201
|
+
return false unless auth_mode_validator.valid?(@auth_mode)
|
|
202
|
+
mode_validator = EnumAttributeValidator.new('String', ['Proxy Only', 'Cache and Proxy'])
|
|
203
|
+
return false unless mode_validator.valid?(@mode)
|
|
204
|
+
true
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
208
|
+
# @param [Object] auth_mode Object to be assigned
|
|
209
|
+
def auth_mode=(auth_mode)
|
|
210
|
+
validator = EnumAttributeValidator.new('String', ['None', 'Username and Password', 'Token'])
|
|
211
|
+
unless validator.valid?(auth_mode)
|
|
212
|
+
fail ArgumentError, 'invalid value for "auth_mode", must be one of #{validator.allowable_values}.'
|
|
213
|
+
end
|
|
214
|
+
@auth_mode = auth_mode
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
218
|
+
# @param [Object] mode Object to be assigned
|
|
219
|
+
def mode=(mode)
|
|
220
|
+
validator = EnumAttributeValidator.new('String', ['Proxy Only', 'Cache and Proxy'])
|
|
221
|
+
unless validator.valid?(mode)
|
|
222
|
+
fail ArgumentError, 'invalid value for "mode", must be one of #{validator.allowable_values}.'
|
|
223
|
+
end
|
|
224
|
+
@mode = mode
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
# Checks equality by comparing each attribute.
|
|
228
|
+
# @param [Object] Object to be compared
|
|
229
|
+
def ==(o)
|
|
230
|
+
return true if self.equal?(o)
|
|
231
|
+
self.class == o.class &&
|
|
232
|
+
auth_mode == o.auth_mode &&
|
|
233
|
+
auth_secret == o.auth_secret &&
|
|
234
|
+
auth_username == o.auth_username &&
|
|
235
|
+
extra_header_1 == o.extra_header_1 &&
|
|
236
|
+
extra_header_2 == o.extra_header_2 &&
|
|
237
|
+
extra_value_1 == o.extra_value_1 &&
|
|
238
|
+
extra_value_2 == o.extra_value_2 &&
|
|
239
|
+
is_active == o.is_active &&
|
|
240
|
+
mode == o.mode &&
|
|
241
|
+
name == o.name &&
|
|
242
|
+
priority == o.priority &&
|
|
243
|
+
upstream_prefix == o.upstream_prefix &&
|
|
244
|
+
upstream_url == o.upstream_url &&
|
|
245
|
+
verify_ssl == o.verify_ssl
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
# @see the `==` method
|
|
249
|
+
# @param [Object] Object to be compared
|
|
250
|
+
def eql?(o)
|
|
251
|
+
self == o
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
# Calculates hash code according to all attributes.
|
|
255
|
+
# @return [Fixnum] Hash code
|
|
256
|
+
def hash
|
|
257
|
+
[auth_mode, auth_secret, auth_username, extra_header_1, extra_header_2, extra_value_1, extra_value_2, is_active, mode, name, priority, upstream_prefix, upstream_url, verify_ssl].hash
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
# Builds the object from hash
|
|
261
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
262
|
+
# @return [Object] Returns the model itself
|
|
263
|
+
def build_from_hash(attributes)
|
|
264
|
+
return nil unless attributes.is_a?(Hash)
|
|
265
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
266
|
+
if type =~ /\AArray<(.*)>/i
|
|
267
|
+
# check to ensure the input is an array given that the attribute
|
|
268
|
+
# is documented as an array but the input is not
|
|
269
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
270
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
271
|
+
end
|
|
272
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
273
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
274
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
self
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
# Deserializes the data based on type
|
|
281
|
+
# @param string type Data type
|
|
282
|
+
# @param string value Value to be deserialized
|
|
283
|
+
# @return [Object] Deserialized data
|
|
284
|
+
def _deserialize(type, value)
|
|
285
|
+
case type.to_sym
|
|
286
|
+
when :DateTime
|
|
287
|
+
DateTime.parse(value)
|
|
288
|
+
when :Date
|
|
289
|
+
Date.parse(value)
|
|
290
|
+
when :String
|
|
291
|
+
value.to_s
|
|
292
|
+
when :Integer
|
|
293
|
+
value.to_i
|
|
294
|
+
when :Float
|
|
295
|
+
value.to_f
|
|
296
|
+
when :BOOLEAN
|
|
297
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
298
|
+
true
|
|
299
|
+
else
|
|
300
|
+
false
|
|
301
|
+
end
|
|
302
|
+
when :Object
|
|
303
|
+
# generic object (usually a Hash), return directly
|
|
304
|
+
value
|
|
305
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
306
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
307
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
308
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
309
|
+
k_type = Regexp.last_match[:k_type]
|
|
310
|
+
v_type = Regexp.last_match[:v_type]
|
|
311
|
+
{}.tap do |hash|
|
|
312
|
+
value.each do |k, v|
|
|
313
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
314
|
+
end
|
|
315
|
+
end
|
|
316
|
+
else # model
|
|
317
|
+
temp_model = CloudsmithApi.const_get(type).new
|
|
318
|
+
temp_model.build_from_hash(value)
|
|
319
|
+
end
|
|
320
|
+
end
|
|
321
|
+
|
|
322
|
+
# Returns the string representation of the object
|
|
323
|
+
# @return [String] String presentation of the object
|
|
324
|
+
def to_s
|
|
325
|
+
to_hash.to_s
|
|
326
|
+
end
|
|
327
|
+
|
|
328
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
329
|
+
# @return [Hash] Returns the object in the form of hash
|
|
330
|
+
def to_body
|
|
331
|
+
to_hash
|
|
332
|
+
end
|
|
333
|
+
|
|
334
|
+
# Returns the object in the form of hash
|
|
335
|
+
# @return [Hash] Returns the object in the form of hash
|
|
336
|
+
def to_hash
|
|
337
|
+
hash = {}
|
|
338
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
339
|
+
value = self.send(attr)
|
|
340
|
+
next if value.nil?
|
|
341
|
+
hash[param] = _to_hash(value)
|
|
342
|
+
end
|
|
343
|
+
hash
|
|
344
|
+
end
|
|
345
|
+
|
|
346
|
+
# Outputs non-array value in the form of hash
|
|
347
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
348
|
+
# @param [Object] value Any valid value
|
|
349
|
+
# @return [Hash] Returns the value in the form of hash
|
|
350
|
+
def _to_hash(value)
|
|
351
|
+
if value.is_a?(Array)
|
|
352
|
+
value.compact.map { |v| _to_hash(v) }
|
|
353
|
+
elsif value.is_a?(Hash)
|
|
354
|
+
{}.tap do |hash|
|
|
355
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
356
|
+
end
|
|
357
|
+
elsif value.respond_to? :to_hash
|
|
358
|
+
value.to_hash
|
|
359
|
+
else
|
|
360
|
+
value
|
|
361
|
+
end
|
|
362
|
+
end
|
|
363
|
+
|
|
364
|
+
end
|
|
365
|
+
end
|
|
@@ -86,6 +86,9 @@ class MavenUpstream
|
|
|
86
86
|
|
|
87
87
|
attr_accessor :slug_perm
|
|
88
88
|
|
|
89
|
+
# Trust level allows for control of the visibility of upstream artifacts to native package managers. Where supported by formats, the default level (untrusted) is recommended for all upstreams, and helps to safeguard against common dependency confusion attack vectors.
|
|
90
|
+
attr_accessor :trust_level
|
|
91
|
+
|
|
89
92
|
attr_accessor :updated_at
|
|
90
93
|
|
|
91
94
|
# The URL for this upstream source. This must be a fully qualified URL including any path elements required to reach the root of the repository.
|
|
@@ -148,6 +151,7 @@ class MavenUpstream
|
|
|
148
151
|
:'pending_validation' => :'pending_validation',
|
|
149
152
|
:'priority' => :'priority',
|
|
150
153
|
:'slug_perm' => :'slug_perm',
|
|
154
|
+
:'trust_level' => :'trust_level',
|
|
151
155
|
:'updated_at' => :'updated_at',
|
|
152
156
|
:'upstream_url' => :'upstream_url',
|
|
153
157
|
:'verification_status' => :'verification_status',
|
|
@@ -184,6 +188,7 @@ class MavenUpstream
|
|
|
184
188
|
:'pending_validation' => :'BOOLEAN',
|
|
185
189
|
:'priority' => :'Integer',
|
|
186
190
|
:'slug_perm' => :'String',
|
|
191
|
+
:'trust_level' => :'String',
|
|
187
192
|
:'updated_at' => :'DateTime',
|
|
188
193
|
:'upstream_url' => :'String',
|
|
189
194
|
:'verification_status' => :'String',
|
|
@@ -311,6 +316,12 @@ class MavenUpstream
|
|
|
311
316
|
self.slug_perm = attributes[:'slug_perm']
|
|
312
317
|
end
|
|
313
318
|
|
|
319
|
+
if attributes.has_key?(:'trust_level')
|
|
320
|
+
self.trust_level = attributes[:'trust_level']
|
|
321
|
+
else
|
|
322
|
+
self.trust_level = 'Trusted'
|
|
323
|
+
end
|
|
324
|
+
|
|
314
325
|
if attributes.has_key?(:'updated_at')
|
|
315
326
|
self.updated_at = attributes[:'updated_at']
|
|
316
327
|
end
|
|
@@ -357,6 +368,8 @@ class MavenUpstream
|
|
|
357
368
|
mode_validator = EnumAttributeValidator.new('String', ['Proxy Only', 'Cache and Proxy', 'Cache Only'])
|
|
358
369
|
return false unless mode_validator.valid?(@mode)
|
|
359
370
|
return false if @name.nil?
|
|
371
|
+
trust_level_validator = EnumAttributeValidator.new('String', ['Trusted', 'Untrusted'])
|
|
372
|
+
return false unless trust_level_validator.valid?(@trust_level)
|
|
360
373
|
return false if @upstream_url.nil?
|
|
361
374
|
verification_status_validator = EnumAttributeValidator.new('String', ['Unknown', 'Invalid', 'Valid', 'Invalid (No Key)'])
|
|
362
375
|
return false unless verification_status_validator.valid?(@verification_status)
|
|
@@ -403,6 +416,16 @@ class MavenUpstream
|
|
|
403
416
|
@mode = mode
|
|
404
417
|
end
|
|
405
418
|
|
|
419
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
420
|
+
# @param [Object] trust_level Object to be assigned
|
|
421
|
+
def trust_level=(trust_level)
|
|
422
|
+
validator = EnumAttributeValidator.new('String', ['Trusted', 'Untrusted'])
|
|
423
|
+
unless validator.valid?(trust_level)
|
|
424
|
+
fail ArgumentError, 'invalid value for "trust_level", must be one of #{validator.allowable_values}.'
|
|
425
|
+
end
|
|
426
|
+
@trust_level = trust_level
|
|
427
|
+
end
|
|
428
|
+
|
|
406
429
|
# Custom attribute writer method checking allowed values (enum).
|
|
407
430
|
# @param [Object] verification_status Object to be assigned
|
|
408
431
|
def verification_status=(verification_status)
|
|
@@ -444,6 +467,7 @@ class MavenUpstream
|
|
|
444
467
|
pending_validation == o.pending_validation &&
|
|
445
468
|
priority == o.priority &&
|
|
446
469
|
slug_perm == o.slug_perm &&
|
|
470
|
+
trust_level == o.trust_level &&
|
|
447
471
|
updated_at == o.updated_at &&
|
|
448
472
|
upstream_url == o.upstream_url &&
|
|
449
473
|
verification_status == o.verification_status &&
|
|
@@ -459,7 +483,7 @@ class MavenUpstream
|
|
|
459
483
|
# Calculates hash code according to all attributes.
|
|
460
484
|
# @return [Fixnum] Hash code
|
|
461
485
|
def hash
|
|
462
|
-
[auth_mode, auth_secret, auth_username, available, can_reindex, created_at, disable_reason, disable_reason_text, extra_header_1, extra_header_2, extra_value_1, extra_value_2, gpg_key_fingerprint_short, gpg_key_inline, gpg_key_url, gpg_verification, has_failed_signature_verification, index_package_count, index_status, is_active, last_indexed, mode, name, pending_validation, priority, slug_perm, updated_at, upstream_url, verification_status, verify_ssl].hash
|
|
486
|
+
[auth_mode, auth_secret, auth_username, available, can_reindex, created_at, disable_reason, disable_reason_text, extra_header_1, extra_header_2, extra_value_1, extra_value_2, gpg_key_fingerprint_short, gpg_key_inline, gpg_key_url, gpg_verification, has_failed_signature_verification, index_package_count, index_status, is_active, last_indexed, mode, name, pending_validation, priority, slug_perm, trust_level, updated_at, upstream_url, verification_status, verify_ssl].hash
|
|
463
487
|
end
|
|
464
488
|
|
|
465
489
|
# Builds the object from hash
|
|
@@ -56,6 +56,9 @@ class MavenUpstreamRequest
|
|
|
56
56
|
# Upstream sources are selected for resolving requests by sequential order (1..n), followed by creation date.
|
|
57
57
|
attr_accessor :priority
|
|
58
58
|
|
|
59
|
+
# Trust level allows for control of the visibility of upstream artifacts to native package managers. Where supported by formats, the default level (untrusted) is recommended for all upstreams, and helps to safeguard against common dependency confusion attack vectors.
|
|
60
|
+
attr_accessor :trust_level
|
|
61
|
+
|
|
59
62
|
# The URL for this upstream source. This must be a fully qualified URL including any path elements required to reach the root of the repository.
|
|
60
63
|
attr_accessor :upstream_url
|
|
61
64
|
|
|
@@ -101,6 +104,7 @@ class MavenUpstreamRequest
|
|
|
101
104
|
:'mode' => :'mode',
|
|
102
105
|
:'name' => :'name',
|
|
103
106
|
:'priority' => :'priority',
|
|
107
|
+
:'trust_level' => :'trust_level',
|
|
104
108
|
:'upstream_url' => :'upstream_url',
|
|
105
109
|
:'verify_ssl' => :'verify_ssl'
|
|
106
110
|
}
|
|
@@ -123,6 +127,7 @@ class MavenUpstreamRequest
|
|
|
123
127
|
:'mode' => :'String',
|
|
124
128
|
:'name' => :'String',
|
|
125
129
|
:'priority' => :'Integer',
|
|
130
|
+
:'trust_level' => :'String',
|
|
126
131
|
:'upstream_url' => :'String',
|
|
127
132
|
:'verify_ssl' => :'BOOLEAN'
|
|
128
133
|
}
|
|
@@ -198,6 +203,12 @@ class MavenUpstreamRequest
|
|
|
198
203
|
self.priority = attributes[:'priority']
|
|
199
204
|
end
|
|
200
205
|
|
|
206
|
+
if attributes.has_key?(:'trust_level')
|
|
207
|
+
self.trust_level = attributes[:'trust_level']
|
|
208
|
+
else
|
|
209
|
+
self.trust_level = 'Trusted'
|
|
210
|
+
end
|
|
211
|
+
|
|
201
212
|
if attributes.has_key?(:'upstream_url')
|
|
202
213
|
self.upstream_url = attributes[:'upstream_url']
|
|
203
214
|
end
|
|
@@ -232,6 +243,8 @@ class MavenUpstreamRequest
|
|
|
232
243
|
mode_validator = EnumAttributeValidator.new('String', ['Proxy Only', 'Cache and Proxy', 'Cache Only'])
|
|
233
244
|
return false unless mode_validator.valid?(@mode)
|
|
234
245
|
return false if @name.nil?
|
|
246
|
+
trust_level_validator = EnumAttributeValidator.new('String', ['Trusted', 'Untrusted'])
|
|
247
|
+
return false unless trust_level_validator.valid?(@trust_level)
|
|
235
248
|
return false if @upstream_url.nil?
|
|
236
249
|
true
|
|
237
250
|
end
|
|
@@ -266,6 +279,16 @@ class MavenUpstreamRequest
|
|
|
266
279
|
@mode = mode
|
|
267
280
|
end
|
|
268
281
|
|
|
282
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
283
|
+
# @param [Object] trust_level Object to be assigned
|
|
284
|
+
def trust_level=(trust_level)
|
|
285
|
+
validator = EnumAttributeValidator.new('String', ['Trusted', 'Untrusted'])
|
|
286
|
+
unless validator.valid?(trust_level)
|
|
287
|
+
fail ArgumentError, 'invalid value for "trust_level", must be one of #{validator.allowable_values}.'
|
|
288
|
+
end
|
|
289
|
+
@trust_level = trust_level
|
|
290
|
+
end
|
|
291
|
+
|
|
269
292
|
# Checks equality by comparing each attribute.
|
|
270
293
|
# @param [Object] Object to be compared
|
|
271
294
|
def ==(o)
|
|
@@ -285,6 +308,7 @@ class MavenUpstreamRequest
|
|
|
285
308
|
mode == o.mode &&
|
|
286
309
|
name == o.name &&
|
|
287
310
|
priority == o.priority &&
|
|
311
|
+
trust_level == o.trust_level &&
|
|
288
312
|
upstream_url == o.upstream_url &&
|
|
289
313
|
verify_ssl == o.verify_ssl
|
|
290
314
|
end
|
|
@@ -298,7 +322,7 @@ class MavenUpstreamRequest
|
|
|
298
322
|
# Calculates hash code according to all attributes.
|
|
299
323
|
# @return [Fixnum] Hash code
|
|
300
324
|
def hash
|
|
301
|
-
[auth_mode, auth_secret, auth_username, extra_header_1, extra_header_2, extra_value_1, extra_value_2, gpg_key_inline, gpg_key_url, gpg_verification, is_active, mode, name, priority, upstream_url, verify_ssl].hash
|
|
325
|
+
[auth_mode, auth_secret, auth_username, extra_header_1, extra_header_2, extra_value_1, extra_value_2, gpg_key_inline, gpg_key_url, gpg_verification, is_active, mode, name, priority, trust_level, upstream_url, verify_ssl].hash
|
|
302
326
|
end
|
|
303
327
|
|
|
304
328
|
# Builds the object from hash
|
|
@@ -56,6 +56,9 @@ class MavenUpstreamRequestPatch
|
|
|
56
56
|
# Upstream sources are selected for resolving requests by sequential order (1..n), followed by creation date.
|
|
57
57
|
attr_accessor :priority
|
|
58
58
|
|
|
59
|
+
# Trust level allows for control of the visibility of upstream artifacts to native package managers. Where supported by formats, the default level (untrusted) is recommended for all upstreams, and helps to safeguard against common dependency confusion attack vectors.
|
|
60
|
+
attr_accessor :trust_level
|
|
61
|
+
|
|
59
62
|
# The URL for this upstream source. This must be a fully qualified URL including any path elements required to reach the root of the repository.
|
|
60
63
|
attr_accessor :upstream_url
|
|
61
64
|
|
|
@@ -101,6 +104,7 @@ class MavenUpstreamRequestPatch
|
|
|
101
104
|
:'mode' => :'mode',
|
|
102
105
|
:'name' => :'name',
|
|
103
106
|
:'priority' => :'priority',
|
|
107
|
+
:'trust_level' => :'trust_level',
|
|
104
108
|
:'upstream_url' => :'upstream_url',
|
|
105
109
|
:'verify_ssl' => :'verify_ssl'
|
|
106
110
|
}
|
|
@@ -123,6 +127,7 @@ class MavenUpstreamRequestPatch
|
|
|
123
127
|
:'mode' => :'String',
|
|
124
128
|
:'name' => :'String',
|
|
125
129
|
:'priority' => :'Integer',
|
|
130
|
+
:'trust_level' => :'String',
|
|
126
131
|
:'upstream_url' => :'String',
|
|
127
132
|
:'verify_ssl' => :'BOOLEAN'
|
|
128
133
|
}
|
|
@@ -198,6 +203,12 @@ class MavenUpstreamRequestPatch
|
|
|
198
203
|
self.priority = attributes[:'priority']
|
|
199
204
|
end
|
|
200
205
|
|
|
206
|
+
if attributes.has_key?(:'trust_level')
|
|
207
|
+
self.trust_level = attributes[:'trust_level']
|
|
208
|
+
else
|
|
209
|
+
self.trust_level = 'Trusted'
|
|
210
|
+
end
|
|
211
|
+
|
|
201
212
|
if attributes.has_key?(:'upstream_url')
|
|
202
213
|
self.upstream_url = attributes[:'upstream_url']
|
|
203
214
|
end
|
|
@@ -223,6 +234,8 @@ class MavenUpstreamRequestPatch
|
|
|
223
234
|
return false unless gpg_verification_validator.valid?(@gpg_verification)
|
|
224
235
|
mode_validator = EnumAttributeValidator.new('String', ['Proxy Only', 'Cache and Proxy', 'Cache Only'])
|
|
225
236
|
return false unless mode_validator.valid?(@mode)
|
|
237
|
+
trust_level_validator = EnumAttributeValidator.new('String', ['Trusted', 'Untrusted'])
|
|
238
|
+
return false unless trust_level_validator.valid?(@trust_level)
|
|
226
239
|
true
|
|
227
240
|
end
|
|
228
241
|
|
|
@@ -256,6 +269,16 @@ class MavenUpstreamRequestPatch
|
|
|
256
269
|
@mode = mode
|
|
257
270
|
end
|
|
258
271
|
|
|
272
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
273
|
+
# @param [Object] trust_level Object to be assigned
|
|
274
|
+
def trust_level=(trust_level)
|
|
275
|
+
validator = EnumAttributeValidator.new('String', ['Trusted', 'Untrusted'])
|
|
276
|
+
unless validator.valid?(trust_level)
|
|
277
|
+
fail ArgumentError, 'invalid value for "trust_level", must be one of #{validator.allowable_values}.'
|
|
278
|
+
end
|
|
279
|
+
@trust_level = trust_level
|
|
280
|
+
end
|
|
281
|
+
|
|
259
282
|
# Checks equality by comparing each attribute.
|
|
260
283
|
# @param [Object] Object to be compared
|
|
261
284
|
def ==(o)
|
|
@@ -275,6 +298,7 @@ class MavenUpstreamRequestPatch
|
|
|
275
298
|
mode == o.mode &&
|
|
276
299
|
name == o.name &&
|
|
277
300
|
priority == o.priority &&
|
|
301
|
+
trust_level == o.trust_level &&
|
|
278
302
|
upstream_url == o.upstream_url &&
|
|
279
303
|
verify_ssl == o.verify_ssl
|
|
280
304
|
end
|
|
@@ -288,7 +312,7 @@ class MavenUpstreamRequestPatch
|
|
|
288
312
|
# Calculates hash code according to all attributes.
|
|
289
313
|
# @return [Fixnum] Hash code
|
|
290
314
|
def hash
|
|
291
|
-
[auth_mode, auth_secret, auth_username, extra_header_1, extra_header_2, extra_value_1, extra_value_2, gpg_key_inline, gpg_key_url, gpg_verification, is_active, mode, name, priority, upstream_url, verify_ssl].hash
|
|
315
|
+
[auth_mode, auth_secret, auth_username, extra_header_1, extra_header_2, extra_value_1, extra_value_2, gpg_key_inline, gpg_key_url, gpg_verification, is_active, mode, name, priority, trust_level, upstream_url, verify_ssl].hash
|
|
292
316
|
end
|
|
293
317
|
|
|
294
318
|
# Builds the object from hash
|
|
@@ -49,6 +49,9 @@ class Package
|
|
|
49
49
|
|
|
50
50
|
attr_accessor :filename
|
|
51
51
|
|
|
52
|
+
# Full path to the file, including filename e.g. bin/utils/tool.tar.gz
|
|
53
|
+
attr_accessor :filepath
|
|
54
|
+
|
|
52
55
|
attr_accessor :files
|
|
53
56
|
|
|
54
57
|
attr_accessor :format
|
|
@@ -251,6 +254,7 @@ class Package
|
|
|
251
254
|
:'epoch' => :'epoch',
|
|
252
255
|
:'extension' => :'extension',
|
|
253
256
|
:'filename' => :'filename',
|
|
257
|
+
:'filepath' => :'filepath',
|
|
254
258
|
:'files' => :'files',
|
|
255
259
|
:'format' => :'format',
|
|
256
260
|
:'format_url' => :'format_url',
|
|
@@ -341,6 +345,7 @@ class Package
|
|
|
341
345
|
:'epoch' => :'Integer',
|
|
342
346
|
:'extension' => :'String',
|
|
343
347
|
:'filename' => :'String',
|
|
348
|
+
:'filepath' => :'String',
|
|
344
349
|
:'files' => :'Array<PackageFile>',
|
|
345
350
|
:'format' => :'String',
|
|
346
351
|
:'format_url' => :'String',
|
|
@@ -486,6 +491,10 @@ class Package
|
|
|
486
491
|
self.filename = attributes[:'filename']
|
|
487
492
|
end
|
|
488
493
|
|
|
494
|
+
if attributes.has_key?(:'filepath')
|
|
495
|
+
self.filepath = attributes[:'filepath']
|
|
496
|
+
end
|
|
497
|
+
|
|
489
498
|
if attributes.has_key?(:'files')
|
|
490
499
|
if (value = attributes[:'files']).is_a?(Array)
|
|
491
500
|
self.files = value
|
|
@@ -811,6 +820,7 @@ class Package
|
|
|
811
820
|
epoch == o.epoch &&
|
|
812
821
|
extension == o.extension &&
|
|
813
822
|
filename == o.filename &&
|
|
823
|
+
filepath == o.filepath &&
|
|
814
824
|
files == o.files &&
|
|
815
825
|
format == o.format &&
|
|
816
826
|
format_url == o.format_url &&
|
|
@@ -890,7 +900,7 @@ class Package
|
|
|
890
900
|
# Calculates hash code according to all attributes.
|
|
891
901
|
# @return [Fixnum] Hash code
|
|
892
902
|
def hash
|
|
893
|
-
[architectures, cdn_url, checksum_md5, checksum_sha1, checksum_sha256, checksum_sha512, dependencies_checksum_md5, dependencies_url, description, display_name, distro, distro_version, downloads, epoch, extension, filename, files, format, format_url, freeable_storage, fully_qualified_name, identifier_perm, identifiers, indexed, is_cancellable, is_copyable, is_deleteable, is_downloadable, is_moveable, is_quarantinable, is_quarantined, is_resyncable, is_security_scannable, is_sync_awaiting, is_sync_completed, is_sync_failed, is_sync_in_flight, is_sync_in_progress, license, name, namespace, namespace_url, num_files, origin_repository, origin_repository_url, package_type, policy_violated, raw_license, release, repository, repository_url, security_scan_completed_at, security_scan_started_at, security_scan_status, security_scan_status_updated_at, self_html_url, self_url, signature_url, size, slug, slug_perm, spdx_license, stage, stage_str, stage_updated_at, status, status_reason, status_str, status_updated_at, status_url, subtype, summary, sync_finished_at, sync_progress, tags, tags_automatic, tags_immutable, type_display, uploaded_at, uploader, uploader_url, version, version_orig, vulnerability_scan_results_url].hash
|
|
903
|
+
[architectures, cdn_url, checksum_md5, checksum_sha1, checksum_sha256, checksum_sha512, dependencies_checksum_md5, dependencies_url, description, display_name, distro, distro_version, downloads, epoch, extension, filename, filepath, files, format, format_url, freeable_storage, fully_qualified_name, identifier_perm, identifiers, indexed, is_cancellable, is_copyable, is_deleteable, is_downloadable, is_moveable, is_quarantinable, is_quarantined, is_resyncable, is_security_scannable, is_sync_awaiting, is_sync_completed, is_sync_failed, is_sync_in_flight, is_sync_in_progress, license, name, namespace, namespace_url, num_files, origin_repository, origin_repository_url, package_type, policy_violated, raw_license, release, repository, repository_url, security_scan_completed_at, security_scan_started_at, security_scan_status, security_scan_status_updated_at, self_html_url, self_url, signature_url, size, slug, slug_perm, spdx_license, stage, stage_str, stage_updated_at, status, status_reason, status_str, status_updated_at, status_url, subtype, summary, sync_finished_at, sync_progress, tags, tags_automatic, tags_immutable, type_display, uploaded_at, uploader, uploader_url, version, version_orig, vulnerability_scan_results_url].hash
|
|
894
904
|
end
|
|
895
905
|
|
|
896
906
|
# Builds the object from hash
|