module Vault::Transit::Configurable
Public Instance Methods
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
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
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
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
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
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
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
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