Sha256: a5706afecbc21da98612aa2fe3abbafd0ca1ada6a1a20832e3cbbcdae953e957

Contents?: true

Size: 572 Bytes

Versions: 67

Compression:

Stored size: 572 Bytes

Contents

# frozen_string_literal: true

require "net/http"

module Gemsmith
  module Authenticators
    # An authenticator for retrieving HTTP Basic authorization.
    class Basic
      def self.url
        ""
      end

      def initialize login, password, encrypter: Net::HTTP::Get.new("https://ignore.example.com")
        @login = login
        @password = password
        @encrypter = encrypter
      end

      def authorization
        encrypter.basic_auth(login, password).first
      end

      private

      attr_reader :login, :password, :encrypter
    end
  end
end

Version data entries

67 entries across 67 versions & 1 rubygems

Version Path
gemsmith-12.0.0 lib/gemsmith/authenticators/basic.rb
gemsmith-11.3.0 lib/gemsmith/authenticators/basic.rb
gemsmith-11.2.0 lib/gemsmith/authenticators/basic.rb
gemsmith-11.1.0 lib/gemsmith/authenticators/basic.rb
gemsmith-11.0.1 lib/gemsmith/authenticators/basic.rb
gemsmith-11.0.0 lib/gemsmith/authenticators/basic.rb
gemsmith-10.4.2 lib/gemsmith/authenticators/basic.rb
gemsmith-10.4.1 lib/gemsmith/authenticators/basic.rb
gemsmith-10.4.0 lib/gemsmith/authenticators/basic.rb
gemsmith-10.3.0 lib/gemsmith/authenticators/basic.rb
gemsmith-10.2.0 lib/gemsmith/authenticators/basic.rb
gemsmith-10.1.0 lib/gemsmith/authenticators/basic.rb
gemsmith-10.0.0 lib/gemsmith/authenticators/basic.rb
gemsmith-9.6.0 lib/gemsmith/authenticators/basic.rb
gemsmith-9.5.0 lib/gemsmith/authenticators/basic.rb
gemsmith-9.4.0 lib/gemsmith/authenticators/basic.rb
gemsmith-9.3.0 lib/gemsmith/authenticators/basic.rb
gemsmith-9.2.0 lib/gemsmith/authenticators/basic.rb
gemsmith-9.1.0 lib/gemsmith/authenticators/basic.rb
gemsmith-9.0.0 lib/gemsmith/authenticators/basic.rb