akeyless 5.0.17 → 5.0.19

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.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +13 -1
  3. data/docs/AccountGeneralSettings.md +2 -0
  4. data/docs/CertificateDiscovery.md +34 -0
  5. data/docs/CertificateDiscoveryOutput.md +18 -0
  6. data/docs/CertificateMigration.md +20 -0
  7. data/docs/CertificatePayload.md +30 -0
  8. data/docs/CertificateScanTarget.md +20 -0
  9. data/docs/CreateRole.md +5 -5
  10. data/docs/GatewayCreateMigration.md +7 -1
  11. data/docs/GatewayUpdateMigration.md +6 -0
  12. data/docs/ItemUSCSyncAssociation.md +2 -0
  13. data/docs/ListItems.md +2 -0
  14. data/docs/MigrationsConfigPart.md +2 -0
  15. data/docs/RotatedSecretCreateOpenAI.md +56 -0
  16. data/docs/RotatedSecretCreateSsh.md +1 -1
  17. data/docs/RotatedSecretDeleteSync.md +2 -0
  18. data/docs/RotatedSecretSync.md +2 -0
  19. data/docs/RotatedSecretUpdateOpenAI.md +58 -0
  20. data/docs/RotatedSecretUpdateSsh.md +1 -1
  21. data/docs/ScanResults.md +32 -0
  22. data/docs/StaticSecretDeleteSync.md +2 -0
  23. data/docs/StaticSecretSync.md +2 -0
  24. data/docs/TargetError.md +22 -0
  25. data/docs/UpdateRole.md +5 -5
  26. data/docs/UscDelete.md +2 -0
  27. data/docs/UscSyncInfo.md +2 -0
  28. data/docs/V2Api.md +191 -2
  29. data/lib/akeyless/api/v2_api.rb +192 -0
  30. data/lib/akeyless/models/account_general_settings.rb +10 -1
  31. data/lib/akeyless/models/certificate_discovery.rb +318 -0
  32. data/lib/akeyless/models/certificate_discovery_output.rb +214 -0
  33. data/lib/akeyless/models/certificate_migration.rb +223 -0
  34. data/lib/akeyless/models/certificate_payload.rb +272 -0
  35. data/lib/akeyless/models/certificate_scan_target.rb +223 -0
  36. data/lib/akeyless/models/create_role.rb +5 -5
  37. data/lib/akeyless/models/gateway_create_migration.rb +43 -2
  38. data/lib/akeyless/models/gateway_update_migration.rb +42 -1
  39. data/lib/akeyless/models/item_usc_sync_association.rb +10 -1
  40. data/lib/akeyless/models/list_items.rb +13 -1
  41. data/lib/akeyless/models/migrations_config_part.rb +12 -1
  42. data/lib/akeyless/models/rotated_secret_create_open_ai.rb +437 -0
  43. data/lib/akeyless/models/rotated_secret_create_ssh.rb +1 -1
  44. data/lib/akeyless/models/rotated_secret_delete_sync.rb +13 -1
  45. data/lib/akeyless/models/rotated_secret_sync.rb +11 -1
  46. data/lib/akeyless/models/rotated_secret_update_open_ai.rb +437 -0
  47. data/lib/akeyless/models/rotated_secret_update_ssh.rb +1 -1
  48. data/lib/akeyless/models/scan_results.rb +282 -0
  49. data/lib/akeyless/models/static_secret_delete_sync.rb +13 -1
  50. data/lib/akeyless/models/static_secret_sync.rb +11 -1
  51. data/lib/akeyless/models/target_error.rb +233 -0
  52. data/lib/akeyless/models/update_role.rb +5 -5
  53. data/lib/akeyless/models/usc_delete.rb +11 -1
  54. data/lib/akeyless/models/usc_sync_info.rb +10 -1
  55. data/lib/akeyless/version.rb +1 -1
  56. data/lib/akeyless.rb +9 -0
  57. data/spec/models/certificate_discovery_output_spec.rb +36 -0
  58. data/spec/models/certificate_discovery_spec.rb +84 -0
  59. data/spec/models/certificate_migration_spec.rb +42 -0
  60. data/spec/models/certificate_payload_spec.rb +72 -0
  61. data/spec/models/certificate_scan_target_spec.rb +42 -0
  62. data/spec/models/rotated_secret_create_open_ai_spec.rb +150 -0
  63. data/spec/models/rotated_secret_update_open_ai_spec.rb +156 -0
  64. data/spec/models/scan_results_spec.rb +78 -0
  65. data/spec/models/target_error_spec.rb +48 -0
  66. metadata +38 -2
