Class: Kubernetes::V1beta1PodCertificateRequestSpec

Inherits:
Object
  • Object
show all
Defined in:
lib/kubernetes/models/v1beta1_pod_certificate_request_spec.rb

Overview

PodCertificateRequestSpec describes the certificate request. All fields are immutable after creation.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ V1beta1PodCertificateRequestSpec

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# File 'lib/kubernetes/models/v1beta1_pod_certificate_request_spec.rb', line 99

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Kubernetes::V1beta1PodCertificateRequestSpec` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `Kubernetes::V1beta1PodCertificateRequestSpec`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'max_expiration_seconds')
    self.max_expiration_seconds = attributes[:'max_expiration_seconds']
  end

  if attributes.key?(:'node_name')
    self.node_name = attributes[:'node_name']
  end

  if attributes.key?(:'node_uid')
    self.node_uid = attributes[:'node_uid']
  end

  if attributes.key?(:'pkix_public_key')
    self.pkix_public_key = attributes[:'pkix_public_key']
  end

  if attributes.key?(:'pod_name')
    self.pod_name = attributes[:'pod_name']
  end

  if attributes.key?(:'pod_uid')
    self.pod_uid = attributes[:'pod_uid']
  end

  if attributes.key?(:'proof_of_possession')
    self.proof_of_possession = attributes[:'proof_of_possession']
  end

  if attributes.key?(:'service_account_name')
    self. = attributes[:'service_account_name']
  end

  if attributes.key?(:'service_account_uid')
    self. = attributes[:'service_account_uid']
  end

  if attributes.key?(:'signer_name')
    self.signer_name = attributes[:'signer_name']
  end

  if attributes.key?(:'unverified_user_annotations')
    if (value = attributes[:'unverified_user_annotations']).is_a?(Hash)
      self.unverified_user_annotations = value
    end
  end
end

Instance Attribute Details

#max_expiration_secondsObject

maxExpirationSeconds is the maximum lifetime permitted for the certificate. If omitted, kube-apiserver will set it to 86400(24 hours). kube-apiserver will reject values shorter than 3600 (1 hour). The maximum allowable value is 7862400 (91 days). The signer implementation is then free to issue a certificate with any lifetime shorter than MaxExpirationSeconds, but no shorter than 3600 seconds (1 hour). This constraint is enforced by kube-apiserver. ‘kubernetes.io` signers will never issue certificates with a lifetime longer than 24 hours.



20
21
22
# File 'lib/kubernetes/models/v1beta1_pod_certificate_request_spec.rb', line 20

def max_expiration_seconds
  @max_expiration_seconds
end

#node_nameObject

nodeName is the name of the node the pod is assigned to.



23
24
25
# File 'lib/kubernetes/models/v1beta1_pod_certificate_request_spec.rb', line 23

def node_name
  @node_name
end

#node_uidObject

nodeUID is the UID of the node the pod is assigned to.



26
27
28
# File 'lib/kubernetes/models/v1beta1_pod_certificate_request_spec.rb', line 26

def node_uid
  @node_uid
end

#pkix_public_keyObject

pkixPublicKey is the PKIX-serialized public key the signer will issue the certificate to. The key must be one of RSA3072, RSA4096, ECDSAP256, ECDSAP384, ECDSAP521, or ED25519. Note that this list may be expanded in the future. Signer implementations do not need to support all key types supported by kube-apiserver and kubelet. If a signer does not support the key type used for a given PodCertificateRequest, it must deny the request by setting a status.conditions entry with a type of "Denied" and a reason of "UnsupportedKeyType". It may also suggest a key type that it does support in the message field.



29
30
31
# File 'lib/kubernetes/models/v1beta1_pod_certificate_request_spec.rb', line 29

def pkix_public_key
  @pkix_public_key
end

#pod_nameObject

podName is the name of the pod into which the certificate will be mounted.



32
33
34
# File 'lib/kubernetes/models/v1beta1_pod_certificate_request_spec.rb', line 32

def pod_name
  @pod_name
end

#pod_uidObject

podUID is the UID of the pod into which the certificate will be mounted.



35
36
37
# File 'lib/kubernetes/models/v1beta1_pod_certificate_request_spec.rb', line 35

