Sha256: b65e1580bc30ff92b1c1ed8ff6ee2d4f7fbc7445ab109685ded97b674d741752
Contents?: true
Size: 717 Bytes
Versions: 2
Compression:
Stored size: 717 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 end end # Github
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
github_api-0.1.1 | lib/github_api/request/oauth2.rb |
github_api-0.1.0 | lib/github_api/request/oauth2.rb |