Module: SecretConfig
- Extended by:
- Forwardable
- Defined in:
- lib/secret_config.rb,
lib/secret_config/cli.rb,
lib/secret_config/utils.rb,
lib/secret_config/errors.rb,
lib/secret_config/railtie.rb,
lib/secret_config/version.rb,
lib/secret_config/registry.rb,
lib/secret_config/providers/ssm.rb,
lib/secret_config/providers/file.rb,
lib/secret_config/providers/provider.rb
Overview
Centralized Configuration and Secrets Management for Ruby and Rails applications.
Defined Under Namespace
Modules: Providers, Utils Classes: CLI, ConfigurationError, Error, MissingMandatoryKey, Railtie, Registry, UndefinedRootError
Constant Summary collapse
- VERSION =
'0.5.0'
Class Method Summary collapse
- .check_env_var=(check_env_var) ⇒ Object
-
.check_env_var? ⇒ Boolean
Check the environment variables for a matching key and override the value returned from the central registry.
-
.filters ⇒ Object
Filters to apply when returning the configuration.
- .filters=(filters) ⇒ Object
-
.registry ⇒ Object
Returns the global registry.
-
.use(provider, path: nil, **args) ⇒ Object
Which provider to use along with any arguments The path will be overriden by env var ‘SECRET_CONFIG_PATH` if present.
Class Method Details
.check_env_var=(check_env_var) ⇒ Object
59 60 61 |
# File 'lib/secret_config.rb', line 59 def self.check_env_var=(check_env_var) @check_env_var = check_env_var end |
.check_env_var? ⇒ Boolean
Check the environment variables for a matching key and override the value returned from the central registry.
55 56 57 |
# File 'lib/secret_config.rb', line 55 def self.check_env_var? @check_env_var end |
.filters ⇒ Object
Filters to apply when returning the configuration
45 46 47 |
# File 'lib/secret_config.rb', line 45 def self.filters @filters end |
.filters=(filters) ⇒ Object
49 50 51 |
# File 'lib/secret_config.rb', line 49 def self.filters=(filters) @filters = filters end |
.registry ⇒ Object
Returns the global registry. Unless ‘.use` was called above, it will default to a file provider.
40 41 42 |
# File 'lib/secret_config.rb', line 40 def self.registry @registry ||= SecretConfig::Registry.new end |
.use(provider, path: nil, **args) ⇒ Object
Which provider to use along with any arguments The path will be overriden by env var ‘SECRET_CONFIG_PATH` if present.
33 34 35 36 |
# File 'lib/secret_config.rb', line 33 def self.use(provider, path: nil, **args) path ||= ENV["SECRET_CONFIG_PATH"] @registry = SecretConfig::Registry.new(path: path, provider: provider, provider_args: args) end |