Sha256: 5ac82b59aa5e642026956c563ad73be9c25830a1cf2a12c2b92e4bb9d7e1f356
Contents?: true
Size: 535 Bytes
Versions: 7
Compression:
Stored size: 535 Bytes
Contents
require 'faraday' module Faraday class Request::OAuth < Faraday::Middleware dependency 'simple_oauth' def call(env) params = env[:body] || {} signature_params = params.reject{ |k,v| v.respond_to?(:content_type) || (env[:method] == :put) } 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
7 entries across 7 versions & 2 rubygems