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.3'

Class Method Summary collapse

Class Method Details

.check_env_var=(check_env_var) ⇒ Object



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

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)


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

def self.check_env_var?
  @check_env_var
end

.filtersObject

Filters to apply when returning the configuration



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

def self.filters
  @filters
end

.filters=(filters) ⇒ Object



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

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

.registryObject

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



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

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
# File 'lib/secret_config.rb', line 33

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