def pod_uid
  @pod_uid
end

#proof_of_possessionObject

proofOfPossession proves that the requesting kubelet holds the private key corresponding to pkixPublicKey. It is contructed by signing the ASCII bytes of the pod’s UID using ‘pkixPublicKey`. kube-apiserver validates the proof of possession during creation of the PodCertificateRequest. If the key is an RSA key, then the signature is over the ASCII bytes of the pod UID, using RSASSA-PSS from RFC 8017 (as implemented by the golang function crypto/rsa.SignPSS with nil options). If the key is an ECDSA key, then the signature is as described by [SEC 1, Version 2.0](www.secg.org/sec1-v2.pdf) (as implemented by the golang library function crypto/ecdsa.SignASN1) If the key is an ED25519 key, the the signature is as described by the [ED25519 Specification](ed25519.cr.yp.to/) (as implemented by the golang library crypto/ed25519.Sign).



38
39
40
# File 'lib/kubernetes/models/v1beta1_pod_certificate_request_spec.rb', line 38

def proof_of_possession
  @proof_of_possession
end

#service_account_nameObject

serviceAccountName is the name of the service account the pod is running as.



41
42
43
# File 'lib/kubernetes/models/v1beta1_pod_certificate_request_spec.rb', line 41

def 
  @service_account_name
end

#service_account_uidObject

serviceAccountUID is the UID of the service account the pod is running as.



44
45
46
# File 'lib/kubernetes/models/v1beta1_pod_certificate_request_spec.rb', line 44

def 
  @service_account_uid
end

#signer_nameObject

signerName indicates the requested signer. All signer names beginning with ‘kubernetes.io` are reserved for use by the Kubernetes project. There is currently one well-known signer documented by the Kubernetes project, `kubernetes.io/kube-apiserver-client-pod`, which will issue client certificates understood by kube-apiserver. It is currently unimplemented.



47
48
49
# File 'lib/kubernetes/models/v1beta1_pod_certificate_request_spec.rb', line 47

def signer_name
  @signer_name
end

#unverified_user_annotationsObject

unverifiedUserAnnotations allow pod authors to pass additional information to the signer implementation. Kubernetes does not restrict or validate this metadata in any way. Entries are subject to the same validation as object metadata annotations, with the addition that all keys must be domain-prefixed. No restrictions are placed on values, except an overall size limitation on the entire field. Signers should document the keys and values they support. Signers should deny requests that contain keys they do not recognize.



50
51
52
# File 'lib/kubernetes/models/v1beta1_pod_certificate_request_spec.rb', line 50

def unverified_user_annotations
  @unverified_user_annotations
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



70
71
72
# File 'lib/kubernetes/models/v1beta1_pod_certificate_request_spec.rb', line 70

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/kubernetes/models/v1beta1_pod_certificate_request_spec.rb', line 53

