Manages HTTP and SSL auth configuration. Currently supports HTTP basic/digest and SSL client authentication.
Supported authentication types.
Accessor for the HTTP basic auth credentials.
# File lib/httpi/auth/config.rb, line 16 def basic(*args) return @basic if args.empty? self.type = :basic @basic = args.flatten.compact end
Returns whether to use HTTP basic auth.
# File lib/httpi/auth/config.rb, line 24 def basic? type == :basic end
Shortcut method for returning the credentials for the authentication specified. Returns nil unless any authentication credentials were specified.
# File lib/httpi/auth/config.rb, line 68 def credentials return unless type send type end
Accessor for the HTTP digest auth credentials.
# File lib/httpi/auth/config.rb, line 29 def digest(*args) return @digest if args.empty? self.type = :digest @digest = args.flatten.compact end
Returns whether to use HTTP digest auth.
# File lib/httpi/auth/config.rb, line 37 def digest? type == :digest end
Returns whether to use HTTP basic or dihest auth.
# File lib/httpi/auth/config.rb, line 42 def http? type == :basic || type == :digest end
Only available with the httpi-ntlm gem.
# File lib/httpi/auth/config.rb, line 47 def ntlm(*args) raise "Install the httpi-ntlm gem for experimental NTLM support" end
Only available with the httpi-ntlm gem.
# File lib/httpi/auth/config.rb, line 52 def ntlm? raise "Install the httpi-ntlm gem for experimental NTLM support" end
Returns the HTTPI::Auth::SSL object.
# File lib/httpi/auth/config.rb, line 57 def ssl @ssl ||= SSL.new end
Returns whether to use SSL client auth.
# File lib/httpi/auth/config.rb, line 62 def ssl? ssl.present? end
Generated with the Darkfish Rdoc Generator 2.