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-15.5.0 lib/gemsmith/authenticators/basic.rb
gemsmith-15.4.0 lib/gemsmith/authenticators/basic.rb
gemsmith-15.3.0 lib/gemsmith/authenticators/basic.rb
gemsmith-15.2.0 lib/gemsmith/authenticators/basic.rb
gemsmith-15.1.1 lib/gemsmith/authenticators/basic.rb
gemsmith-15.1.0 lib/gemsmith/authenticators/basic.rb
gemsmith-15.0.0 lib/gemsmith/authenticators/basic.rb
gemsmith-14.11.0 lib/gemsmith/authenticators/basic.rb
gemsmith-14.10.1 lib/gemsmith/authenticators/basic.rb
gemsmith-14.10.0 lib/gemsmith/authenticators/basic.rb
gemsmith-14.9.0 lib/gemsmith/authenticators/basic.rb
gemsmith-14.8.0 lib/gemsmith/authenticators/basic.rb
gemsmith-14.7.0 lib/gemsmith/authenticators/basic.rb
gemsmith-14.6.0 lib/gemsmith/authenticators/basic.rb
gemsmith-14.5.0 lib/gemsmith/authenticators/basic.rb
gemsmith-14.4.0 lib/gemsmith/authenticators/basic.rb
gemsmith-14.3.0 lib/gemsmith/authenticators/basic.rb
gemsmith-14.2.0 lib/gemsmith/authenticators/basic.rb
gemsmith-14.1.3 lib/gemsmith/authenticators/basic.rb
gemsmith-14.1.2 lib/gemsmith/authenticators/basic.rb