Module: Vault::Defaults

Defined in:
lib/vault/defaults.rb

Constant Summary collapse

VAULT_ADDRESS =

The default vault address.

Returns:

  • (String)
"https://127.0.0.1:8200".freeze

Class Method Summary collapse

Class Method Details

.addressString

The address to communicate with Vault.

Returns:

  • (String)


16
17
18
# File 'lib/vault/defaults.rb', line 16

def address
  ENV["VAULT_ADDR"] || VAULT_ADDRESS
end

.optionsHash

The list of calculated options for this configurable.

Returns:

  • (Hash)


10
11
12
# File 'lib/vault/defaults.rb', line 10

def options
  Hash[*Configurable.keys.map { |key| [key, public_send(key)] }.flatten]
end

.proxy_addressString?

The HTTP Proxy server address as a string

Returns:

  • (String, nil)


28
29
30
# File 'lib/vault/defaults.rb', line 28

def proxy_address
  ENV["VAULT_PROXY_ADDRESS"]
end

.proxy_passwordString?

The HTTP Proxy user password as a string

Returns:

  • (String, nil)


40
41
42
# File 'lib/vault/defaults.rb', line 40

def proxy_password
  ENV["VAULT_PROXY_PASSWORD"]
end

.proxy_portString?

The HTTP Proxy server port as a string

Returns:

  • (String, nil)


46
47
48
# File 'lib/vault/defaults.rb', line 46

def proxy_port
  ENV["VAULT_PROXY_PORT"]
end

.proxy_usernameString?

The HTTP Proxy server username as a string

Returns:

  • (String, nil)


34
35
36
# File 'lib/vault/defaults.rb', line 34

def proxy_username
  ENV["VAULT_PROXY_USERNAME"]
end

.ssl_pem_fileString?

The path to a pem on disk to use with custom SSL verification

Returns:

  • (String, nil)


52
53
54
# File 'lib/vault/defaults.rb', line 52

def ssl_pem_file
  ENV["VAULT_SSL_CERT"]
end

.ssl_verifytrue, false

Verify SSL requests (default: true)

Returns:

  • (true, false)


59
60
61
62
63
64
65
# File 'lib/vault/defaults.rb', line 59

def ssl_verify
  if ENV["VAULT_SSL_VERIFY"].nil?
    true
  else
    %w[t y].include?(ENV["VAULT_SSL_VERIFY"].downcase[0])
  end
end

.tokenString?

The vault token to use for authentiation.

Returns:

  • (String, nil)


22
23
24
# File 'lib/vault/defaults.rb', line 22

def token
  ENV["VAULT_TOKEN"]
end