Class: SettingsReader::VaultResolver::Engines::Abstract
- Inherits:
-
Object
- Object
- SettingsReader::VaultResolver::Engines::Abstract
- Includes:
- Logging
- Defined in:
- lib/settings_reader/vault_resolver/engines/abstract.rb
Overview
Abstract interface for Vault Backends
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #get(address) ⇒ Object
-
#initialize(config) ⇒ Abstract
constructor
A new instance of Abstract.
- #renew(entry) ⇒ Object
- #retrieves?(_address) ⇒ Boolean
Methods included from Logging
Constructor Details
#initialize(config) ⇒ Abstract
Returns a new instance of Abstract.
10 11 12 |
# File 'lib/settings_reader/vault_resolver/engines/abstract.rb', line 10 def initialize(config) @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
8 9 10 |
# File 'lib/settings_reader/vault_resolver/engines/abstract.rb', line 8 def config @config end |
Instance Method Details
#get(address) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/settings_reader/vault_resolver/engines/abstract.rb', line 18 def get(address) return unless (vault_secret = get_and_retry_auth(address)) wrap_secret(address, vault_secret) rescue Vault::VaultError => e raise SettingsReader::VaultResolver::Error, e. end |
#renew(entry) ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/settings_reader/vault_resolver/engines/abstract.rb', line 26 def renew(entry) return unless entry.renewable? new_secret = renew_and_retry_auth(entry) entry.update_renewed(new_secret) true end |
#retrieves?(_address) ⇒ Boolean
14 15 16 |
# File 'lib/settings_reader/vault_resolver/engines/abstract.rb', line 14 def retrieves?(_address) raise NotImplementedError end |