akeyless 3.1.0 → 3.1.1

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 (35) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +13 -1
  3. data/docs/CreateCertificate.md +38 -0
  4. data/docs/CreateCertificateOutput.md +18 -0
  5. data/docs/GatewayUpdateTlsCert.md +26 -0
  6. data/docs/GatewayUpdateTlsCertOutput.md +18 -0
  7. data/docs/GetCertificateValue.md +26 -0
  8. data/docs/GetCertificateValueOutput.md +20 -0
  9. data/docs/ListSRABastions.md +2 -0
  10. data/docs/RotateKey.md +2 -0
  11. data/docs/UpdateCertificateOutput.md +18 -0
  12. data/docs/UpdateCertificateValue.md +32 -0
  13. data/docs/V2Api.md +252 -0
  14. data/lib/akeyless/api/v2_api.rb +256 -0
  15. data/lib/akeyless/models/create_certificate.rb +329 -0
  16. data/lib/akeyless/models/create_certificate_output.rb +219 -0
  17. data/lib/akeyless/models/gateway_update_tls_cert.rb +261 -0
  18. data/lib/akeyless/models/gateway_update_tls_cert_output.rb +219 -0
  19. data/lib/akeyless/models/get_certificate_value.rb +265 -0
  20. data/lib/akeyless/models/get_certificate_value_output.rb +228 -0
  21. data/lib/akeyless/models/list_sra_bastions.rb +10 -1
  22. data/lib/akeyless/models/rotate_key.rb +11 -1
  23. data/lib/akeyless/models/update_certificate_output.rb +219 -0
  24. data/lib/akeyless/models/update_certificate_value.rb +297 -0
  25. data/lib/akeyless/version.rb +1 -1
  26. data/lib/akeyless.rb +8 -0
  27. data/spec/models/create_certificate_output_spec.rb +34 -0
  28. data/spec/models/create_certificate_spec.rb +94 -0
  29. data/spec/models/gateway_update_tls_cert_output_spec.rb +34 -0
  30. data/spec/models/gateway_update_tls_cert_spec.rb +58 -0
  31. data/spec/models/get_certificate_value_output_spec.rb +40 -0
  32. data/spec/models/get_certificate_value_spec.rb +58 -0
  33. data/spec/models/update_certificate_output_spec.rb +34 -0
  34. data/spec/models/update_certificate_value_spec.rb +76 -0
  35. metadata +572 -540
