;ELC   
;;; Compiled by aatharuv@cutter-john.mit.edu on Sun Jan  5 18:16:46 2003
;;; from file /afs/sipb.mit.edu/contrib/emacs/packages/w3-4.0pre.47/lisp/url-auth.el
;;; in Emacs version 21.1.1
;;; with bytecomp version 2.85
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.
(if (and (boundp 'emacs-version)
	 (< (aref emacs-version (1- (length emacs-version))) ?A)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`url-auth.el' was compiled for Emacs 19.29 or later"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(byte-code "\300\301!\210\300\302!\207" [require url-vars url-parse] 2)
#@43 String to usefully prompt for a username.
(defalias 'url-auth-user-prompt #[(url realm) "\302\206 \303\304	!\305 \306Z\"\307Q\207" [realm url "Username [for " url-truncate-url-for-viewing url-recreate-url window-width 30 "]: "] 5 (#$ . 718)])
(put 'url-auth-user-prompt 'byte-optimizer 'byte-compile-inline-expand)
#@237 Where usernames and passwords are stored.  Its value is an assoc list of
assoc lists.  The first assoc list is keyed by the server name.  The cdr of
this is an assoc list based on the 'directory' specified by the url we are
looking up.
(defvar url-basic-auth-storage nil (#$ . 1042))
#@375 Get the username/password for the specified URL.
If optional argument PROMPT is non-nil, ask for the username/password
to use for the url and its descendants.  If optional third argument
OVERWRITE is non-nil, overwrite the old username/password pair if it
is found in the assoc list.  If REALM is specified, use that as the realm
instead of the pathname inheritance method.
(defalias 'url-basic-auth #[(url &optional prompt overwrite realm args) ";\203 \306!\202\f \211\307H	\310H\206( 	\311H\203' \312	\313H\"\243\206( \314	\315H\316!\316\"\316#\316$\316%\n\317\fQ&\203K &\202Y \320\321\"\203V \202Y \322!\312\n'\"\243#(\203\250 #\204\250 \323&&\324&\206\202 \325\326!\327 \330Z\"\331Q*\332 \"!)\333!\"\n\334\335\336!\"#!\211$BD'B'\202R#\203O\312#\"\243\211$\204\374 \320\337\"\203\374 #\203\374 $\204\374 #@@%\320\337%\"\203\355 G%GY\203\363 %\313%GO\230\203\363 #@A$#A\211#\204\305 $\204(\204*\203R\323&&\324&\206!\325\326!\327 \330Z\"\331Q*\332 \"!)\333!\"\334\335\336!\"#!$\312\n'\"\211#$B#AB\241\210\202R\316$$\203]\340$P$$.	\207" [url href server url-default-ports port path url-generic-parse-url 3 4 8 assoc 0 "80" 5 nil ":" string-match "/$" url-basepath read-string "Username [for " url-truncate-url-for-viewing url-recreate-url window-width 30 "]: " user-real-login-name "Password: " base64-encode-string format "%s:%s" "/" "Basic " user pass byserv retval data realm url-basic-auth-storage prompt url-passwd-entry-func overwrite] 8 (#$ . 1333)])
#@237 Where usernames and passwords are stored.  Its value is an assoc list of
assoc lists.  The first assoc list is keyed by the server name.  The cdr of
this is an assoc list based on the 'directory' specified by the url we are
looking up.
(defvar url-digest-auth-storage nil (#$ . 2892))
#@47 Create a key for digest authentication method
(defalias 'url-digest-auth-create-key #[(username password realm method uri) ";\203 \306!\202\f \307\n\310\310\f\260!\307\n\310	\311HQ!+D\207" [uri info username realm password a1 url-generic-parse-url md5 ":" 5 method a2] 6 (#$ . 3183)])
#@360 Get the username/password for the specified URL.
If optional argument PROMPT is non-nil, ask for the username/password
to use for the url and its descendants.  If optional third argument
OVERWRITE is non-nil, overwrite the old username/password pair if it
is found in the assoc list.  If REALM is specified, use that as the realm
instead of hostname:portnum.
(defalias 'url-digest-auth #[(url &optional prompt overwrite realm args) "\205\264	;\203 \306	!\202 	\211\307H\n\310H\206, \n\311H\203+ \312\n\313H\f\"\243\206, \314\n\315H&\316'\316(\316)\316*\316+,\203K ,\202\\ \317\320&\"\203X &\202\\ \321&!&\322Q\312-\"\243).\203\273 )\204\273 \323	,,\324,\206\213 \325\326	!\327 \330Z\"\331Q*\332 \"'/\333!(&'\334'(,0\206\253 \335	%B\211*BD-B-\202v)\203s\312&)\"\243\211*\204\317\336&\"\203)\203*\204)@@+\317\336+\"\203&G+GY\203\n+&\313+GO\230\203\n)@A*)A\211)\204\332 *\204.\204\"1\203v\323	,,\324,\2068\325\326	!\327 \330Z\"\331Q*\332 \"'/\333!('\334'(,0\206U\335	%B\211**\312-\"\211)&*B)AB\241\210\202v\316**\205\262\312\337\"\243\206\204\340\312\341\"\243\206\215\34023\342\343*@,3\n\315H\344*A@\3223\322\345*8\260!2&*.	\207" [args url href server url-default-ports port url-generic-parse-url 3 4 8 assoc 0 "80" 5 nil string-match "/$" url-basepath ":" read-string "Username [for " url-truncate-url-for-viewing url-recreate-url window-width 30 "]: " user-real-login-name "Password: " url-digest-auth-create-key "GET" "/" "nonce" "nonegiven" "opaque" format "Digest username=\"%s\", realm=\"%s\",nonce=\"%s\", uri=\"%s\",response=\"%s\", opaque=\"%s\"" md5 2 path user pass byserv retval data realm url-digest-auth-storage prompt url-passwd-entry-func url-request-method overwrite opaque nonce] 14 (#$ . 3489)])
#@105 A list of the registered authorization schemes and various and sundry
information associated with them.
(defvar url-registered-auth-schemes nil (#$ . 5334))
#@1066 Return an authorization string suitable for use in the WWW-Authenticate
header in an HTTP/1.0 request.

URL    is the url you are requesting authorization to.  This can be either a
       string representing the URL, or the parsed representation returned by
       `url-generic-parse-url'
REALM  is the realm at a specific site we are looking for.  This should be a
       string specifying the exact realm, or nil or the symbol 'any' to
       specify that the filename portion of the URL should be used as the
       realm
TYPE   is the type of authentication to be returned.  This is either a string
       representing the type (basic, digest, etc), or nil or the symbol 'any'
       to specify that any authentication is acceptable.  If requesting 'any'
       the strongest matching authentication will be returned.  If this is
       wrong, its no big deal, the error from the server will specify exactly
       what type of auth to use
PROMPT is boolean - specifies whether to ask the user for a username/password
       if one cannot be found in the cache
(defalias 'url-get-authentication #[(url realm type prompt &optional args) "\204\n \306\307	\"\243\n;\203 \310\n!\203 \311=\203' \312\313\314\f\"\315\"\242\243\2079\2030 \316!\306\227\f\"\243\242\211\205T \317!\205T \n\211\205Q \n\320\211	%	%)\207" [realm args url type url-registered-auth-schemes scheme assoc "realm" url-generic-parse-url any sort mapcar #[(scheme) "\303A@!\203 AAA@	\304\211\n$B\207\305\304B\207" [scheme url realm fboundp nil 0] 6] #[(x y) "A\204 \302\207A\203 	A\204 \303\207A\203# 	A\203# @	@Y\207\302\207" [x y nil t] 2] symbol-name fboundp nil prompt] 10 (#$ . 5499)])
#@587 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.
(defalias 'url-register-auth-scheme #[(type &optional function rating) ";\203\n \227\202 9\203 \305!\227\202 \306\307!	\206$ \310\311\312Q!\n\204- \313\2029 \n;\2038 \314\n!\2029 \n\315\"\316	!\204M \317\320\321\322	\"\"\210\f\203Y \f	\nB\241\202b 	\nBBB\211,\207" [type function rating url-registered-auth-schemes node symbol-name error "Bad call to `url-register-auth-scheme'" intern "url-" "-auth" 2 string-to-int assoc fboundp url-warn security format ", but it is not a function!"] 5 (#$ . 7195)])
(defalias 'url-auth-registered #[(scheme) "\302	\"\207" [scheme url-registered-auth-schemes assoc] 3])
(provide 'urlauth)
