Sha256: afdc1892c54a832b5fe2058a12f77a0a903c890883e6ea2b42eefbc383d1d15b

Contents?: true

Size: 358 Bytes

Versions: 6

Compression:

Stored size: 358 Bytes

Contents

module Faraday
  class ApiKey < Faraday::Middleware

    def call(env)
      unless env.request.headers['X-Reviewed-Authorization']
        raise ::Reviewed::ConfigurationError.new("Please set the API key for your Reviewed::Client instance before making a request")
      end
    end
  end
end

Faraday.register_middleware :request, api_key: Faraday::ApiKey

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
reviewed-0.1.26 lib/faraday/api_key.rb
reviewed-0.1.25 lib/faraday/api_key.rb
reviewed-0.1.24 lib/faraday/api_key.rb
reviewed-0.1.23 lib/faraday/api_key.rb
reviewed-0.1.22 lib/faraday/api_key.rb
reviewed-0.1.21 lib/faraday/api_key.rb