Sha256: f788f9c706a1578e5a970884becf2086eb18c139f990cd1be4f812f15fc6548f

Contents?: true

Size: 505 Bytes

Versions: 83

Compression:

Stored size: 505 Bytes

Contents

# frozen_string_literal: true

require 'base64'

module Faraday
  class Request
    # Authorization middleware for Basic Authentication.
    class BasicAuthentication < load_middleware(:authorization)
      # @param login [String]
      # @param pass [String]
      #
      # @return [String] a Basic Authentication header line
      def self.header(login, pass)
        value = Base64.encode64([login, pass].join(':'))
        value.delete!("\n")
        super(:Basic, value)
      end
    end
  end
end

Version data entries

83 entries across 70 versions & 15 rubygems

Version Path
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/faraday-1.3.0/lib/faraday/request/basic_authentication.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/faraday-1.4.2/lib/faraday/request/basic_authentication.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/faraday-1.1.0/lib/faraday/request/basic_authentication.rb
tdiary-5.1.6 vendor/bundle/ruby/3.0.0/gems/faraday-1.4.2/lib/faraday/request/basic_authentication.rb
faraday-1.4.2 lib/faraday/request/basic_authentication.rb
cocRb-0.1.0 .bundle/ruby/3.0.0/gems/faraday-1.4.1/lib/faraday/request/basic_authentication.rb
faraday-1.4.1 lib/faraday/request/basic_authentication.rb
faraday-1.4.0 lib/faraday/request/basic_authentication.rb
faraday-1.3.1 lib/faraday/request/basic_authentication.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/vendor/bundle/ruby/2.7.0/gems/faraday-1.1.0/lib/faraday/request/basic_authentication.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/faraday-1.2.0/lib/faraday/request/basic_authentication.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/faraday-1.1.0/lib/faraday/request/basic_authentication.rb
tdiary-5.1.5 vendor/bundle/ruby/2.7.0/gems/faraday-1.3.0/lib/faraday/request/basic_authentication.rb
logstash-output-newrelic-1.2.0 vendor/bundle/jruby/2.5.0/gems/faraday-1.3.0/lib/faraday/request/basic_authentication.rb
faraday-1.3.0 lib/faraday/request/basic_authentication.rb
faraday-1.2.0 lib/faraday/request/basic_authentication.rb
tdiary-5.1.4 vendor/bundle/ruby/2.7.0/gems/faraday-1.1.0/lib/faraday/request/basic_authentication.rb
passbase-1.2.0 vendor/bundle/ruby/2.7.0/gems/faraday-1.1.0/lib/faraday/request/basic_authentication.rb
passbase-1.1.0 vendor/bundle/ruby/2.7.0/gems/faraday-1.1.0/lib/faraday/request/basic_authentication.rb
passbase-1.0.3 vendor/bundle/ruby/2.7.0/gems/faraday-1.1.0/lib/faraday/request/basic_authentication.rb