From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#36052: 26.2.50; [PATCH] Improve auth-source-pass Date: Thu, 13 Jun 2019 17:23:47 -0400 Message-ID: <85k1dp2n8c.fsf@gmail.com> References: <87o93gjqrw.fsf@cassou.me> <87a7eu2pk5.fsf@gmail.com> <87sgskhydy.fsf@cassou.me> <877e9p45p7.fsf@cassou.me> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="32111"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.92 (windows-nt) Cc: Magnus Henoch , Nicolas Petton , Iku Iwasa , galaunay , Ted Zlatanov , 36052@debbugs.gnu.org, Keith Amidon To: Damien Cassou Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jun 13 23:27:30 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hbXFq-0008C7-Bx for geb-bug-gnu-emacs@m.gmane.org; Thu, 13 Jun 2019 23:27:30 +0200 Original-Received: from localhost ([::1]:45696 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbXFp-000201-Cg for geb-bug-gnu-emacs@m.gmane.org; Thu, 13 Jun 2019 17:27:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47820) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbXCW-0007rT-Iz for bug-gnu-emacs@gnu.org; Thu, 13 Jun 2019 17:24:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hbXCU-0006ex-65 for bug-gnu-emacs@gnu.org; Thu, 13 Jun 2019 17:24:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50924) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hbXCU-0006eK-0a for bug-gnu-emacs@gnu.org; Thu, 13 Jun 2019 17:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hbXCT-0008FC-NE for bug-gnu-emacs@gnu.org; Thu, 13 Jun 2019 17:24:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 13 Jun 2019 21:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36052 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 36052-submit@debbugs.gnu.org id=B36052.156046103531677 (code B ref 36052); Thu, 13 Jun 2019 21:24:01 +0000 Original-Received: (at 36052) by debbugs.gnu.org; 13 Jun 2019 21:23:55 +0000 Original-Received: from localhost ([127.0.0.1]:36235 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hbXCN-0008Er-Ah for submit@debbugs.gnu.org; Thu, 13 Jun 2019 17:23:55 -0400 Original-Received: from mail-io1-f67.google.com ([209.85.166.67]:43205) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hbXCL-0008Ef-M4 for 36052@debbugs.gnu.org; Thu, 13 Jun 2019 17:23:54 -0400 Original-Received: by mail-io1-f67.google.com with SMTP id k20so1093214ios.10 for <36052@debbugs.gnu.org>; Thu, 13 Jun 2019 14:23:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=Ky5JC2gmrxESvreGD/A+3vB9IzNlDCN+ZqHdVpnAm8g=; b=Hgfzxzf97TVNQW8OgEvTPsNbiJQrp1K0opeczeenuAH6EeLAUP+YoQm9wcQCbGH9wA yMxk1vbg/DdO6+0iwkaV1Z8ynVrKtKolkZo9+cJJckqIUNTeyChelwqToS2j3QaY9aub 1Mwb/bn2NmIhkuJnbbA2mcTFhDdO+YkriA/ZzEfF2+XRWnwY8OZw6oD3WdBgFWSgd8/x wQg04t3LbGYiRn9ZmnpqWtaM1+UdtgghlVT2Mh54HlxwtrOktqIbB8urOSwj3MvBt3KO 6NViIjinFoF7ZIMpFt/onPR6wNehJuKzH2JLajXrNUMzj8oUNVn4rMbV/hYVzpEOCdKh btNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=Ky5JC2gmrxESvreGD/A+3vB9IzNlDCN+ZqHdVpnAm8g=; b=ea3CIfLTEmtWs4CVsunY3ffzWb6UmsYUo4g3o2ZS2M4malBLj6p9uHkH8LgbUiogwC woC7cbqCtSb9gQf8xiac83l+HrZfZ+G3y1gF0/V2SjPmOuRkCqxmWwtLNUKBN4MpvgyH aenju92lMY5K0gtxK/kkYyqZgViblTTA72XvOi7wWnujRgqbStokzDvqGgFeg/KMubaG 8q0TxB6xPkSfsBwSm+ksjx2xReHekomGQD/ZlCzbp07z5LoHCYIG6COoixm8MmUuSUoD FwNAt1RnDzM6By70aR+tqLknDLj4DioQ2L9lSzeJ/UjtcACsT8OQdjmOjhiRQe3Mn0Gt XcNA== X-Gm-Message-State: APjAAAUz6crqbOcA0gmRSiv9xbBc83HXbGvb6vHbGRkQ5HsYjz6mrxDC gZf7Q8dqqhGwA3AggN4yq14= X-Google-Smtp-Source: APXvYqx/Cu+U56Y0nnIyzVaTEt/XF5LqnQNTFynnvnG+OJnYOeBBIOcF0wE/BoFxgtDgo9QPn3iIHg== X-Received: by 2002:a6b:b843:: with SMTP id i64mr9794618iof.81.1560461027942; Thu, 13 Jun 2019 14:23:47 -0700 (PDT) Original-Received: from vhost2 (CPE001143542e1f-CMf81d0f809fa0.cpe.net.cable.rogers.com. [99.230.51.196]) by smtp.gmail.com with ESMTPSA id u187sm1601359iod.37.2019.06.13.14.23.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Jun 2019 14:23:47 -0700 (PDT) In-Reply-To: <877e9p45p7.fsf@cassou.me> (Damien Cassou's message of "Thu, 13 Jun 2019 21:59:32 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:160528 Archived-At: Damien Cassou writes: > thank you so much to Eli and Noam for their detailed review. Here is a > new patch series that address every concern received so far. This series > also includes a new patch rewriting the "The Unix password store" > section of auth.texi. A couple more minor points, and some formatting nitpicks. > Subject: [PATCH 04/13] Add auth-source-pass-filename option > +(defcustom auth-source-pass-filename "~/.password-store" > + "Path to the password-store folder." As Eli mentioned, the docstring should say Filename rather than Path too (I guess this got missed/mixed up with my similar point about the variable name). > Subject: [PATCH 10/13] Refactoring of auth-source-pass > > * lisp/auth-source-pass.el (auth-source-pass--find-match): Refactor by > moving some code to auth-source-pass--disambiguate. > (auth-source-pass--disambiguate): > (auth-source-pass--entries-matching-suffix): New function. When you have two or more ChangeLog entries from the same file sharing the same message, don't leave a colon at the end of the blank lines (see also the example in CONTRIBUTE). I.e., this should be (auth-source-pass--disambiguate) (auth-source-pass--entries-matching-suffix): New function. Same for the other entries below. > (auth-source-pass--find-match-unambiguous): > (auth-source-pass--select-from-entries): > (auth-source-pass--entry-reducer): Refactor to simplify and improve > logging. > (auth-source-pass--matching-entries): > (auth-source-pass--accumulate-matches): Remove ^ > * test/lisp/auth-source-pass-tests.el: Complete rewrite to facilitate > maintenance. > (auth-source-pass--have-message-containing): Remove ^ Period at the end of sentence. > (auth-source-pass--have-message-matching): > (auth-source-pass--explain--have-message-matching): > (auth-source-pass--explain-match-entry-p): > (auth-source-pass--includes-sorted-entries): > (auth-source-pass--explain-includes-sorted-entries): > (auth-source-pass--explain-match-any-entry-p): > (auth-source-pass--matching-entries): > (auth-source-pass-match-entry-p): > (auth-source-pass-match-any-entry-p): New function. > Subject: [PATCH 12/13] * etc/NEWS: Describe changes to auth-source-pass > +** auth-source-pass > + > +*** New customizable variable 'auth-source-pass-filename'. > +Allows setting the path to the password-store, defaults to > +~/.password-store. > + > +*** New customizable variable 'auth-source-pass-port-separator'. > +Specifies separator between host and port, defaults to colon ":". I guess these NEWS entries should be marked +++ since you have added text to the manual about them. > +*** Minimize the number of decryptions during password lookup. > +This makes the package usable with physical tokens requiring touching > +a sensor for every decryption. > + > +*** 'auth-source-pass-get' is now autoloaded. And these should have ---. > Subject: [PATCH 13/13] * doc/misc/auth.texi (The Unix password store): > Complete rewrite > --- a/doc/misc/auth.texi > +++ b/doc/misc/auth.texi > @@ -445,19 +445,34 @@ The Unix password store > > @uref{http://www.passwordstore.org,,The standard unix password > manager} (or just @code{pass}) stores your passwords in > +@code{gpg}-protected files following the Unix philosophy. The store ^ Double spacing at the end of sentence. Same for the rest of this patch. > +Emacs integration of @code{pass} follows the approach suggested by the > +pass project itself for data organization to find data. In particular, > +to store a password for the user @code{rms} on the host @code{gnu.org} > +on port @code{22}, you should use one of the following filenames. > +@itemize > +@item @code{"gnu.org.gpg"} : No username or port in the filename means that any username and port will match. > +@item @code{"gnu.org/rms.gpg"} : The username to match can be expressed as filename inside a directory whose name matches the host. This is useful if the store has passwords for several users on the same host. > +@item @code{"rms@@gnu.org.gpg"} : The username can also be expressed as a prefix, separated from the host with an at-sign (@code{@@}). > +@item @code{"gnu.org:22.gpg"} : The port (aka. service) to match can only be expressed after the host and separated with a colon (@code{:}). The separator can be changed through the @code{auth-source-pass-port-separator} variable. > +If several entries match, the one matching the most is > +preferred. "the most" meaning highest number of matching items (where an "item" is one of username, port or filename)? The current wording could be understood as "longest match" (counting characters) which I don't think is what you meant.