From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [PATCH 1/2] Refactor digest authentication in url-auth Date: Mon, 14 Nov 2016 05:42:06 +0200 Message-ID: <83d1hyiv75.fsf@gnu.org> References: <1478988194-7761-1-git-send-email-jarno@malmari.fi> <1479036981-22047-1-git-send-email-jarno@malmari.fi> <1479036981-22047-2-git-send-email-jarno@malmari.fi> <83d1hzcr5r.fsf@gnu.org> <87shqvqc0b.fsf@malmari.fi> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1479094989 12189 195.159.176.226 (14 Nov 2016 03:43:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 14 Nov 2016 03:43:09 +0000 (UTC) Cc: emacs-devel@gnu.org To: Jarno Malmari Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 14 04:43:00 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c68A9-0006t8-M9 for ged-emacs-devel@m.gmane.org; Mon, 14 Nov 2016 04:42:29 +0100 Original-Received: from localhost ([::1]:36083 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c68AC-00014p-IY for ged-emacs-devel@m.gmane.org; Sun, 13 Nov 2016 22:42:32 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c689g-00014Q-Lu for emacs-devel@gnu.org; Sun, 13 Nov 2016 22:42:01 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c689d-00030g-IZ for emacs-devel@gnu.org; Sun, 13 Nov 2016 22:42:00 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57804) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c689d-00030R-DH; Sun, 13 Nov 2016 22:41:57 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1568 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1c689c-0005tv-2l; Sun, 13 Nov 2016 22:41:56 -0500 In-reply-to: <87shqvqc0b.fsf@malmari.fi> (message from Jarno Malmari on Sun, 13 Nov 2016 23:57:08 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:209378 Archived-At: > From: Jarno Malmari > Cc: emacs-devel@gnu.org > Date: Sun, 13 Nov 2016 23:57:08 +0200 > > > * lisp/url/url-auth.el (url-digest-auth, url-digest-auth-create-key): > > (url-digest-auth-build-response, url-digest-auth-directory-id-assoc) > > (url-digest-auth-name-value-string, url-digest-auth-source-creds) > > (url-digest-cached-key, url-digest-cache-key, url-digest-find-creds) > > (url-digest-find-new-key, url-digest-prompt-creds): Add new functions to > > simplify code and aid in unit testing. > > > > IOW, each line begins is separately parenthesized. > > Will fix. Seems I wasn't able to deduce the correct format from previous > log entries nor from the CONTRIBUTE file. Is this format obvious to > others? Should the "each line separately parenthesized" be described in > the CONTRIBUTE file? CONTRIBUTE says to use ChangeLog commands, like "C-x 4 a", to add the entries. Those commands produce the above format automatically. > >> +(defun url-digest-auth-directory-id-assoc (dirkey keylist) > >> + "Find the best match in key list using a path or a realm. > >> + > >> +The string DIRKEY is either a path or a realm. The key list to > >> +search through is the alist KEYLIST where car of each element is > >> +either a path or a realm. Realms are searched for an exact > >> +match. For paths, an ancestor is sufficient for a match." > > > > GNU coding standards frown on using "path" for anything but PATH-style > > directory lists. Please use "file name" or "directory name" instead. > > Good to know. Is there a convention to indicate path part in URIs? Not that I know of. I'd use "file-name part". > >> + ;; no partial matches for non-path, i.e. realm > >> + (and (string-match "/" dirkey) > > > > This will fail with Windows file names that use backslashes. > > We're actually not talking about file system paths. We're talking about > paths (directory names?) in URIs which define, together with realm, the > "protection space" (see RFC2617 ;)). Ah, okay. In that case, this should be described in more detail, I think. Note that there's also an Info manual for the URL package. > >> + ;; if incomplete and prompt allowed, prompt the user > > > > Comments should begin with a capital letter and end with a period, as > > normal sentences are (here and elsewhere in the patch). > > Does that implicitly mean that each comment should be a complete > sentence? Yes, preferably. Thanks.