lib/httpi/auth/config.rb in httpi-2.0.2 vs lib/httpi/auth/config.rb in httpi-2.1.0
- old
+ new
@@ -8,11 +8,11 @@
# Manages HTTP and SSL auth configuration. Currently supports HTTP basic/digest,
# Negotiate/SPNEGO, and SSL client authentication.
class Config
# Supported authentication types.
- TYPES = [:basic, :digest, :gssnegotiate, :ssl]
+ TYPES = [:basic, :digest, :gssnegotiate, :ssl, :ntlm]
# Accessor for the HTTP basic auth credentials.
def basic(*args)
return @basic if args.empty?
@@ -51,17 +51,18 @@
# Returns whether to use HTTP basic or dihest auth.
def http?
type == :basic || type == :digest
end
- # Only available with the httpi-ntlm gem.
def ntlm(*args)
- raise "Install the httpi-ntlm gem for experimental NTLM support"
+ return @ntlm if args.empty?
+
+ self.type = :ntlm
+ @ntlm = args.flatten.compact
end
- # Only available with the httpi-ntlm gem.
def ntlm?
- raise "Install the httpi-ntlm gem for experimental NTLM support"
+ type == :ntlm
end
# Returns the <tt>HTTPI::Auth::SSL</tt> object.
def ssl
@ssl ||= SSL.new