module Vault::Transit::Configurable

Public Instance Methods

enabled=(val) click to toggle source

Sets whether Vault is enabled. Users can set this in an initializer depending on their Rails environment.

@example

Vault.configure do |vault|
  vault.enabled = Rails.env.production?
end

@return [true, false]

# File lib/vault/transit/configurable.rb, line 28
def enabled=(val)
  @enabled = !!val
end
enabled?() click to toggle source

Whether the connection to Vault is enabled. The default value is `false`, which means vault-rails will perform in-memory encryption/decryption and not attempt to talk to a real Vault server. This is useful for development and testing.

@return [true, false]

# File lib/vault/transit/configurable.rb, line 12
def enabled?
  if !defined?(@enabled) || @enabled.nil?
    return false
  end
  return @enabled
end
retry_attempts() click to toggle source

Gets the number of retry attempts.

@return [Fixnum]

# File lib/vault/transit/configurable.rb, line 35
def retry_attempts
  @retry_attempts ||= Vault::Defaults::RETRY_ATTEMPTS
end
retry_attempts=(val) click to toggle source

Sets the number of retry attempts. Please see the Vault documentation for more information.

@param [Fixnum] val

# File lib/vault/transit/configurable.rb, line 43
def retry_attempts=(val)
  @retry_attempts = val
end
retry_base() click to toggle source

Gets the number of retry attempts.

@return [Fixnum]

# File lib/vault/transit/configurable.rb, line 50
def retry_base
  @retry_base ||= Vault::Defaults::RETRY_BASE
end
retry_base=(val) click to toggle source

Sets the retry interval. Please see the Vault documentation for more information.

@param [Fixnum] val

# File lib/vault/transit/configurable.rb, line 58
def retry_base=(val)
  @retry_base = val
end
retry_max_wait() click to toggle source

Gets the retry maximum wait.

@return [Fixnum]

# File lib/vault/transit/configurable.rb, line 65
def retry_max_wait
  @retry_max_wait ||= Vault::Defaults::RETRY_MAX_WAIT
end
retry_max_wait=(val) click to toggle source

Sets the naximum amount of time for a single retry. Please see the Vault documentation for more information.

@param [Fixnum] val

# File lib/vault/transit/configurable.rb, line 73
def retry_max_wait=(val)
  @retry_max_wait = val
end