@@ -0,0 +1,265 @@
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: 6.3.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Akeyless
17
+ class GetCertificateValue
18
+ # Set output format to JSON
19
+ attr_accessor :json
20
+
21
+ # Certificate name
22
+ attr_accessor :name
23
+
24
+ # Authentication token (see `/auth` and `/configure`)
25
+ attr_accessor :token
26
+
27
+ # The universal identity token, Required only for universal_identity authentication
28
+ attr_accessor :uid_token
29
+
30
+ # Certificate version
31
+ attr_accessor :version
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'json' => :'json',
37
+ :'name' => :'name',
38
+ :'token' => :'token',
39
+ :'uid_token' => :'uid-token',
40
+ :'version' => :'version'
41
+ }
42
+ end
43
+
44
+ # Returns all the JSON keys this model knows about
45
+ def self.acceptable_attributes
46
+ attribute_map.values
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.openapi_types
51
+ {
52
+ :'json' => :'Boolean',
53
+ :'name' => :'String',
54
+ :'token' => :'String',
55
+ :'uid_token' => :'String',
56
+ :'version' => :'Integer'
57
+ }
58
+ end
59
+
60
+ # List of attributes with nullable: true
61
+ def self.openapi_nullable
62
+ Set.new([
63
+ ])
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ if (!attributes.is_a?(Hash))
70
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::GetCertificateValue` initialize method"
71
+ end
72
+
73
+ # check to see if the attribute exists and convert string to symbol for hash key
74
+ attributes = attributes.each_with_object({}) { |(k, v), h|
75
+ if (!self.class.attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::GetCertificateValue`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
+ end
78
+ h[k.to_sym] = v
79
+ }
80
+
81
+ if attributes.key?(:'json')
82
+ self.json = attributes[:'json']
83
+ end
84
+
85
+ if attributes.key?(:'name')
86
+ self.name = attributes[:'name']
87
+ end
88
+
89
+ if attributes.key?(:'token')
90
+ self.token = attributes[:'token']
91
+ end
92
+
93
+ if attributes.key?(:'uid_token')
94
+ self.uid_token = attributes[:'uid_token']
95
+ end
96
+
97
+ if attributes.key?(:'version')
98
+ self.version = attributes[:'version']
99
+ end
100
+ end
101
+
102
+ # Show invalid properties with the reasons. Usually used together with valid?
103
+ # @return Array for valid properties with the reasons
104
+ def list_invalid_properties
105
+ invalid_properties = Array.new
106
+ if @name.nil?
107
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
108
+ end
109
+
110
+ invalid_properties
111
+ end
112
+
113
+ # Check to see if the all the properties in the model are valid
114
+ # @return true if the model is valid
115
+ def valid?
116
+ return false if @name.nil?
117
+ true
118
+ end
119
+
120
+ # Checks equality by comparing each attribute.
121
+ # @param [Object] Object to be compared
122
+ def ==(o)
123
+ return true if self.equal?(o)
124
+ self.class == o.class &&
125
+ json == o.json &&
126
+ name == o.name &&
127
+ token == o.token &&
128
+ uid_token == o.uid_token &&
129
+ version == o.version
130
+ end
131
+
132
+ # @see the `==` method
133
+ # @param [Object] Object to be compared
134
+ def eql?(o)
135
+ self == o
136
+ end
137
+
138
+ # Calculates hash code according to all attributes.
139
+ # @return [Integer] Hash code
140
+ def hash
141
+ [json, name, token, uid_token, version].hash
142
+ end
143
+
144
+ # Builds the object from hash
145
+ # @param [Hash] attributes Model attributes in the form of hash
146
+ # @return [Object] Returns the model itself
147
+ def self.build_from_hash(attributes)
148
+ new.build_from_hash(attributes)
149
+ end
150
+
151
+ # Builds the object from hash
152
+ # @param [Hash] attributes Model attributes in the form of hash
153
+ # @return [Object] Returns the model itself
154
+ def build_from_hash(attributes)
155
+ return nil unless attributes.is_a?(Hash)
156
+ attributes = attributes.transform_keys(&:to_sym)
157
+ self.class.openapi_types.each_pair do |key, type|
158
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
159
+ self.send("#{key}=", nil)
160
+ elsif type =~ /\AArray<(.*)>/i
161
+ # check to ensure the input is an array given that the attribute
162
+ # is documented as an array but the input is not
163
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
164
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
165
+ end
166
+ elsif !attributes[self.class.attribute_map[key]].nil?
167
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
168
+ end
169
+ end
170
+
171
+ self
172
+ end
173
+
174
+ # Deserializes the data based on type
175
+ # @param string type Data type
176
+ # @param string value Value to be deserialized
177
+ # @return [Object] Deserialized data
178
+ def _deserialize(type, value)
179
+ case type.to_sym
180
+ when :Time
181
+ Time.parse(value)
182
+ when :Date
183
+ Date.parse(value)
184
+ when :String
185
+ value.to_s
186
+ when :Integer
187
+ value.to_i
188
+ when :Float
189
+ value.to_f
190
+ when :Boolean
191
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
192
+ true
193
+ else
194
+ false
195
+ end
196
+ when :Object
197
+ # generic object (usually a Hash), return directly
198
+ value
199
+ when /\AArray<(?<inner_type>.+)>\z/
200
+ inner_type = Regexp.last_match[:inner_type]
201
+ value.map { |v| _deserialize(inner_type, v) }
202
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
203
+ k_type = Regexp.last_match[:k_type]
204
+ v_type = Regexp.last_match[:v_type]
205
+ {}.tap do |hash|
206
+ value.each do |k, v|
207
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
208
+ end
209
+ end
210
+ else # model
211
+ # models (e.g. Pet) or oneOf
212
+ klass = Akeyless.const_get(type)
213
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
214
+ end
215
+ end
216
+
217
+ # Returns the string representation of the object
218
+ # @return [String] String presentation of the object
219
+ def to_s
220
+ to_hash.to_s
221
+ end
222
+
223
+ # to_body is an alias to to_hash (backward compatibility)
224
+ # @return [Hash] Returns the object in the form of hash
225
+ def to_body
226
+ to_hash
227
+ end
228
+
229
+ # Returns the object in the form of hash
230
+ # @return [Hash] Returns the object in the form of hash
231
+ def to_hash
232
+ hash = {}
233
+ self.class.attribute_map.each_pair do |attr, param|
234
+ value = self.send(attr)
235
+ if value.nil?
236
+ is_nullable = self.class.openapi_nullable.include?(attr)
237
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
238
+ end
239
+
240
+ hash[param] = _to_hash(value)
241
+ end
242
+ hash
243
+ end
244
+
245
+ # Outputs non-array value in the form of hash
246
+ # For object, use to_hash. Otherwise, just return the value
247
+ # @param [Object] value Any valid value
248
+ # @return [Hash] Returns the value in the form of hash
249
+ def _to_hash(value)
250
+ if value.is_a?(Array)
251
+ value.compact.map { |v| _to_hash(v) }
252
+ elsif value.is_a?(Hash)
253
+ {}.tap do |hash|
254
+ value.each { |k, v| hash[k] = _to_hash(v) }
255
+ end
256
+ elsif value.respond_to? :to_hash
257
+ value.to_hash
258
+ else
259
+ value
260
+ end
261
+ end
262
+
263
+ end
264
+
265
+ end
@@ -0,0 +1,228 @@
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: 6.3.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Akeyless
17
+ class GetCertificateValueOutput
18
+ attr_accessor :certificate_pem
19
+
20
+ attr_accessor :private_key_pem
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'certificate_pem' => :'certificate_pem',
26
+ :'private_key_pem' => :'private_key_pem'
27
+ }
28
+ end
29
+
30
+ # Returns all the JSON keys this model knows about
31
+ def self.acceptable_attributes
32
+ attribute_map.values
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'certificate_pem' => :'String',
39
+ :'private_key_pem' => :'String'
40
+ }
41
+ end
42
+
43
+ # List of attributes with nullable: true
44
+ def self.openapi_nullable
45
+ Set.new([
46
+ ])
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::GetCertificateValueOutput` initialize method"
54
+ end
55
+
56
+ # check to see if the attribute exists and convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::GetCertificateValueOutput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+ if attributes.key?(:'certificate_pem')
65
+ self.certificate_pem = attributes[:'certificate_pem']
66
+ end
67
+
68
+ if attributes.key?(:'private_key_pem')
69
+ self.private_key_pem = attributes[:'private_key_pem']
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ invalid_properties = Array.new
77
+ invalid_properties
78
+ end
79
+
80
+ # Check to see if the all the properties in the model are valid
81
+ # @return true if the model is valid
82
+ def valid?
83
+ true
84
+ end
85
+
86
+ # Checks equality by comparing each attribute.
87
+ # @param [Object] Object to be compared
88
+ def ==(o)
89
+ return true if self.equal?(o)
90
+ self.class == o.class &&
91
+ certificate_pem == o.certificate_pem &&
92
+ private_key_pem == o.private_key_pem
93
+ end
94
+
95
+ # @see the `==` method
96
+ # @param [Object] Object to be compared
97
+ def eql?(o)
98
+ self == o
99
+ end
100
+
101
+ # Calculates hash code according to all attributes.
102
+ # @return [Integer] Hash code
103
+ def hash
104
+ [certificate_pem, private_key_pem].hash
105
+ end
106
+
107
+ # Builds the object from hash
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ # @return [Object] Returns the model itself
110
+ def self.build_from_hash(attributes)
111
+ new.build_from_hash(attributes)
112
+ end
113
+
114
+ # Builds the object from hash
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ # @return [Object] Returns the model itself
117
+ def build_from_hash(attributes)
118
+ return nil unless attributes.is_a?(Hash)
119
+ attributes = attributes.transform_keys(&:to_sym)
120
+ self.class.openapi_types.each_pair do |key, type|
121
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
122
+ self.send("#{key}=", nil)
123
+ elsif type =~ /\AArray<(.*)>/i
124
+ # check to ensure the input is an array given that the attribute
125
+ # is documented as an array but the input is not
126
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
127
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
128
+ end
129
+ elsif !attributes[self.class.attribute_map[key]].nil?
130
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
131
+ end
132
+ end
133
+
134
+ self
135
+ end
136
+
137
+ # Deserializes the data based on type
138
+ # @param string type Data type
139
+ # @param string value Value to be deserialized
140
+ # @return [Object] Deserialized data
141
+ def _deserialize(type, value)
142
+ case type.to_sym
143
+ when :Time
144
+ Time.parse(value)
145
+ when :Date
146
+ Date.parse(value)
147
+ when :String
148
+ value.to_s
149
+ when :Integer
150
+ value.to_i
151
+ when :Float
152
+ value.to_f
153
+ when :Boolean
154
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
155
+ true
156
+ else
157
+ false
158
+ end
159
+ when :Object
160
+ # generic object (usually a Hash), return directly
161
+ value
162
+ when /\AArray<(?<inner_type>.+)>\z/
163
+ inner_type = Regexp.last_match[:inner_type]
164
+ value.map { |v| _deserialize(inner_type, v) }
165
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
166
+ k_type = Regexp.last_match[:k_type]
167
+ v_type = Regexp.last_match[:v_type]
168
+ {}.tap do |hash|
169
+ value.each do |k, v|
170
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
171
+ end
172
+ end
173
+ else # model
174
+ # models (e.g. Pet) or oneOf
175
+ klass = Akeyless.const_get(type)
176
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
177
+ end
178
+ end
179
+
180
+ # Returns the string representation of the object
181
+ # @return [String] String presentation of the object
182
+ def to_s
183
+ to_hash.to_s
184
+ end
185
+
186
+ # to_body is an alias to to_hash (backward compatibility)
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_body
189
+ to_hash
190
+ end
191
+
192
+ # Returns the object in the form of hash
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_hash
195
+ hash = {}
196
+ self.class.attribute_map.each_pair do |attr, param|
197
+ value = self.send(attr)
198
+ if value.nil?
199
+ is_nullable = self.class.openapi_nullable.include?(attr)
200
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
201
+ end
202
+
203
+ hash[param] = _to_hash(value)
204
+ end
205
+ hash
206
+ end
207
+
208
+ # Outputs non-array value in the form of hash
209
+ # For object, use to_hash. Otherwise, just return the value
210
+ # @param [Object] value Any valid value
211
+ # @return [Hash] Returns the value in the form of hash
212
+ def _to_hash(value)
213
+ if value.is_a?(Array)
214
+ value.compact.map { |v| _to_hash(v) }
215
+ elsif value.is_a?(Hash)
216
+ {}.tap do |hash|
217
+ value.each { |k, v| hash[k] = _to_hash(v) }
218
+ end
219
+ elsif value.respond_to? :to_hash
220
+ value.to_hash
221
+ else
222
+ value
223
+ end
224
+ end
225
+
226
+ end
227
+
228
+ end
@@ -15,6 +15,8 @@ require 'time'
15
15
 
16
16
  module Akeyless
17
17
  class ListSRABastions
18
+ attr_accessor :allowed_urls_only
19
+
18
20
  # Set output format to JSON
19
21
  attr_accessor :json
20
22
 
@@ -27,6 +29,7 @@ module Akeyless
27
29
  # Attribute mapping from ruby-style variable name to JSON key.
28
30
  def self.attribute_map
29
31
  {
32
+ :'allowed_urls_only' => :'allowed-urls-only',
30
33
  :'json' => :'json',
31
34
  :'token' => :'token',
32
35
  :'uid_token' => :'uid-token'
@@ -41,6 +44,7 @@ module Akeyless
41
44
  # Attribute type mapping.
42
45
  def self.openapi_types
43
46
  {
47
+ :'allowed_urls_only' => :'Boolean',
44
48
  :'json' => :'Boolean',
45
49
  :'token' => :'String',
46
50
  :'uid_token' => :'String'
@@ -68,6 +72,10 @@ module Akeyless
68
72
  h[k.to_sym] = v
69
73
  }
70
74
 
75
+ if attributes.key?(:'allowed_urls_only')
76
+ self.allowed_urls_only = attributes[:'allowed_urls_only']
77
+ end
78
+
71
79
  if attributes.key?(:'json')
72
80
  self.json = attributes[:'json']
73
81
  end
@@ -99,6 +107,7 @@ module Akeyless
99
107
  def ==(o)
100
108
  return true if self.equal?(o)
101
109
  self.class == o.class &&
110
+ allowed_urls_only == o.allowed_urls_only &&
102
111
  json == o.json &&
103
112
  token == o.token &&
104
113
  uid_token == o.uid_token
@@ -113,7 +122,7 @@ module Akeyless
113
122
  # Calculates hash code according to all attributes.
114
123
  # @return [Integer] Hash code
115
124
  def hash
116
- [json, token, uid_token].hash
125
+ [allowed_urls_only, json, token, uid_token].hash
117
126
  end
118
127
 
119
128
  # Builds the object from hash
@@ -22,6 +22,9 @@ module Akeyless
22
22
  # Key name
23
23
  attr_accessor :name
24
24
 
25
+ # The new pem encoded certificate for the classic key. relevant only for keys provided by user ('bring-your-own-key')
26
+ attr_accessor :new_cert_pem_data
27
+
25
28
  # The new base64 encoded value for the classic key. relevant only for keys provided by user ('bring-your-own-key')
26
29
  attr_accessor :new_key_data
27
30
 
@@ -36,6 +39,7 @@ module Akeyless
36
39
  {
37
40
  :'json' => :'json',
38
41
  :'name' => :'name',
42
+ :'new_cert_pem_data' => :'new-cert-pem-data',
39
43
  :'new_key_data' => :'new-key-data',
40
44
  :'token' => :'token',
41
45
  :'uid_token' => :'uid-token'
@@ -52,6 +56,7 @@ module Akeyless
52
56
  {
53
57
  :'json' => :'Boolean',
54
58
  :'name' => :'String',
59
+ :'new_cert_pem_data' => :'String',
55
60
  :'new_key_data' => :'String',
56
61
  :'token' => :'String',
57
62
  :'uid_token' => :'String'
@@ -87,6 +92,10 @@ module Akeyless
87
92
  self.name = attributes[:'name']
88
93
  end
89
94
 
95
+ if attributes.key?(:'new_cert_pem_data')
96
+ self.new_cert_pem_data = attributes[:'new_cert_pem_data']
97
+ end
98
+
90
99
  if attributes.key?(:'new_key_data')
91
100
  self.new_key_data = attributes[:'new_key_data']
92
101
  end
@@ -125,6 +134,7 @@ module Akeyless
125
134
  self.class == o.class &&
126
135
  json == o.json &&
127
136
  name == o.name &&
137
+ new_cert_pem_data == o.new_cert_pem_data &&
128
138
  new_key_data == o.new_key_data &&
129
139
  token == o.token &&
130
140
  uid_token == o.uid_token
@@ -139,7 +149,7 @@ module Akeyless
139
149
  # Calculates hash code according to all attributes.
140
150
  # @return [Integer] Hash code
141
151
  def hash
142
- [json, name, new_key_data, token, uid_token].hash
152
+ [json, name, new_cert_pem_data, new_key_data, token, uid_token].hash
143
153
  end
144
154
 
145
155
  # Builds the object from hash