Sha256: 05e7c191d56ccf077d46c99363fd16a1274db31447e5ca0aa10f50188ef44532

Contents?: true

Size: 557 Bytes

Versions: 1

Compression:

Stored size: 557 Bytes

Contents

require 'kashi'
require 'vault'
require 'vault/errors'

module Kashi
  module SecretProviders
    class Vault
      def initialize
      end

      def ask(keys)
        result = {}
        keys.each do |key|
          begin
            result[key] = ::Vault.get("v1/secret/#{key}")[:data][:value]
          rescue ::Vault::HTTPClientError => e
            if e.code == 404
              Kashi.logger.info("[#{self.class}] key not found. => `#{key}`")
            end
            raise e
          end
        end
        result
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kashi-vault-0.1.0 lib/kashi/secret_providers/vault.rb