akeyless 3.3.13 → 3.3.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -6
- data/docs/CreateAuthMethodOAuth2.md +0 -2
- data/docs/GatewayCreateAllowedAccess.md +32 -0
- data/docs/GatewayDeleteAllowedAccess.md +24 -0
- data/docs/GatewayGetAllowedAccess.md +24 -0
- data/docs/GatewayUpdateAllowedAccess.md +34 -0
- data/docs/GenerateCsr.md +56 -0
- data/docs/GenerateCsrOutput.md +18 -0
- data/docs/UpdateAuthMethodOAuth2.md +0 -2
- data/docs/V2Api.md +73 -10
- data/lib/akeyless/api/v2_api.rb +74 -10
- data/lib/akeyless/models/create_auth_method_o_auth2.rb +1 -11
- data/lib/akeyless/models/gateway_create_allowed_access.rb +305 -0
- data/lib/akeyless/models/gateway_delete_allowed_access.rb +258 -0
- data/lib/akeyless/models/gateway_get_allowed_access.rb +258 -0
- data/lib/akeyless/models/gateway_update_allowed_access.rb +315 -0
- data/lib/akeyless/models/generate_csr.rb +421 -0
- data/lib/akeyless/models/generate_csr_output.rb +219 -0
- data/lib/akeyless/models/oidc_client_info.rb +1 -1
- data/lib/akeyless/models/update_auth_method_o_auth2.rb +1 -11
- data/lib/akeyless/version.rb +1 -1
- data/lib/akeyless.rb +6 -3
- data/spec/models/gateway_create_allowed_access_spec.rb +76 -0
- data/spec/models/gateway_delete_allowed_access_spec.rb +52 -0
- data/spec/models/gateway_get_allowed_access_spec.rb +52 -0
- data/spec/models/gateway_update_allowed_access_spec.rb +82 -0
- data/spec/models/generate_csr_output_spec.rb +34 -0
- data/spec/models/generate_csr_spec.rb +148 -0
- metadata +26 -2
@@ -0,0 +1,421 @@
|
|
1
|
+
=begin
|
2
|
+
#Akeyless API
|
3
|
+
|
4
|
+
#The purpose of this application is to provide access to Akeyless API.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2.0
|
7
|
+
Contact: support@akeyless.io
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 7.0.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module Akeyless
|
17
|
+
class GenerateCsr
|
18
|
+
attr_accessor :alg
|
19
|
+
|
20
|
+
# The DNS Alternative Names to be included in the CSR certificate (in a comma-separated list)
|
21
|
+
attr_accessor :alt_names
|
22
|
+
|
23
|
+
# The certificateType to be included in the CSR certificate (ssl-client/ssl-server/certificate-signing)
|
24
|
+
attr_accessor :certificate_type
|
25
|
+
|
26
|
+
# The city to be included in the CSR certificate
|
27
|
+
attr_accessor :city
|
28
|
+
|
29
|
+
# The commonName to be included in the CSR certificate
|
30
|
+
attr_accessor :common_name
|
31
|
+
|
32
|
+
# The country to be included in the CSR certificate
|
33
|
+
attr_accessor :country
|
34
|
+
|
35
|
+
# Add critical to the key usage extension (will be false if not added)
|
36
|
+
attr_accessor :critical
|
37
|
+
|
38
|
+
# The department to be included in the CSR certificate
|
39
|
+
attr_accessor :dep
|
40
|
+
|
41
|
+
# Description of the object
|
42
|
+
attr_accessor :description
|
43
|
+
|
44
|
+
# The email addresses Alternative Names to be included in the CSR certificate (in a comma-separated list)
|
45
|
+
attr_accessor :email_addresses
|
46
|
+
|
47
|
+
# Generate a new csr key
|
48
|
+
attr_accessor :generate_key
|
49
|
+
|
50
|
+
# The ip addresses Alternative Names to be included in the CSR certificate (in a comma-separated list)
|
51
|
+
attr_accessor :ip_addresses
|
52
|
+
|
53
|
+
# Set output format to JSON
|
54
|
+
attr_accessor :json
|
55
|
+
|
56
|
+
# Deprecated - use description
|
57
|
+
attr_accessor :metadata
|
58
|
+
|
59
|
+
# Key name in akeyless
|
60
|
+
attr_accessor :name
|
61
|
+
|
62
|
+
# The organization to be included in the CSR certificate
|
63
|
+
attr_accessor :org
|
64
|
+
|
65
|
+
# The state to be included in the CSR certificate
|
66
|
+
attr_accessor :state
|
67
|
+
|
68
|
+
# Authentication token (see `/auth` and `/configure`)
|
69
|
+
attr_accessor :token
|
70
|
+
|
71
|
+
# The universal identity token, Required only for universal_identity authentication
|
72
|
+
attr_accessor :uid_token
|
73
|
+
|
74
|
+
# The URI Subject Alternative Names to be included in the CSR certificate (in a comma-separated list)
|
75
|
+
attr_accessor :uri_sans
|
76
|
+
|
77
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
78
|
+
def self.attribute_map
|
79
|
+
{
|
80
|
+
:'alg' => :'alg',
|
81
|
+
:'alt_names' => :'alt-names',
|
82
|
+
:'certificate_type' => :'certificate-type',
|
83
|
+
:'city' => :'city',
|
84
|
+
:'common_name' => :'common-name',
|
85
|
+
:'country' => :'country',
|
86
|
+
:'critical' => :'critical',
|
87
|
+
:'dep' => :'dep',
|
88
|
+
:'description' => :'description',
|
89
|
+
:'email_addresses' => :'email-addresses',
|
90
|
+
:'generate_key' => :'generate-key',
|
91
|
+
:'ip_addresses' => :'ip-addresses',
|
92
|
+
:'json' => :'json',
|
93
|
+
:'metadata' => :'metadata',
|
94
|
+
:'name' => :'name',
|
95
|
+
:'org' => :'org',
|
96
|
+
:'state' => :'state',
|
97
|
+
:'token' => :'token',
|
98
|
+
:'uid_token' => :'uid-token',
|
99
|
+
:'uri_sans' => :'uri-sans'
|
100
|
+
}
|
101
|
+
end
|
102
|
+
|
103
|
+
# Returns all the JSON keys this model knows about
|
104
|
+
def self.acceptable_attributes
|
105
|
+
attribute_map.values
|
106
|
+
end
|
107
|
+
|
108
|
+
# Attribute type mapping.
|
109
|
+
def self.openapi_types
|
110
|
+
{
|
111
|
+
:'alg' => :'String',
|
112
|
+
:'alt_names' => :'String',
|
113
|
+
:'certificate_type' => :'String',
|
114
|
+
:'city' => :'String',
|
115
|
+
:'common_name' => :'String',
|
116
|
+
:'country' => :'String',
|
117
|
+
:'critical' => :'Boolean',
|
118
|
+
:'dep' => :'String',
|
119
|
+
:'description' => :'String',
|
120
|
+
:'email_addresses' => :'String',
|
121
|
+
:'generate_key' => :'Boolean',
|
122
|
+
:'ip_addresses' => :'String',
|
123
|
+
:'json' => :'Boolean',
|
124
|
+
:'metadata' => :'String',
|
125
|
+
:'name' => :'String',
|
126
|
+
:'org' => :'String',
|
127
|
+
:'state' => :'String',
|
128
|
+
:'token' => :'String',
|
129
|
+
:'uid_token' => :'String',
|
130
|
+
:'uri_sans' => :'String'
|
131
|
+
}
|
132
|
+
end
|
133
|
+
|
134
|
+
# List of attributes with nullable: true
|
135
|
+
def self.openapi_nullable
|
136
|
+
Set.new([
|
137
|
+
])
|
138
|
+
end
|
139
|
+
|
140
|
+
# Initializes the object
|
141
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
142
|
+
def initialize(attributes = {})
|
143
|
+
if (!attributes.is_a?(Hash))
|
144
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::GenerateCsr` initialize method"
|
145
|
+
end
|
146
|
+
|
147
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
148
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
149
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
150
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::GenerateCsr`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
151
|
+
end
|
152
|
+
h[k.to_sym] = v
|
153
|
+
}
|
154
|
+
|
155
|
+
if attributes.key?(:'alg')
|
156
|
+
self.alg = attributes[:'alg']
|
157
|
+
end
|
158
|
+
|
159
|
+
if attributes.key?(:'alt_names')
|
160
|
+
self.alt_names = attributes[:'alt_names']
|
161
|
+
end
|
162
|
+
|
163
|
+
if attributes.key?(:'certificate_type')
|
164
|
+
self.certificate_type = attributes[:'certificate_type']
|
165
|
+
end
|
166
|
+
|
167
|
+
if attributes.key?(:'city')
|
168
|
+
self.city = attributes[:'city']
|
169
|
+
end
|
170
|
+
|
171
|
+
if attributes.key?(:'common_name')
|
172
|
+
self.common_name = attributes[:'common_name']
|
173
|
+
end
|
174
|
+
|
175
|
+
if attributes.key?(:'country')
|
176
|
+
self.country = attributes[:'country']
|
177
|
+
end
|
178
|
+
|
179
|
+
if attributes.key?(:'critical')
|
180
|
+
self.critical = attributes[:'critical']
|
181
|
+
end
|
182
|
+
|
183
|
+
if attributes.key?(:'dep')
|
184
|
+
self.dep = attributes[:'dep']
|
185
|
+
end
|
186
|
+
|
187
|
+
if attributes.key?(:'description')
|
188
|
+
self.description = attributes[:'description']
|
189
|
+
end
|
190
|
+
|
191
|
+
if attributes.key?(:'email_addresses')
|
192
|
+
self.email_addresses = attributes[:'email_addresses']
|
193
|
+
end
|
194
|
+
|
195
|
+
if attributes.key?(:'generate_key')
|
196
|
+
self.generate_key = attributes[:'generate_key']
|
197
|
+
end
|
198
|
+
|
199
|
+
if attributes.key?(:'ip_addresses')
|
200
|
+
self.ip_addresses = attributes[:'ip_addresses']
|
201
|
+
end
|
202
|
+
|
203
|
+
if attributes.key?(:'json')
|
204
|
+
self.json = attributes[:'json']
|
205
|
+
else
|
206
|
+
self.json = false
|
207
|
+
end
|
208
|
+
|
209
|
+
if attributes.key?(:'metadata')
|
210
|
+
self.metadata = attributes[:'metadata']
|
211
|
+
end
|
212
|
+
|
213
|
+
if attributes.key?(:'name')
|
214
|
+
self.name = attributes[:'name']
|
215
|
+
end
|
216
|
+
|
217
|
+
if attributes.key?(:'org')
|
218
|
+
self.org = attributes[:'org']
|
219
|
+
end
|
220
|
+
|
221
|
+
if attributes.key?(:'state')
|
222
|
+
self.state = attributes[:'state']
|
223
|
+
end
|
224
|
+
|
225
|
+
if attributes.key?(:'token')
|
226
|
+
self.token = attributes[:'token']
|
227
|
+
end
|
228
|
+
|
229
|
+
if attributes.key?(:'uid_token')
|
230
|
+
self.uid_token = attributes[:'uid_token']
|
231
|
+
end
|
232
|
+
|
233
|
+
if attributes.key?(:'uri_sans')
|
234
|
+
self.uri_sans = attributes[:'uri_sans']
|
235
|
+
end
|
236
|
+
end
|
237
|
+
|
238
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
239
|
+
# @return Array for valid properties with the reasons
|
240
|
+
def list_invalid_properties
|
241
|
+
invalid_properties = Array.new
|
242
|
+
if @common_name.nil?
|
243
|
+
invalid_properties.push('invalid value for "common_name", common_name cannot be nil.')
|
244
|
+
end
|
245
|
+
|
246
|
+
if @name.nil?
|
247
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
248
|
+
end
|
249
|
+
|
250
|
+
invalid_properties
|
251
|
+
end
|
252
|
+
|
253
|
+
# Check to see if the all the properties in the model are valid
|
254
|
+
# @return true if the model is valid
|
255
|
+
def valid?
|
256
|
+
return false if @common_name.nil?
|
257
|
+
return false if @name.nil?
|
258
|
+
true
|
259
|
+
end
|
260
|
+
|
261
|
+
# Checks equality by comparing each attribute.
|
262
|
+
# @param [Object] Object to be compared
|
263
|
+
def ==(o)
|
264
|
+
return true if self.equal?(o)
|
265
|
+
self.class == o.class &&
|
266
|
+
alg == o.alg &&
|
267
|
+
alt_names == o.alt_names &&
|
268
|
+
certificate_type == o.certificate_type &&
|
269
|
+
city == o.city &&
|
270
|
+
common_name == o.common_name &&
|
271
|
+
country == o.country &&
|
272
|
+
critical == o.critical &&
|
273
|
+
dep == o.dep &&
|
274
|
+
description == o.description &&
|
275
|
+
email_addresses == o.email_addresses &&
|
276
|
+
generate_key == o.generate_key &&
|
277
|
+
ip_addresses == o.ip_addresses &&
|
278
|
+
json == o.json &&
|
279
|
+
metadata == o.metadata &&
|
280
|
+
name == o.name &&
|
281
|
+
org == o.org &&
|
282
|
+
state == o.state &&
|
283
|
+
token == o.token &&
|
284
|
+
uid_token == o.uid_token &&
|
285
|
+
uri_sans == o.uri_sans
|
286
|
+
end
|
287
|
+
|
288
|
+
# @see the `==` method
|
289
|
+
# @param [Object] Object to be compared
|
290
|
+
def eql?(o)
|
291
|
+
self == o
|
292
|
+
end
|
293
|
+
|
294
|
+
# Calculates hash code according to all attributes.
|
295
|
+
# @return [Integer] Hash code
|
296
|
+
def hash
|
297
|
+
[alg, alt_names, certificate_type, city, common_name, country, critical, dep, description, email_addresses, generate_key, ip_addresses, json, metadata, name, org, state, token, uid_token, uri_sans].hash
|
298
|
+
end
|
299
|
+
|
300
|
+
# Builds the object from hash
|
301
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
302
|
+
# @return [Object] Returns the model itself
|
303
|
+
def self.build_from_hash(attributes)
|
304
|
+
new.build_from_hash(attributes)
|
305
|
+
end
|
306
|
+
|
307
|
+
# Builds the object from hash
|
308
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
309
|
+
# @return [Object] Returns the model itself
|
310
|
+
def build_from_hash(attributes)
|
311
|
+
return nil unless attributes.is_a?(Hash)
|
312
|
+
attributes = attributes.transform_keys(&:to_sym)
|
313
|
+
self.class.openapi_types.each_pair do |key, type|
|
314
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
315
|
+
self.send("#{key}=", nil)
|
316
|
+
elsif type =~ /\AArray<(.*)>/i
|
317
|
+
# check to ensure the input is an array given that the attribute
|
318
|
+
# is documented as an array but the input is not
|
319
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
320
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
321
|
+
end
|
322
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
323
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
324
|
+
end
|
325
|
+
end
|
326
|
+
|
327
|
+
self
|
328
|
+
end
|
329
|
+
|
330
|
+
# Deserializes the data based on type
|
331
|
+
# @param string type Data type
|
332
|
+
# @param string value Value to be deserialized
|
333
|
+
# @return [Object] Deserialized data
|
334
|
+
def _deserialize(type, value)
|
335
|
+
case type.to_sym
|
336
|
+
when :Time
|
337
|
+
Time.parse(value)
|
338
|
+
when :Date
|
339
|
+
Date.parse(value)
|
340
|
+
when :String
|
341
|
+
value.to_s
|
342
|
+
when :Integer
|
343
|
+
value.to_i
|
344
|
+
when :Float
|
345
|
+
value.to_f
|
346
|
+
when :Boolean
|
347
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
348
|
+
true
|
349
|
+
else
|
350
|
+
false
|
351
|
+
end
|
352
|
+
when :Object
|
353
|
+
# generic object (usually a Hash), return directly
|
354
|
+
value
|
355
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
356
|
+
inner_type = Regexp.last_match[:inner_type]
|
357
|
+
value.map { |v| _deserialize(inner_type, v) }
|
358
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
359
|
+
k_type = Regexp.last_match[:k_type]
|
360
|
+
v_type = Regexp.last_match[:v_type]
|
361
|
+
{}.tap do |hash|
|
362
|
+
value.each do |k, v|
|
363
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
364
|
+
end
|
365
|
+
end
|
366
|
+
else # model
|
367
|
+
# models (e.g. Pet) or oneOf
|
368
|
+
klass = Akeyless.const_get(type)
|
369
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
370
|
+
end
|
371
|
+
end
|
372
|
+
|
373
|
+
# Returns the string representation of the object
|
374
|
+
# @return [String] String presentation of the object
|
375
|
+
def to_s
|
376
|
+
to_hash.to_s
|
377
|
+
end
|
378
|
+
|
379
|
+
# to_body is an alias to to_hash (backward compatibility)
|
380
|
+
# @return [Hash] Returns the object in the form of hash
|
381
|
+
def to_body
|
382
|
+
to_hash
|
383
|
+
end
|
384
|
+
|
385
|
+
# Returns the object in the form of hash
|
386
|
+
# @return [Hash] Returns the object in the form of hash
|
387
|
+
def to_hash
|
388
|
+
hash = {}
|
389
|
+
self.class.attribute_map.each_pair do |attr, param|
|
390
|
+
value = self.send(attr)
|
391
|
+
if value.nil?
|
392
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
393
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
394
|
+
end
|
395
|
+
|
396
|
+
hash[param] = _to_hash(value)
|
397
|
+
end
|
398
|
+
hash
|
399
|
+
end
|
400
|
+
|
401
|
+
# Outputs non-array value in the form of hash
|
402
|
+
# For object, use to_hash. Otherwise, just return the value
|
403
|
+
# @param [Object] value Any valid value
|
404
|
+
# @return [Hash] Returns the value in the form of hash
|
405
|
+
def _to_hash(value)
|
406
|
+
if value.is_a?(Array)
|
407
|
+
value.compact.map { |v| _to_hash(v) }
|
408
|
+
elsif value.is_a?(Hash)
|
409
|
+
{}.tap do |hash|
|
410
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
411
|
+
end
|
412
|
+
elsif value.respond_to? :to_hash
|
413
|
+
value.to_hash
|
414
|
+
else
|
415
|
+
value
|
416
|
+
end
|
417
|
+
end
|
418
|
+
|
419
|
+
end
|
420
|
+
|
421
|
+
end
|
@@ -0,0 +1,219 @@
|
|
1
|
+
=begin
|
2
|
+
#Akeyless API
|
3
|
+
|
4
|
+
#The purpose of this application is to provide access to Akeyless API.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2.0
|
7
|
+
Contact: support@akeyless.io
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 7.0.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module Akeyless
|
17
|
+
class GenerateCsrOutput
|
18
|
+
attr_accessor :data
|
19
|
+
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
21
|
+
def self.attribute_map
|
22
|
+
{
|
23
|
+
:'data' => :'data'
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
# Returns all the JSON keys this model knows about
|
28
|
+
def self.acceptable_attributes
|
29
|
+
attribute_map.values
|
30
|
+
end
|
31
|
+
|
32
|
+
# Attribute type mapping.
|
33
|
+
def self.openapi_types
|
34
|
+
{
|
35
|
+
:'data' => :'String'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# List of attributes with nullable: true
|
40
|
+
def self.openapi_nullable
|
41
|
+
Set.new([
|
42
|
+
])
|
43
|
+
end
|
44
|
+
|
45
|
+
# Initializes the object
|
46
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
47
|
+
def initialize(attributes = {})
|
48
|
+
if (!attributes.is_a?(Hash))
|
49
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::GenerateCsrOutput` initialize method"
|
50
|
+
end
|
51
|
+
|
52
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
53
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
54
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
55
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::GenerateCsrOutput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
56
|
+
end
|
57
|
+
h[k.to_sym] = v
|
58
|
+
}
|
59
|
+
|
60
|
+
if attributes.key?(:'data')
|
61
|
+
self.data = attributes[:'data']
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
66
|
+
# @return Array for valid properties with the reasons
|
67
|
+
def list_invalid_properties
|
68
|
+
invalid_properties = Array.new
|
69
|
+
invalid_properties
|
70
|
+
end
|
71
|
+
|
72
|
+
# Check to see if the all the properties in the model are valid
|
73
|
+
# @return true if the model is valid
|
74
|
+
def valid?
|
75
|
+
true
|
76
|
+
end
|
77
|
+
|
78
|
+
# Checks equality by comparing each attribute.
|
79
|
+
# @param [Object] Object to be compared
|
80
|
+
def ==(o)
|
81
|
+
return true if self.equal?(o)
|
82
|
+
self.class == o.class &&
|
83
|
+
data == o.data
|
84
|
+
end
|
85
|
+
|
86
|
+
# @see the `==` method
|
87
|
+
# @param [Object] Object to be compared
|
88
|
+
def eql?(o)
|
89
|
+
self == o
|
90
|
+
end
|
91
|
+
|
92
|
+
# Calculates hash code according to all attributes.
|
93
|
+
# @return [Integer] Hash code
|
94
|
+
def hash
|
95
|
+
[data].hash
|
96
|
+
end
|
97
|
+
|
98
|
+
# Builds the object from hash
|
99
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
100
|
+
# @return [Object] Returns the model itself
|
101
|
+
def self.build_from_hash(attributes)
|
102
|
+
new.build_from_hash(attributes)
|
103
|
+
end
|
104
|
+
|
105
|
+
# Builds the object from hash
|
106
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
107
|
+
# @return [Object] Returns the model itself
|
108
|
+
def build_from_hash(attributes)
|
109
|
+
return nil unless attributes.is_a?(Hash)
|
110
|
+
attributes = attributes.transform_keys(&:to_sym)
|
111
|
+
self.class.openapi_types.each_pair do |key, type|
|
112
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
113
|
+
self.send("#{key}=", nil)
|
114
|
+
elsif type =~ /\AArray<(.*)>/i
|
115
|
+
# check to ensure the input is an array given that the attribute
|
116
|
+
# is documented as an array but the input is not
|
117
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
118
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
119
|
+
end
|
120
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
121
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
self
|
126
|
+
end
|
127
|
+
|
128
|
+
# Deserializes the data based on type
|
129
|
+
# @param string type Data type
|
130
|
+
# @param string value Value to be deserialized
|
131
|
+
# @return [Object] Deserialized data
|
132
|
+
def _deserialize(type, value)
|
133
|
+
case type.to_sym
|
134
|
+
when :Time
|
135
|
+
Time.parse(value)
|
136
|
+
when :Date
|
137
|
+
Date.parse(value)
|
138
|
+
when :String
|
139
|
+
value.to_s
|
140
|
+
when :Integer
|
141
|
+
value.to_i
|
142
|
+
when :Float
|
143
|
+
value.to_f
|
144
|
+
when :Boolean
|
145
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
146
|
+
true
|
147
|
+
else
|
148
|
+
false
|
149
|
+
end
|
150
|
+
when :Object
|
151
|
+
# generic object (usually a Hash), return directly
|
152
|
+
value
|
153
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
154
|
+
inner_type = Regexp.last_match[:inner_type]
|
155
|
+
value.map { |v| _deserialize(inner_type, v) }
|
156
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
157
|
+
k_type = Regexp.last_match[:k_type]
|
158
|
+
v_type = Regexp.last_match[:v_type]
|
159
|
+
{}.tap do |hash|
|
160
|
+
value.each do |k, v|
|
161
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
162
|
+
end
|
163
|
+
end
|
164
|
+
else # model
|
165
|
+
# models (e.g. Pet) or oneOf
|
166
|
+
klass = Akeyless.const_get(type)
|
167
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
# Returns the string representation of the object
|
172
|
+
# @return [String] String presentation of the object
|
173
|
+
def to_s
|
174
|
+
to_hash.to_s
|
175
|
+
end
|
176
|
+
|
177
|
+
# to_body is an alias to to_hash (backward compatibility)
|
178
|
+
# @return [Hash] Returns the object in the form of hash
|
179
|
+
def to_body
|
180
|
+
to_hash
|
181
|
+
end
|
182
|
+
|
183
|
+
# Returns the object in the form of hash
|
184
|
+
# @return [Hash] Returns the object in the form of hash
|
185
|
+
def to_hash
|
186
|
+
hash = {}
|
187
|
+
self.class.attribute_map.each_pair do |attr, param|
|
188
|
+
value = self.send(attr)
|
189
|
+
if value.nil?
|
190
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
191
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
192
|
+
end
|
193
|
+
|
194
|
+
hash[param] = _to_hash(value)
|
195
|
+
end
|
196
|
+
hash
|
197
|
+
end
|
198
|
+
|
199
|
+
# Outputs non-array value in the form of hash
|
200
|
+
# For object, use to_hash. Otherwise, just return the value
|
201
|
+
# @param [Object] value Any valid value
|
202
|
+
# @return [Hash] Returns the value in the form of hash
|
203
|
+
def _to_hash(value)
|
204
|
+
if value.is_a?(Array)
|
205
|
+
value.compact.map { |v| _to_hash(v) }
|
206
|
+
elsif value.is_a?(Hash)
|
207
|
+
{}.tap do |hash|
|
208
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
209
|
+
end
|
210
|
+
elsif value.respond_to? :to_hash
|
211
|
+
value.to_hash
|
212
|
+
else
|
213
|
+
value
|
214
|
+
end
|
215
|
+
end
|
216
|
+
|
217
|
+
end
|
218
|
+
|
219
|
+
end
|
@@ -38,7 +38,7 @@ module Akeyless
|
|
38
38
|
{
|
39
39
|
:'access_permission_assignment' => :'access_permission_assignment',
|
40
40
|
:'audience' => :'audience',
|
41
|
-
:'client_id' => :'
|
41
|
+
:'client_id' => :'client_id',
|
42
42
|
:'grant_types' => :'grant_types',
|
43
43
|
:'logout_uris' => :'logout_uris',
|
44
44
|
:'public' => :'public',
|
@@ -43,9 +43,6 @@ module Akeyless
|
|
43
43
|
# The JSON Web Key Set (JWKS) that containing the public keys that should be used to verify any JSON Web Token (JWT) issued by the authorization server. base64 encoded string
|
44
44
|
attr_accessor :jwks_json_data
|
45
45
|
|
46
|
-
# JSON Web Key Set (JWKS) JSON file path that will be used to verify any JSON Web Token (JWT) issued by the authorization server.
|
47
|
-
attr_accessor :jwks_json_file
|
48
|
-
|
49
46
|
# The URL to the JSON Web Key Set (JWKS) that containing the public keys that should be used to verify any JSON Web Token (JWT) issued by the authorization server.
|
50
47
|
attr_accessor :jwks_uri
|
51
48
|
|
@@ -79,7 +76,6 @@ module Akeyless
|
|
79
76
|
:'issuer' => :'issuer',
|
80
77
|
:'json' => :'json',
|
81
78
|
:'jwks_json_data' => :'jwks-json-data',
|
82
|
-
:'jwks_json_file' => :'jwks-json-file',
|
83
79
|
:'jwks_uri' => :'jwks-uri',
|
84
80
|
:'jwt_ttl' => :'jwt-ttl',
|
85
81
|
:'name' => :'name',
|
@@ -107,7 +103,6 @@ module Akeyless
|
|
107
103
|
:'issuer' => :'String',
|
108
104
|
:'json' => :'Boolean',
|
109
105
|
:'jwks_json_data' => :'String',
|
110
|
-
:'jwks_json_file' => :'String',
|
111
106
|
:'jwks_uri' => :'String',
|
112
107
|
:'jwt_ttl' => :'Integer',
|
113
108
|
:'name' => :'String',
|
@@ -185,10 +180,6 @@ module Akeyless
|
|
185
180
|
self.jwks_json_data = attributes[:'jwks_json_data']
|
186
181
|
end
|
187
182
|
|
188
|
-
if attributes.key?(:'jwks_json_file')
|
189
|
-
self.jwks_json_file = attributes[:'jwks_json_file']
|
190
|
-
end
|
191
|
-
|
192
183
|
if attributes.key?(:'jwks_uri')
|
193
184
|
self.jwks_uri = attributes[:'jwks_uri']
|
194
185
|
else
|
@@ -264,7 +255,6 @@ module Akeyless
|
|
264
255
|
issuer == o.issuer &&
|
265
256
|
json == o.json &&
|
266
257
|
jwks_json_data == o.jwks_json_data &&
|
267
|
-
jwks_json_file == o.jwks_json_file &&
|
268
258
|
jwks_uri == o.jwks_uri &&
|
269
259
|
jwt_ttl == o.jwt_ttl &&
|
270
260
|
name == o.name &&
|
@@ -283,7 +273,7 @@ module Akeyless
|
|
283
273
|
# Calculates hash code according to all attributes.
|
284
274
|
# @return [Integer] Hash code
|
285
275
|
def hash
|
286
|
-
[access_expires, audience, bound_client_ids, bound_ips, force_sub_claims, gw_bound_ips, issuer, json, jwks_json_data,
|
276
|
+
[access_expires, audience, bound_client_ids, bound_ips, force_sub_claims, gw_bound_ips, issuer, json, jwks_json_data, jwks_uri, jwt_ttl, name, new_name, token, uid_token, unique_identifier].hash
|
287
277
|
end
|
288
278
|
|
289
279
|
# Builds the object from hash
|
data/lib/akeyless/version.rb
CHANGED