Sha256: 5db9f1eb9f053c08265d34d3c787f5d714e9116d5783bba129bd72e8cb961874
Contents?: true
Size: 1.02 KB
Versions: 21
Compression:
Stored size: 1.02 KB
Contents
# frozen_string_literal: true module NeetoCommonsBackend module SecretsManagement def neeto_secrets @_neeto_secrets ||= begin secrets = ActiveSupport::OrderedOptions.new secrets.deep_merge! common_secrets secrets.deep_merge! host_app_secrets # Fallback to config.secret_key_base if secrets.secret_key_base isn't set secrets.secret_key_base ||= config.secret_key_base secrets end @secrets = @_neeto_secrets end private def host_app_secrets files = config.paths["config/secrets"].existent files = files.reject { |path| path.end_with?(".enc") } unless config.read_encrypted_secrets _read_secrets files end def common_secrets _read_secrets [File.join(__dir__, "config/secrets.yml")] end def _read_secrets(files) Rails::Secrets.parse(files, env: Rails.env) end end end class Rails::Application include NeetoCommonsBackend::SecretsManagement alias_method :secrets, :neeto_secrets end
Version data entries
21 entries across 21 versions & 1 rubygems