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

NODE_KEY =

When a node is both a value and a hash/branch in the tree, put its value in its hash with the following key:

"__value__".freeze
FILTERED =
"[FILTERED]".freeze
RANDOM =
"$(random)".freeze
VERSION =
"0.6.0".freeze

Class Method Summary collapse

Class Method Details

.check_env_var=(check_env_var) ⇒ Object



63
64
65
# File 'lib/secret_config.rb', line 63

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.

Returns:

  • (Boolean)


59
60
61
# File 'lib/secret_config.rb', line 59

def self.check_env_var?
  @check_env_var
end

.filtersObject

Filters to apply when returning the configuration



49
50
51
# File 'lib/secret_config.rb', line 49

def self.filters
  @filters
end

.filters=(filters) ⇒ Object



53
54
55
# File 'lib/secret_config.rb', line 53

def self.filters=(filters)
  @filters = filters
end

.registryObject

Returns the global registry. Unless ‘.use` was called above, it will default to a file provider.



44
45
46
# File 'lib/secret_config.rb', line 44

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.



38
39
40
# File 'lib/secret_config.rb', line 38

def self.use(provider, path: nil, **args)
  @registry = SecretConfig::Registry.new(path: path, provider: provider, provider_args: args)
end