lib/httpx/plugins/basic_authentication.rb in httpx-0.13.2 vs lib/httpx/plugins/basic_authentication.rb in httpx-0.14.0
- old
+ new
@@ -6,12 +6,17 @@
# This plugin adds helper methods to implement HTTP Basic Auth (https://tools.ietf.org/html/rfc7617)
#
# https://gitlab.com/honeyryderchuck/httpx/wikis/Authentication#basic-authentication
#
module BasicAuthentication
- def self.load_dependencies(klass)
- require "base64"
- klass.plugin(:authentication)
+ class << self
+ def load_dependencies(_klass)
+ require "base64"
+ end
+
+ def configure(klass)
+ klass.plugin(:authentication)
+ end
end
module InstanceMethods
def basic_authentication(user, password)
authentication("Basic #{Base64.strict_encode64("#{user}:#{password}")}")