all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* url-basic-auth -- default user/password prompt to values from URL
@ 2007-08-04  3:30 Edward O'Connor
  0 siblings, 0 replies; only message in thread
From: Edward O'Connor @ 2007-08-04  3:30 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 735 bytes --]

Hi all,

I've been hacking a bit on some code that uses url.el to talk to a
website which uses HTTP Basic authentication. I'm specifying the
username/password combination in the URL itself, and yet
`url-basic-auth' prompts me for my username and password.

Fixing that looks potentially complicated, so I thought an incremental
improvement would be for the prompts to pre-populate with the URL's
username/password combo. A patch is attached that does just that. It
would be great if this made it in before 22.2.

Here's a ChangeLog entry:

2007-08-04  Edward O'Connor  <hober0@gmail.com>

        * url/url-auth.el (url-basic-auth): When prompting for username
          and password, default to the username and password in the URL.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: default user/password prompt to values from URL --]
[-- Type: text/x-patch, Size: 996 bytes --]

cvs diff: Diffing .
Index: url-auth.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/url/url-auth.el,v
retrieving revision 1.14
diff -u -r1.14 url-auth.el
--- url-auth.el	26 Jul 2007 05:27:36 -0000	1.14
+++ url-auth.el	4 Aug 2007 03:18:35 -0000
@@ -68,7 +68,9 @@
 	 (server (url-host href))
 	 (port (url-port href))
 	 (path (url-filename href))
-	 user pass byserv retval data)
+         (user (url-user href))
+         (pass (url-password href))
+         byserv retval data)
     (setq server (format "%s:%d" server port)
 	  path (cond
 		(realm realm)
@@ -79,8 +81,8 @@
     (cond
      ((and prompt (not byserv))
       (setq user (read-string (url-auth-user-prompt url realm)
-			      (user-real-login-name))
-	    pass (read-passwd "Password: "))
+			      (or user (user-real-login-name)))
+	    pass (read-passwd "Password: " nil (or pass "")))
       (set url-basic-auth-storage
 	   (cons (list server
 		       (cons path

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-08-04  3:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-04  3:30 url-basic-auth -- default user/password prompt to values from URL Edward O'Connor

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.