From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Jarno Malmari Newsgroups: gmane.emacs.devel Subject: Re: Refactor digest authentication in url-auth Date: Mon, 27 Mar 2017 22:47:25 +0300 Message-ID: <1490644047-24049-1-git-send-email-jarno@malmari.fi> References: <8360jgdt1p.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1490644185 14924 195.159.176.226 (27 Mar 2017 19:49:45 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 27 Mar 2017 19:49:45 +0000 (UTC) Cc: emacs-devel@gnu.org To: eliz@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 27 21:49:40 2017 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 1csae1-000381-O4 for ged-emacs-devel@m.gmane.org; Mon, 27 Mar 2017 21:49:38 +0200 Original-Received: from localhost ([::1]:48682 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1csae7-0006jl-H5 for ged-emacs-devel@m.gmane.org; Mon, 27 Mar 2017 15:49:43 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58575) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1csadG-0006je-1G for emacs-devel@gnu.org; Mon, 27 Mar 2017 15:48:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1csadF-0007Ce-4g for emacs-devel@gnu.org; Mon, 27 Mar 2017 15:48:50 -0400 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:45050) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1csadB-00079v-05; Mon, 27 Mar 2017 15:48:45 -0400 Original-Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 4F43920C71; Mon, 27 Mar 2017 15:48:43 -0400 (EDT) Original-Received: from frontend2 ([10.202.2.161]) by compute7.internal (MEProxy); Mon, 27 Mar 2017 15:48:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=malmari.fi; h=cc :date:from:in-reply-to:message-id:references:references:subject :to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=GZW H1YpKx5RpDUUxFV1ubiIku02c94EuDppATgxtDf4=; b=QAV8tklhqKjBiBwUuVQ xdAZh8ioIrZpyBj9HtbJR+BABIbj2ja9dVq++0eyyPgciPX3ZmJSwLfy3gdLkTQI xMIABBNyhGXfIc/A4WFKHf5hJTpuLHlsfExGEWfWau0joPq/g7Xejf5+9j5b55oA 2vsC7t6+13nn19F300lVVMD6/UF86VUOge3lc2Ye2/360VFixUKe7BonFP9WXUU5 9TtCy+YGEsa3z1mepD/B9oec5heto3c5lvckFx8iA02+I/+G4Rkr3qAph8cc5NSO Jqg5AFrlQWfDbxoZRMbZkHc4wDqdOoqQ5kv2s4QPJI93ctDjdPwH3wpEa9cJYNf3 XlA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:references:subject:to:x-me-sender:x-me-sender :x-sasl-enc:x-sasl-enc; s=fm1; bh=GZWH1YpKx5RpDUUxFV1ubiIku02c94 EuDppATgxtDf4=; b=kTXL8N65iUoaNfkPcnSmzql9pvbiKJfzx9Uv92vop/Ea06 C1GTPBWH5EiXmwwaukXYl/xTfb12neLPwUwwcAXOeIphoOzzvuIv4HsdcjT69x6U gS0saRI9/zTAbJrx+1ofIWW7mJt3AQEJsvdEsfi8aigHDBB3r4S/AYDTCy+C/Twd fUtNUvBDB+tsVtTqBHWbQQ4uVXF4/cnIRYIKEK9xzuzc3mNL6LCBepq55/av4A80 d/8w7RN1sRB49OWRy2EkK3ebDAe/vWyYaWQRTiT/zX3TvwpfofcrcX7yr7bdoNgZ pOlzlv5fKncdvpLFqr5uDNcVddqpKMebatQp0FVQ== X-ME-Sender: X-Sasl-enc: QL0D/y+zrX/iVXzo6Nx779PZWytu0PgamOUS2RyoxDiw 1490644122 Original-Received: from vabi.peto.intranet (a88-113-156-118.elisa-laajakaista.fi [88.113.156.118]) by mail.messagingengine.com (Postfix) with ESMTPA id 9FD4E24731; Mon, 27 Mar 2017 15:48:42 -0400 (EDT) X-Mailer: git-send-email 2.7.0.25.gfc10eb5 In-Reply-To: <8360jgdt1p.fsf@gnu.org> Original-References: <1487106777-17025-1-git-send-email-jarno@malmari.fi> <834lzrrbwu.fsf@gnu.org> <837f4esla4.fsf@gnu.org> <87r32bhg86.fsf@vabi> <8360jgdt1p.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.25 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:213429 Archived-At: > Since no one seems to be interested to review this patch, I did that > myself. I have two comments: > > > +(defun url-digest-auth-build-response (key url realm attrs) > > + "Compute authorization string for the given challenge using KEY. > > + > > +The strings looks like 'Digest username=\"John\", realm=\"The > > +Realm\", ...' > > Typo: should be "look", not "looks". I decided the typo is in the plural form of "strings" since it describes the single return value. Fixed. > > > +(defun url-digest-find-new-key (url realm prompt) > > + "Find new key either from auth-source or interactively. > > +The key is looked for based on URL and REALM. If PROMPT is > > +non-nil, ask interactively in case credentials weren't found from > > +auth-source." > > This function's doc string looks strikingly different from the rest of > the functions you wrote: not as detailed and clear as the rest. Can > you rework it to be more in line with the rest of the functions? Revised content: (defun url-digest-find-new-key (url realm prompt) "Find credentials and create a new authorization key for given URL and REALM. Return value is the new key, or nil if credentials weren't found. \"New\" in this context means a key that's not yet found in cache variable `url-digest-auth-storage'. You may use `url-digest-cache-key' to put it there. This function uses `url-digest-find-creds' to find the credentials. It first looks in auth-source. If not found, and PROMPT is non-nil, user is asked for credentials interactively via minibuffer." > > With those minor issues fixed, I will push your changes. Thanks! Update patches follow this mail.