Sha256: 281bffccac13cebd7ea22a06a14c1689dd204cf54aafe1e9cf4a878bdfd508b4
Contents?: true
Size: 677 Bytes
Versions: 29
Compression:
Stored size: 677 Bytes
Contents
# Borrowed from https://github.com/pengwynn/faraday_middleware/blob/master/lib/faraday/request/oauth.rb class ApiClient::Connection::Middlewares::Request::OAuth < Faraday::Middleware dependency 'simple_oauth' def call(env) params = env[:body] || {} signature_params = params.reject{ |k,v| v.respond_to?(:content_type) } header = SimpleOAuth::Header.new(env[:method], env[:url], signature_params, @options || {}) env[:request_headers]['Authorization'] = header.to_s env[:request_headers]['User-Agent'] = "ApiClient gem v#{ApiClient::VERSION}" @app.call(env) end def initialize(app, options = {}) @app, @options = app, options end end
Version data entries
29 entries across 29 versions & 1 rubygems