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
faraday-1.10.4 lib/faraday/request/basic_authentication.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/faraday-1.2.0/lib/faraday/request/basic_authentication.rb
avalara_sdk-24.2.29 vendor/bundle/ruby/2.7.0/gems/faraday-1.10.3/lib/faraday/request/basic_authentication.rb
faraday-1.10.3 lib/faraday/request/basic_authentication.rb
faraday-1.10.2 lib/faraday/request/basic_authentication.rb
faraday-1.10.1 lib/faraday/request/basic_authentication.rb
alloy_sdk-0.1.0 vendor/bundle/ruby/3.0.0/gems/faraday-1.0.1/lib/faraday/request/basic_authentication.rb
op_connect-0.1.2 vendor/bundle/ruby/3.1.0/gems/faraday-1.10.0/lib/faraday/request/basic_authentication.rb
plaid-14.13.0 vendor/bundle/ruby/3.0.0/gems/faraday-1.10.0/lib/faraday/request/basic_authentication.rb
tdiary-5.2.1 vendor/bundle/ruby/3.1.0/gems/faraday-1.10.0/lib/faraday/request/basic_authentication.rb
faraday-1.10.0 lib/faraday/request/basic_authentication.rb
plaid-14.12.1 vendor/bundle/ruby/3.0.0/gems/faraday-1.9.3/lib/faraday/request/basic_authentication.rb
plaid-14.12.0 vendor/bundle/ruby/2.6.0/gems/faraday-1.8.0/lib/faraday/request/basic_authentication.rb
plaid-14.12.0 vendor/bundle/ruby/2.6.0/gems/faraday-1.9.3/lib/faraday/request/basic_authentication.rb
plaid-14.11.1 vendor/bundle/ruby/2.6.0/gems/faraday-1.9.3/lib/faraday/request/basic_authentication.rb
faraday-1.9.3 lib/faraday/request/basic_authentication.rb
faraday-1.9.2 lib/faraday/request/basic_authentication.rb
faraday-1.9.1 lib/faraday/request/basic_authentication.rb
faraday-1.9.0 lib/faraday/request/basic_authentication.rb
plaid-14.10.0 vendor/bundle/ruby/2.6.0/gems/faraday-1.8.0/lib/faraday/request/basic_authentication.rb