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.



8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
# File 'lib/models/porcelain.rb', line 8141

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



8121
8122
8123
# File 'lib/models/porcelain.rb', line 8121

def config
  @config
end

#expires_atObject

Timestamp of when secret is going to be rotated



8123
8124
8125
# File 'lib/models/porcelain.rb', line 8123

def expires_at
  @expires_at
end

#idObject

Unique identifier of the Managed Secret.



8125
8126
8127
# File 'lib/models/porcelain.rb', line 8125

def id
  @id
end

#last_rotated_atObject

Timestamp of when secret was last rotated



8127
8128
8129
# File 'lib/models/porcelain.rb', line 8127

def last_rotated_at
  @last_rotated_at
end

#nameObject

Unique human-readable name of the Managed Secret.



8129
8130
8131
# File 'lib/models/porcelain.rb', line 8129

def name
  @name
end

#policyObject

Password and rotation policy for the secret



8131
8132
8133
# File 'lib/models/porcelain.rb', line 8131

def policy
  @policy
end

#secret_engine_idObject

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



8133
8134
8135
# File 'lib/models/porcelain.rb', line 8133

def secret_engine_id
  @secret_engine_id
end

#secret_store_pathObject

Path in a secret store.



8135
8136
8137
# File 'lib/models/porcelain.rb', line 8135

def secret_store_path
  @secret_store_path
end

#tagsObject

Tags is a map of key, value pairs.



8137
8138
8139
# File 'lib/models/porcelain.rb', line 8137

def tags
  @tags
end

#valueObject

Sensitive value of the secret.



8139
8140
8141
# File 'lib/models/porcelain.rb', line 8139

def value
  @value
end

Instance Method Details

#to_json(options = {}) ⇒ Object



8165
8166
8167
8168
8169
8170
8171
# File 'lib/models/porcelain.rb', line 8165

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