Sha256: fe98b54103dbf3a86f6e9a6cd26bafadb2f91385e90b1c4c2e065d7ee04bfcbc
Contents?: true
Size: 564 Bytes
Versions: 5
Compression:
Stored size: 564 Bytes
Contents
# encoding: utf-8 require 'faraday' require 'base64' module Github module Request class BasicAuth < Faraday::Middleware dependency 'base64' def call(env) # puts "BASIC: #{@auth}" env[:request_headers].merge!('Authorization' => "Basic #{@auth}\"") @app.call env end def initialize(app, *args) @app = app login, password = args.shift, args.shift @auth = Base64.encode64("#{login}:#{password}") @auth.gsub!("\n", "") end end # BasicAuth end # Request end # Github
Version data entries
5 entries across 5 versions & 1 rubygems