Module: Vault::Transit::Configurable
- Includes:
- Configurable
- Defined in:
- lib/vault/transit/configurable.rb
Instance Method Summary collapse
-
#enabled=(val) ⇒ true, false
Sets whether Vault is enabled.
-
#enabled? ⇒ true, false
Whether the connection to Vault is enabled.
-
#retry_attempts ⇒ Fixnum
Gets the number of retry attempts.
-
#retry_attempts=(val) ⇒ Object
Sets the number of retry attempts.
-
#retry_base ⇒ Fixnum
Gets the number of retry attempts.
-
#retry_base=(val) ⇒ Object
Sets the retry interval.
-
#retry_max_wait ⇒ Fixnum
Gets the retry maximum wait.
-
#retry_max_wait=(val) ⇒ Object
Sets the naximum amount of time for a single retry.
Instance Method Details
#enabled=(val) ⇒ true, false
Sets whether Vault is enabled. Users can set this in an initializer depending on their Rails environment.
28 29 30 |
# File 'lib/vault/transit/configurable.rb', line 28 def enabled=(val) @enabled = !!val end |
#enabled? ⇒ true, false
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.
12 13 14 15 16 17 |
# File 'lib/vault/transit/configurable.rb', line 12 def enabled? if !defined?(@enabled) || @enabled.nil? return false end return @enabled end |
#retry_attempts ⇒ Fixnum
Gets the number of retry attempts.
35 36 37 |
# File 'lib/vault/transit/configurable.rb', line 35 def retry_attempts @retry_attempts ||= 0 end |
#retry_attempts=(val) ⇒ Object
Sets the number of retry attempts. Please see the Vault documentation for more information.
43 44 45 |
# File 'lib/vault/transit/configurable.rb', line 43 def retry_attempts=(val) @retry_attempts = val end |
#retry_base ⇒ Fixnum
Gets the number of retry attempts.
50 51 52 |
# File 'lib/vault/transit/configurable.rb', line 50 def retry_base @retry_base ||= Vault::Defaults::RETRY_BASE end |
#retry_base=(val) ⇒ Object
Sets the retry interval. Please see the Vault documentation for more information.
58 59 60 |
# File 'lib/vault/transit/configurable.rb', line 58 def retry_base=(val) @retry_base = val end |
#retry_max_wait ⇒ Fixnum
Gets the retry maximum wait.
65 66 67 |
# 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) ⇒ Object
Sets the naximum amount of time for a single retry. Please see the Vault documentation for more information.
73 74 75 |
# File 'lib/vault/transit/configurable.rb', line 73 def retry_max_wait=(val) @retry_max_wait = val end |