Class: TerraspacePluginAzurerm::Interfaces::Helper::Secret

Inherits:
Object
  • Object
show all
Extended by:
Memoist
Includes:
Logging
Defined in:
lib/terraspace_plugin_azurerm/interfaces/helper/secret.rb,
lib/terraspace_plugin_azurerm/interfaces/helper/secret/fetcher.rb

Defined Under Namespace

Classes: Fetcher

Instance Method Summary collapse

Methods included from Logging

#logger

Constructor Details

#initialize(mod, options = {}) ⇒ Secret

Returns a new instance of Secret.



8
9
10
11
# File 'lib/terraspace_plugin_azurerm/interfaces/helper/secret.rb', line 8

def initialize(mod, options={})
  @mod, @options = mod, options
  @base64 = options[:base64]
end

Instance Method Details

#fetch(name, opts = {}) ⇒ Object

opts: version, vault



14
15
16
17
18
# File 'lib/terraspace_plugin_azurerm/interfaces/helper/secret.rb', line 14

def fetch(name, opts={})
  value = fetcher.fetch(name, opts)
  value = Base64.strict_encode64(value).strip if @base64
  value
end

#fetcherObject



20
21
22
# File 'lib/terraspace_plugin_azurerm/interfaces/helper/secret.rb', line 20

def fetcher
  Fetcher.new(@mod, @options)
end