def self.attribute_map
  {
    :'max_expiration_seconds' => :'maxExpirationSeconds',
    :'node_name' => :'nodeName',
    :'node_uid' => :'nodeUID',
    :'pkix_public_key' => :'pkixPublicKey',
    :'pod_name' => :'podName',
    :'pod_uid' => :'podUID',
    :'proof_of_possession' => :'proofOfPossession',
    :'service_account_name' => :'serviceAccountName',
    :'service_account_uid' => :'serviceAccountUID',
    :'signer_name' => :'signerName',
    :'unverified_user_annotations' => :'unverifiedUserAnnotations'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



292
293
294
# File 'lib/kubernetes/models/v1beta1_pod_certificate_request_spec.rb', line 292

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



92
93
94
95
# File 'lib/kubernetes/models/v1beta1_pod_certificate_request_spec.rb', line 92

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/kubernetes/models/v1beta1_pod_certificate_request_spec.rb', line 75

def self.openapi_types
  {
    :'max_expiration_seconds' => :'Integer',
    :'node_name' => :'String',
    :'node_uid' => :'String',
    :'pkix_public_key' => :'String',
    :'pod_name' => :'String',
    :'pod_uid' => :'String',
    :'proof_of_possession' => :'String',
    :'service_account_name' => :'String',
    :'service_account_uid' => :'String',
    :'signer_name' => :'String',
    :'unverified_user_annotations' => :'Hash<String, String>'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# File 'lib/kubernetes/models/v1beta1_pod_certificate_request_spec.rb', line 261

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      max_expiration_seconds == o.max_expiration_seconds &&
      node_name == o.node_name &&
      node_uid == o.node_uid &&
      pkix_public_key == o.pkix_public_key &&
      pod_name == o.pod_name &&
      pod_uid == o.pod_uid &&
      proof_of_possession == o.proof_of_possession &&
       == o. &&
       == o. &&
      signer_name == o.signer_name &&
      unverified_user_annotations == o.unverified_user_annotations
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
# File 'lib/kubernetes/models/v1beta1_pod_certificate_request_spec.rb', line 322

def _deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = Kubernetes.const_get(type)
    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



393
394
395
396
397
398
399
400
401
402
403
404
405
# File 'lib/kubernetes/models/v1beta1_pod_certificate_request_spec.rb', line 393

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
# File 'lib/kubernetes/models/v1beta1_pod_certificate_request_spec.rb', line 299

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.openapi_types.each_pair do |key, type|
    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      self.send("#{key}=", nil)
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


279
280
281
# File 'lib/kubernetes/models/v1beta1_pod_certificate_request_spec.rb', line 279

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



285
286
287
# File 'lib/kubernetes/models/v1beta1_pod_certificate_request_spec.rb', line 285

def hash
  [max_expiration_seconds, node_name, node_uid, pkix_public_key, pod_name, pod_uid, proof_of_possession, , , signer_name, unverified_user_annotations].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# File 'lib/kubernetes/models/v1beta1_pod_certificate_request_spec.rb', line 161

def list_invalid_properties
  invalid_properties = Array.new
  if @node_name.nil?
    invalid_properties.push('invalid value for "node_name", node_name cannot be nil.')
  end

  if @node_uid.nil?
    invalid_properties.push('invalid value for "node_uid", node_uid cannot be nil.')
  end

  if @pkix_public_key.nil?
    invalid_properties.push('invalid value for "pkix_public_key", pkix_public_key cannot be nil.')
  end

  pattern = Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
  if @pkix_public_key !~ pattern
    invalid_properties.push("invalid value for \"pkix_public_key\", must conform to the pattern #{pattern}.")
  end

  if @pod_name.nil?
    invalid_properties.push('invalid value for "pod_name", pod_name cannot be nil.')
  end

  if @pod_uid.nil?
    invalid_properties.push('invalid value for "pod_uid", pod_uid cannot be nil.')
  end

  if @proof_of_possession.nil?
    invalid_properties.push('invalid value for "proof_of_possession", proof_of_possession cannot be nil.')
  end

  pattern = Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
  if @proof_of_possession !~ pattern
    invalid_properties.push("invalid value for \"proof_of_possession\", must conform to the pattern #{pattern}.")
  end

  if @service_account_name.nil?
    invalid_properties.push('invalid value for "service_account_name", service_account_name cannot be nil.')
  end

  if @service_account_uid.nil?
    invalid_properties.push('invalid value for "service_account_uid", service_account_uid cannot be nil.')
  end

  if @signer_name.nil?
    invalid_properties.push('invalid value for "signer_name", signer_name cannot be nil.')
  end

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



369
370
371
# File 'lib/kubernetes/models/v1beta1_pod_certificate_request_spec.rb', line 369

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



375
376
377
378
379
380
381
382
383
384
385
386
387
# File 'lib/kubernetes/models/v1beta1_pod_certificate_request_spec.rb', line 375

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



363
364
365
# File 'lib/kubernetes/models/v1beta1_pod_certificate_request_spec.rb', line 363

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



214
215
216
217
218
219
220
221
222
223
224
225
226
227
# File 'lib/kubernetes/models/v1beta1_pod_certificate_request_spec.rb', line 214

def valid?
  return false if @node_name.nil?
  return false if @node_uid.nil?
  return false if @pkix_public_key.nil?
  return false if @pkix_public_key !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
  return false if @pod_name.nil?
  return false if @pod_uid.nil?
  return false if @proof_of_possession.nil?
  return false if @proof_of_possession !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
  return false if @service_account_name.nil?
  return false if @service_account_uid.nil?
  return false if @signer_name.nil?
  true
end