Sha256: cb386acd0435baa7c68abae5c33889062cd03e0326dbfcfec927d64a9441e1c5
Contents?: true
Size: 678 Bytes
Versions: 18
Compression:
Stored size: 678 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
18 entries across 18 versions & 1 rubygems