Sha256: 2474147e11fd1c42a3491f32fffd165b2d267200d4f76937b33364d915da9d52

Contents?: true

Size: 592 Bytes

Versions: 6

Compression:

Stored size: 592 Bytes

Contents

# frozen_string_literal: true

require 'active_support/encrypted_configuration'

module BlueprintConfig
  module Backend
    class Credentials < Base
      def load_keys
        credentials.to_h
      end

      def credentials
        if defined?(Rails)
          Rails.application.credentials
        else
          ActiveSupport::EncryptedConfiguration.new(
            config_path: 'config/credentials.yml.enc',
            key_path: 'config/master.key',
            env_key: 'RAILS_MASTER_KEY',
            raise_if_missing_key: false
          )
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
blueprint_config-1.4.0 lib/blueprint_config/backend/credentials.rb
blueprint_config-1.3.1 lib/blueprint_config/backend/credentials.rb
blueprint_config-1.3.0 lib/blueprint_config/backend/credentials.rb
blueprint_config-1.2.0 lib/blueprint_config/backend/credentials.rb
blueprint_config-1.1.0 lib/blueprint_config/backend/credentials.rb
blueprint_config-1.0.0 lib/blueprint_config/backend/credentials.rb