Class: Anchor::AutoCert::Configuration

Inherits:
Struct
  • Object
show all
Defined in:
lib/anchor/auto_cert/configuration.rb

Overview

AutoCert Configuration provides a way to configure the AutoCert Manager.

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Configuration

Returns a new instance of Configuration.



32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/anchor/auto_cert/configuration.rb', line 32

def initialize(opts = {})
  opts[:directory] ||= envs(:directory)
  opts[:eab_kid] ||= envs(:eab_kid)
  opts[:eab_hmac_key] ||= envs(:eab_hmac_key)
  opts[:server_names] ||= envs(:server_names)&.split(',')

  if (eab = opts.delete(:external_account_binding))
    opts[:eab_kid]      = eab[:kid]
    opts[:eab_hmac_key] = eab[:hmac_key]
  end

  super(opts)
end

Instance Method Details

#external_account_binding=(eab) ⇒ Object



50
51
52
53
# File 'lib/anchor/auto_cert/configuration.rb', line 50

def (eab)
  self.eab_kid      = eab[:kid]
  self.eab_hmac_key = eab[:hmac_key]
end

#server_name=(name) ⇒ Object



46
47
48
# File 'lib/anchor/auto_cert/configuration.rb', line 46

def server_name=(name)
  self.server_names = [name]
end