Class: SDM::PostgresEngine

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

Overview

PostgresEngine is currently unstable, and its API may change, or it may be removed, without a major version bump.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(after_read_ttl: nil, database: nil, hostname: nil, id: nil, key_rotation_interval_days: nil, name: nil, password: nil, policy: nil, port: nil, public_key: nil, secret_store_id: nil, secret_store_root_path: nil, tags: nil, tls: nil, ttl: nil, username: nil) ⇒ PostgresEngine

Returns a new instance of PostgresEngine.



12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
# File 'lib/models/porcelain.rb', line 12187

def initialize(
  after_read_ttl: nil,
  database: nil,
  hostname: nil,
  id: nil,
  key_rotation_interval_days: nil,
  name: nil,
  password: nil,
  policy: nil,
  port: nil,
  public_key: nil,
  secret_store_id: nil,
  secret_store_root_path: nil,
  tags: nil,
  tls: nil,
  ttl: nil,
  username: nil
)
  @after_read_ttl = after_read_ttl == nil ? nil : after_read_ttl
  @database = database == nil ? "" : database
  @hostname = hostname == nil ? "" : hostname
  @id = id == nil ? "" : id
  @key_rotation_interval_days = key_rotation_interval_days == nil ? 0 : key_rotation_interval_days
  @name = name == nil ? "" : name
  @password = password == nil ? "" : password
  @policy = policy == nil ? nil : policy
  @port = port == nil ? 0 : port
  @public_key = public_key == nil ? "" : public_key
  @secret_store_id = secret_store_id == nil ? "" : secret_store_id
  @secret_store_root_path = secret_store_root_path == nil ? "" : secret_store_root_path
  @tags = tags == nil ? SDM::_porcelain_zero_value_tags() : tags
  @tls = tls == nil ? false : tls
  @ttl = ttl == nil ? nil : ttl
  @username = username == nil ? "" : username
end

Instance Attribute Details

#after_read_ttlObject

The default time-to-live duration of the password after it's read. Once the ttl has passed, a password will be rotated.



12155
12156
12157
# File 'lib/models/porcelain.rb', line 12155

def after_read_ttl
  @after_read_ttl
end

#databaseObject

Database is the database to verify credential against.



12157
12158
12159
# File 'lib/models/porcelain.rb', line 12157

def database
  @database
end

#hostnameObject

Hostname is the hostname or IP address of the Postgres server.



12159
12160
12161
# File 'lib/models/porcelain.rb', line 12159

def hostname
  @hostname
end

#idObject

Unique identifier of the Secret Engine.



12161
12162
12163
# File 'lib/models/porcelain.rb', line 12161

def id
  @id
end

#key_rotation_interval_daysObject

An interval of public/private key rotation for secret engine in days



12163
12164
12165
# File 'lib/models/porcelain.rb', line 12163

def key_rotation_interval_days
  @key_rotation_interval_days
end

#nameObject

Unique human-readable name of the Secret Engine.



12165
12166
12167
# File 'lib/models/porcelain.rb', line 12165

def name
  @name
end

#passwordObject

Password is the password to connect to the Postgres server.



12167
12168
12169
# File 'lib/models/porcelain.rb', line 12167

def password
  @password
end

#policyObject

Policy for password creation



12169
12170
12171
# File 'lib/models/porcelain.rb', line 12169

def policy
  @policy
end

#portObject

Port is the port number of the Postgres server.



12171
12172
12173
# File 'lib/models/porcelain.rb', line 12171

def port
  @port
end

#public_keyObject

Public key linked with a secret engine



12173
12174
12175
# File 'lib/models/porcelain.rb', line 12173

def public_key
  @public_key
end

#secret_store_idObject

Backing secret store identifier



12175
12176
12177
# File 'lib/models/porcelain.rb', line 12175

def secret_store_id
  @secret_store_id
end

#secret_store_root_pathObject

Backing Secret Store root path where managed secrets are going to be stored



12177
12178
12179
# File 'lib/models/porcelain.rb', line 12177

def secret_store_root_path
  @secret_store_root_path
end

#tagsObject

Tags is a map of key, value pairs.



12179
12180
12181
# File 'lib/models/porcelain.rb', line 12179

def tags
  @tags
end

#tlsObject

TLS enables TLS/SSL when connecting to the Postgres server.



12181
12182
12183
# File 'lib/models/porcelain.rb', line 12181

def tls
  @tls
end

#ttlObject

The default password time-to-live duration. Once the ttl has passed, a password will be rotated the next time it's requested.



12183
12184
12185
# File 'lib/models/porcelain.rb', line 12183

def ttl
  @ttl
end

#usernameObject

Username is the username to connect to the Postgres server.



12185
12186
12187
# File 'lib/models/porcelain.rb', line 12185

def username
  @username
end

Instance Method Details

#to_json(options = {}) ⇒ Object



12223
12224
12225
12226
12227
12228
12229
# File 'lib/models/porcelain.rb', line 12223

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