Class: SDM::ManagedSecret

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

Overview

ManagedSecret contains details about managed secret

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config: nil, expires_at: nil, id: nil, last_rotated_at: nil, name: nil, policy: nil, secret_engine_id: nil, secret_store_path: nil, tags: nil, value: nil) ⇒ ManagedSecret

Returns a new instance of ManagedSecret.



8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
# File 'lib/models/porcelain.rb', line 8224

def initialize(
  config: nil,
  expires_at: nil,
  id: nil,
  last_rotated_at: nil,
  name: nil,
  policy: nil,
  secret_engine_id: nil,
  secret_store_path: nil,
  tags: nil,
  value: nil
)
  @config = config == nil ? "" : config
  @expires_at = expires_at == nil ? nil : expires_at
  @id = id == nil ? "" : id
  @last_rotated_at = last_rotated_at == nil ? nil : last_rotated_at
  @name = name == nil ? "" : name
  @policy = policy == nil ? nil : policy
  @secret_engine_id = secret_engine_id == nil ? "" : secret_engine_id
  @secret_store_path = secret_store_path == nil ? "" : secret_store_path
  @tags = tags == nil ? SDM::_porcelain_zero_value_tags() : tags
  @value = value == nil ? "" : value
end

Instance Attribute Details

#configObject

public part of the secret value



8204
8205
8206
# File 'lib/models/porcelain.rb', line 8204

def config
  @config
end

#expires_atObject

Timestamp of when secret is going to be rotated



8206
8207
8208
# File 'lib/models/porcelain.rb', line 8206

def expires_at
  @expires_at
end

#idObject

Unique identifier of the Managed Secret.



8208
8209
8210
# File 'lib/models/porcelain.rb', line 8208

def id
  @id
end

#last_rotated_atObject

Timestamp of when secret was last rotated



8210
8211
8212
# File 'lib/models/porcelain.rb', line 8210

def last_rotated_at
  @last_rotated_at
end

#nameObject

Unique human-readable name of the Managed Secret.



8212
8213
8214
# File 'lib/models/porcelain.rb', line 8212

def name
  @name
end

#policyObject

Password and rotation policy for the secret



8214
8215
8216
# File 'lib/models/porcelain.rb', line 8214

def policy
  @policy
end

#secret_engine_idObject

An ID of a Secret Engine linked with the Managed Secret.



8216
8217
8218
# File 'lib/models/porcelain.rb', line 8216

def secret_engine_id
  @secret_engine_id
end

#secret_store_pathObject

Path in a secret store.



8218
8219
8220
# File 'lib/models/porcelain.rb', line 8218

def secret_store_path
  @secret_store_path
end

#tagsObject

Tags is a map of key, value pairs.



8220
8221
8222
# File 'lib/models/porcelain.rb', line 8220

def tags
  @tags
end

#valueObject

Sensitive value of the secret.



8222
8223
8224
# File 'lib/models/porcelain.rb', line 8222

def value
  @value
end

Instance Method Details

#to_json(options = {}) ⇒ Object



8248
8249
8250
8251
8252
8253
8254
# File 'lib/models/porcelain.rb', line 8248

def to_json(options = {})
  hash = {}
  self.instance_variables.each do |var|
    hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var
  end
  hash.to_json
end