Sha256: 640d57834f7b7e010a59c47620c2fefb1df36fba5321b262acef783ce7f7b2a3
Contents?: true
Size: 736 Bytes
Versions: 28
Compression:
Stored size: 736 Bytes
Contents
# encoding: utf-8 require 'faraday' module Github module Request class OAuth2 < Faraday::Middleware dependency 'oauth2' def call(env) # puts "ENV: #{env.inspect}" # puts "TOKEN : #{@token}" # puts "APP: #{@app}" # Extract parameters from the query params = env[:url].query_values || {} env[:url].query_values = { 'access_token' => @token }.merge(params) token = env[:url].query_values['access_token'] env[:request_headers].merge!('Authorization' => "Token token=\"#{token}\"") @app.call env end def initialize(app, *args) @app = app @token = args.shift end end # OAuth2 end # Request end # Github
Version data entries
28 entries across 28 versions & 1 rubygems