lib/httpi/auth/config.rb in httpi-0.7.9 vs lib/httpi/auth/config.rb in httpi-0.8.0
- old
+ new
@@ -8,11 +8,11 @@
# Manages HTTP and SSL auth configuration. Currently supports HTTP basic/digest
# and SSL client authentication.
class Config
# Supported authentication types.
- TYPES = [:basic, :digest, :ssl]
+ TYPES = [:basic, :digest, :ssl, :ntlm]
# Accessor for the HTTP basic auth credentials.
def basic(*args)
return @basic if args.empty?
@@ -39,9 +39,22 @@
end
# Returns whether to use HTTP basic or dihest auth.
def http?
type == :basic || type == :digest
+ end
+
+ # Accessor for the NTLM auth credentials.
+ def ntlm(*args)
+ return @ntlm if args.empty?
+
+ self.type = :ntlm
+ @ntlm = args.flatten.compact
+ end
+
+ # Returns whether to use NTLM auth.
+ def ntlm?
+ type == :ntlm
end
# Returns the <tt>HTTPI::Auth::SSL</tt> object.
def ssl
@ssl ||= SSL.new