Function: url-register-auth-scheme
url-register-auth-scheme is an autoloaded and byte-compiled function
defined in url-auth.el.gz.
Signature
(url-register-auth-scheme TYPE &optional FUNCTION RATING)
Documentation
Register an HTTP authentication method.
TYPE is a string or symbol specifying the name of the method.
This should be the same thing you expect to get returned in
an Authenticate header in HTTP/1.0 - it will be downcased.
FUNCTION is the function to call to get the authorization information.
This defaults to url-?-auth, where ? is TYPE.
RATING a rating between 1 and 10 of the strength of the authentication.
This is used when asking for the best authentication for a specific
URL. The item with the highest rating is returned.
Source Code
;; Defined in /usr/src/emacs/lisp/url/url-auth.el.gz
;;;###autoload
(defun url-register-auth-scheme (type &optional function rating)
"Register an HTTP authentication method.
TYPE is a string or symbol specifying the name of the method.
This should be the same thing you expect to get returned in
an Authenticate header in HTTP/1.0 - it will be downcased.
FUNCTION is the function to call to get the authorization information.
This defaults to `url-?-auth', where ? is TYPE.
RATING a rating between 1 and 10 of the strength of the authentication.
This is used when asking for the best authentication for a specific
URL. The item with the highest rating is returned."
(let* ((type (cond
((stringp type) (downcase type))
((symbolp type) (downcase (symbol-name type)))
(t (error "Bad call to `url-register-auth-scheme'"))))
(function (or function (intern (concat "url-" type "-auth"))))
(rating (cond
((null rating) 2)
((stringp rating) (string-to-number rating))
(t rating)))
(node (assoc type url-registered-auth-schemes)))
(if (not (fboundp function))
(display-warning
'security
(format-message
"Tried to register `%s' as an auth scheme, but it is not a function!"
function)))
(if node
(setcdr node (cons function rating))
(setq url-registered-auth-schemes
(cons (cons type (cons function rating))
url-registered-auth-schemes)))))