@@ -0,0 +1,437 @@
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: 3.0
7
+ Contact: support@akeyless.io
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.10.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Akeyless
17
+ # rotatedSecretUpdateOpenAI is a command that updates an OpenAI rotated secret.
18
+ class RotatedSecretUpdateOpenAI
19
+ # List of the new tags that will be attached to this item
20
+ attr_accessor :add_tag
21
+
22
+ # Admin API key value to update (relevant only for rotator-type=api-key)
23
+ attr_accessor :api_key
24
+
25
+ # Admin API key ID to update (relevant only for rotator-type=api-key)
26
+ attr_accessor :api_key_id
27
+
28
+ # The credentials to connect with use-user-creds/use-target-creds
29
+ attr_accessor :authentication_credentials
30
+
31
+ # Whether to automatically rotate every --rotation-interval days, or disable existing automatic rotation [true/false]
32
+ attr_accessor :auto_rotate
33
+
34
+ # Protection from accidental deletion of this object [true/false]
35
+ attr_accessor :delete_protection
36
+
37
+ # Description of the object
38
+ attr_accessor :description
39
+
40
+ # Additional custom fields to associate with the item
41
+ attr_accessor :item_custom_fields
42
+
43
+ # Set output format to JSON
44
+ attr_accessor :json
45
+
46
+ # Whether to keep previous version [true/false]. If not set, use default according to account settings
47
+ attr_accessor :keep_prev_version
48
+
49
+ # The name of a key that used to encrypt the secret value (if empty, the account default protectionKey key will be used)
50
+ attr_accessor :key
51
+
52
+ # Set the maximum number of versions, limited by the account settings defaults.
53
+ attr_accessor :max_versions
54
+
55
+ # Rotated secret name
56
+ attr_accessor :name
57
+
58
+ # New item name
59
+ attr_accessor :new_name
60
+
61
+ # The length of the password to be generated
62
+ attr_accessor :password_length
63
+
64
+ # List of the existent tags that will be removed from this item
65
+ attr_accessor :rm_tag
66
+
67
+ # How many days before the rotation of the item would you like to be notified
68
+ attr_accessor :rotation_event_in
69
+
70
+ # The Hour of the rotation in UTC
71
+ attr_accessor :rotation_hour
72
+
73
+ # The number of days to wait between every automatic key rotation (1-365)
74
+ attr_accessor :rotation_interval
75
+
76
+ # Authentication token (see `/auth` and `/configure`)
77
+ attr_accessor :token
78
+
79
+ # The universal identity token, Required only for universal_identity authentication
80
+ attr_accessor :uid_token
81
+
82
+ # Attribute mapping from ruby-style variable name to JSON key.
83
+ def self.attribute_map
84
+ {
85
+ :'add_tag' => :'add-tag',
86
+ :'api_key' => :'api-key',
87
+ :'api_key_id' => :'api-key-id',
88
+ :'authentication_credentials' => :'authentication-credentials',
89
+ :'auto_rotate' => :'auto-rotate',
90
+ :'delete_protection' => :'delete_protection',
91
+ :'description' => :'description',
92
+ :'item_custom_fields' => :'item-custom-fields',
93
+ :'json' => :'json',
94
+ :'keep_prev_version' => :'keep-prev-version',
95
+ :'key' => :'key',
96
+ :'max_versions' => :'max-versions',
97
+ :'name' => :'name',
98
+ :'new_name' => :'new-name',
99
+ :'password_length' => :'password-length',
100
+ :'rm_tag' => :'rm-tag',
101
+ :'rotation_event_in' => :'rotation-event-in',
102
+ :'rotation_hour' => :'rotation-hour',
103
+ :'rotation_interval' => :'rotation-interval',
104
+ :'token' => :'token',
105
+ :'uid_token' => :'uid-token'
106
+ }
107
+ end
108
+
109
+ # Returns all the JSON keys this model knows about
110
+ def self.acceptable_attributes
111
+ attribute_map.values
112
+ end
113
+
114
+ # Attribute type mapping.
115
+ def self.openapi_types
116
+ {
117
+ :'add_tag' => :'Array<String>',
118
+ :'api_key' => :'String',
119
+ :'api_key_id' => :'String',
120
+ :'authentication_credentials' => :'String',
121
+ :'auto_rotate' => :'String',
122
+ :'delete_protection' => :'String',
123
+ :'description' => :'String',
124
+ :'item_custom_fields' => :'Hash<String, String>',
125
+ :'json' => :'Boolean',
126
+ :'keep_prev_version' => :'String',
127
+ :'key' => :'String',
128
+ :'max_versions' => :'String',
129
+ :'name' => :'String',
130
+ :'new_name' => :'String',
131
+ :'password_length' => :'String',
132
+ :'rm_tag' => :'Array<String>',
133
+ :'rotation_event_in' => :'Array<String>',
134
+ :'rotation_hour' => :'Integer',
135
+ :'rotation_interval' => :'String',
136
+ :'token' => :'String',
137
+ :'uid_token' => :'String'
138
+ }
139
+ end
140
+
141
+ # List of attributes with nullable: true
142
+ def self.openapi_nullable
143
+ Set.new([
144
+ ])
145
+ end
146
+
147
+ # Initializes the object
148
+ # @param [Hash] attributes Model attributes in the form of hash
149
+ def initialize(attributes = {})
150
+ if (!attributes.is_a?(Hash))
151
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::RotatedSecretUpdateOpenAI` initialize method"
152
+ end
153
+
154
+ # check to see if the attribute exists and convert string to symbol for hash key
155
+ attributes = attributes.each_with_object({}) { |(k, v), h|
156
+ if (!self.class.attribute_map.key?(k.to_sym))
157
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::RotatedSecretUpdateOpenAI`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
158
+ end
159
+ h[k.to_sym] = v
160
+ }
161
+
162
+ if attributes.key?(:'add_tag')
163
+ if (value = attributes[:'add_tag']).is_a?(Array)
164
+ self.add_tag = value
165
+ end
166
+ end
167
+
168
+ if attributes.key?(:'api_key')
169
+ self.api_key = attributes[:'api_key']
170
+ end
171
+
172
+ if attributes.key?(:'api_key_id')
173
+ self.api_key_id = attributes[:'api_key_id']
174
+ end
175
+
176
+ if attributes.key?(:'authentication_credentials')
177
+ self.authentication_credentials = attributes[:'authentication_credentials']
178
+ else
179
+ self.authentication_credentials = 'use-user-creds'
180
+ end
181
+
182
+ if attributes.key?(:'auto_rotate')
183
+ self.auto_rotate = attributes[:'auto_rotate']
184
+ end
185
+
186
+ if attributes.key?(:'delete_protection')
187
+ self.delete_protection = attributes[:'delete_protection']
188
+ end
189
+
190
+ if attributes.key?(:'description')
191
+ self.description = attributes[:'description']
192
+ else
193
+ self.description = 'default_metadata'
194
+ end
195
+
196
+ if attributes.key?(:'item_custom_fields')
197
+ if (value = attributes[:'item_custom_fields']).is_a?(Hash)
198
+ self.item_custom_fields = value
199
+ end
200
+ end
201
+
202
+ if attributes.key?(:'json')
203
+ self.json = attributes[:'json']
204
+ else
205
+ self.json = false
206
+ end
207
+
208
+ if attributes.key?(:'keep_prev_version')
209
+ self.keep_prev_version = attributes[:'keep_prev_version']
210
+ end
211
+
212
+ if attributes.key?(:'key')
213
+ self.key = attributes[:'key']
214
+ end
215
+
216
+ if attributes.key?(:'max_versions')
217
+ self.max_versions = attributes[:'max_versions']
218
+ end
219
+
220
+ if attributes.key?(:'name')
221
+ self.name = attributes[:'name']
222
+ else
223
+ self.name = nil
224
+ end
225
+
226
+ if attributes.key?(:'new_name')
227
+ self.new_name = attributes[:'new_name']
228
+ end
229
+
230
+ if attributes.key?(:'password_length')
231
+ self.password_length = attributes[:'password_length']
232
+ end
233
+
234
+ if attributes.key?(:'rm_tag')
235
+ if (value = attributes[:'rm_tag']).is_a?(Array)
236
+ self.rm_tag = value
237
+ end
238
+ end
239
+
240
+ if attributes.key?(:'rotation_event_in')
241
+ if (value = attributes[:'rotation_event_in']).is_a?(Array)
242
+ self.rotation_event_in = value
243
+ end
244
+ end
245
+
246
+ if attributes.key?(:'rotation_hour')
247
+ self.rotation_hour = attributes[:'rotation_hour']
248
+ end
249
+
250
+ if attributes.key?(:'rotation_interval')
251
+ self.rotation_interval = attributes[:'rotation_interval']
252
+ end
253
+
254
+ if attributes.key?(:'token')
255
+ self.token = attributes[:'token']
256
+ end
257
+
258
+ if attributes.key?(:'uid_token')
259
+ self.uid_token = attributes[:'uid_token']
260
+ end
261
+ end
262
+
263
+ # Show invalid properties with the reasons. Usually used together with valid?
264
+ # @return Array for valid properties with the reasons
265
+ def list_invalid_properties
266
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
267
+ invalid_properties = Array.new
268
+ if @name.nil?
269
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
270
+ end
271
+
272
+ invalid_properties
273
+ end
274
+
275
+ # Check to see if the all the properties in the model are valid
276
+ # @return true if the model is valid
277
+ def valid?
278
+ warn '[DEPRECATED] the `valid?` method is obsolete'
279
+ return false if @name.nil?
280
+ true
281
+ end
282
+
283
+ # Checks equality by comparing each attribute.
284
+ # @param [Object] Object to be compared
285
+ def ==(o)
286
+ return true if self.equal?(o)
287
+ self.class == o.class &&
288
+ add_tag == o.add_tag &&
289
+ api_key == o.api_key &&
290
+ api_key_id == o.api_key_id &&
291
+ authentication_credentials == o.authentication_credentials &&
292
+ auto_rotate == o.auto_rotate &&
293
+ delete_protection == o.delete_protection &&
294
+ description == o.description &&
295
+ item_custom_fields == o.item_custom_fields &&
296
+ json == o.json &&
297
+ keep_prev_version == o.keep_prev_version &&
298
+ key == o.key &&
299
+ max_versions == o.max_versions &&
300
+ name == o.name &&
301
+ new_name == o.new_name &&
302
+ password_length == o.password_length &&
303
+ rm_tag == o.rm_tag &&
304
+ rotation_event_in == o.rotation_event_in &&
305
+ rotation_hour == o.rotation_hour &&
306
+ rotation_interval == o.rotation_interval &&
307
+ token == o.token &&
308
+ uid_token == o.uid_token
309
+ end
310
+
311
+ # @see the `==` method
312
+ # @param [Object] Object to be compared
313
+ def eql?(o)
314
+ self == o
315
+ end
316
+
317
+ # Calculates hash code according to all attributes.
318
+ # @return [Integer] Hash code
319
+ def hash
320
+ [add_tag, api_key, api_key_id, authentication_credentials, auto_rotate, delete_protection, description, item_custom_fields, json, keep_prev_version, key, max_versions, name, new_name, password_length, rm_tag, rotation_event_in, rotation_hour, rotation_interval, token, uid_token].hash
321
+ end
322
+
323
+ # Builds the object from hash
324
+ # @param [Hash] attributes Model attributes in the form of hash
325
+ # @return [Object] Returns the model itself
326
+ def self.build_from_hash(attributes)
327
+ return nil unless attributes.is_a?(Hash)
328
+ attributes = attributes.transform_keys(&:to_sym)
329
+ transformed_hash = {}
330
+ openapi_types.each_pair do |key, type|
331
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
332
+ transformed_hash["#{key}"] = nil
333
+ elsif type =~ /\AArray<(.*)>/i
334
+ # check to ensure the input is an array given that the attribute
335
+ # is documented as an array but the input is not
336
+ if attributes[attribute_map[key]].is_a?(Array)
337
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
338
+ end
339
+ elsif !attributes[attribute_map[key]].nil?
340
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
341
+ end
342
+ end
343
+ new(transformed_hash)
344
+ end
345
+
346
+ # Deserializes the data based on type
347
+ # @param string type Data type
348
+ # @param string value Value to be deserialized
349
+ # @return [Object] Deserialized data
350
+ def self._deserialize(type, value)
351
+ case type.to_sym
352
+ when :Time
353
+ Time.parse(value)
354
+ when :Date
355
+ Date.parse(value)
356
+ when :String
357
+ value.to_s
358
+ when :Integer
359
+ value.to_i
360
+ when :Float
361
+ value.to_f
362
+ when :Boolean
363
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
364
+ true
365
+ else
366
+ false
367
+ end
368
+ when :Object
369
+ # generic object (usually a Hash), return directly
370
+ value
371
+ when /\AArray<(?<inner_type>.+)>\z/
372
+ inner_type = Regexp.last_match[:inner_type]
373
+ value.map { |v| _deserialize(inner_type, v) }
374
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
375
+ k_type = Regexp.last_match[:k_type]
376
+ v_type = Regexp.last_match[:v_type]
377
+ {}.tap do |hash|
378
+ value.each do |k, v|
379
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
380
+ end
381
+ end
382
+ else # model
383
+ # models (e.g. Pet) or oneOf
384
+ klass = Akeyless.const_get(type)
385
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
386
+ end
387
+ end
388
+
389
+ # Returns the string representation of the object
390
+ # @return [String] String presentation of the object
391
+ def to_s
392
+ to_hash.to_s
393
+ end
394
+
395
+ # to_body is an alias to to_hash (backward compatibility)
396
+ # @return [Hash] Returns the object in the form of hash
397
+ def to_body
398
+ to_hash
399
+ end
400
+
401
+ # Returns the object in the form of hash
402
+ # @return [Hash] Returns the object in the form of hash
403
+ def to_hash
404
+ hash = {}
405
+ self.class.attribute_map.each_pair do |attr, param|
406
+ value = self.send(attr)
407
+ if value.nil?
408
+ is_nullable = self.class.openapi_nullable.include?(attr)
409
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
410
+ end
411
+
412
+ hash[param] = _to_hash(value)
413
+ end
414
+ hash
415
+ end
416
+
417
+ # Outputs non-array value in the form of hash
418
+ # For object, use to_hash. Otherwise, just return the value
419
+ # @param [Object] value Any valid value
420
+ # @return [Hash] Returns the value in the form of hash
421
+ def _to_hash(value)
422
+ if value.is_a?(Array)
423
+ value.compact.map { |v| _to_hash(v) }
424
+ elsif value.is_a?(Hash)
425
+ {}.tap do |hash|
426
+ value.each { |k, v| hash[k] = _to_hash(v) }
427
+ end
428
+ elsif value.respond_to? :to_hash
429
+ value.to_hash
430
+ else
431
+ value
432
+ end
433
+ end
434
+
435
+ end
436
+
437
+ end
@@ -84,7 +84,7 @@ module Akeyless
84
84
  # Custom rotation command
85
85
  attr_accessor :rotator_custom_cmd
86
86
 
87
- # The rotator type. options: [target/password]
87
+ # The rotator type. options: [target/password/key]
88
88
  attr_accessor :rotator_type
89
89
 
90
90
  # Rotate same password for each host from the Linked Target (relevant only for Linked Target)