Sha256: 93d8c455ce190c177912b6a5960e6b49e462264099c96d9fc9ec61012fe5dad8

Contents?: true

Size: 552 Bytes

Versions: 4

Compression:

Stored size: 552 Bytes

Contents

require 'faraday'

module Faraday
  class Request::EvrythngOAuth < Faraday::Middleware
    dependency 'simple_oauth'

    def call(env)
      params = env[:body] || {}
      signature_params = params

      params.map{ |k,v| signature_params = {} if v.respond_to?(:content_type) }

      header = SimpleOAuth::Header.new(env[:method], env[:url], signature_params, @options)

      env[:request_headers]['Authorization'] = header.to_s

      @app.call(env)
    end

    def initialize(app, options)
      @app, @options = app, options
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
evrythng-0.0.5 lib/faraday/request/evrythng_oauth.rb
evrythng-0.0.3 lib/faraday/request/evrythng_oauth.rb
evrythng-0.0.2 lib/faraday/request/evrythng_oauth.rb
evrythng-0.0.1 lib/faraday/request/evrythng_oauth.rb