Sha256: ad129a4b32a19a05c46ecfcf9a8e20b11f9e51a7108b00697f132995911fb484

Contents?: true

Size: 376 Bytes

Versions: 20

Compression:

Stored size: 376 Bytes

Contents

# frozen_string_literal: true

require "httpx/base64"

module HTTPX
  module Plugins
    module Authentication
      class Basic
        def initialize(user, password, **)
          @user = user
          @password = password
        end

        def authenticate(*)
          "Basic #{Base64.strict_encode64("#{@user}:#{@password}")}"
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
httpx-1.3.4 lib/httpx/plugins/auth/basic.rb
httpx-1.3.3 lib/httpx/plugins/auth/basic.rb
httpx-1.3.2 lib/httpx/plugins/auth/basic.rb
httpx-1.3.1 lib/httpx/plugins/auth/basic.rb
httpx-1.3.0 lib/httpx/plugins/auth/basic.rb
httpx-1.2.6 lib/httpx/plugins/auth/basic.rb
httpx-1.2.4 lib/httpx/plugins/auth/basic.rb
httpx-1.2.3 lib/httpx/plugins/auth/basic.rb
httpx-1.2.2 lib/httpx/plugins/auth/basic.rb
httpx-1.2.1 lib/httpx/plugins/auth/basic.rb
httpx-1.2.0 lib/httpx/plugins/auth/basic.rb
httpx-1.1.5 lib/httpx/plugins/auth/basic.rb
httpx-1.1.4 lib/httpx/plugins/auth/basic.rb
httpx-1.1.3 lib/httpx/plugins/auth/basic.rb
httpx-1.1.2 lib/httpx/plugins/auth/basic.rb
httpx-1.1.1 lib/httpx/plugins/auth/basic.rb
httpx-1.1.0 lib/httpx/plugins/auth/basic.rb
httpx-1.0.2 lib/httpx/plugins/auth/basic.rb
httpx-1.0.1 lib/httpx/plugins/auth/basic.rb
httpx-1.0.0 lib/httpx/plugins/auth/basic.rb