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: Sat, 08 Jun 2019 18:38:43 -0400 Message-ID: <87tvcz1z4c.fsf@gmail.com> References: <87o93gjqrw.fsf@cassou.me> <87a7eu2pk5.fsf@gmail.com> <87sgskhydy.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="232390"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) 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 Sun Jun 09 00:39:12 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 1hZjzT-000yKa-S2 for geb-bug-gnu-emacs@m.gmane.org; Sun, 09 Jun 2019 00:39:12 +0200 Original-Received: from localhost ([::1]:60938 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZjzR-0005DQ-RG for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 Jun 2019 18:39:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50048) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZjzL-0005D7-Lm for bug-gnu-emacs@gnu.org; Sat, 08 Jun 2019 18:39:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hZjzK-0005XB-F3 for bug-gnu-emacs@gnu.org; Sat, 08 Jun 2019 18:39:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40318) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hZjzK-0005Wn-9Z for bug-gnu-emacs@gnu.org; Sat, 08 Jun 2019 18:39:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hZjzJ-0005uf-RD for bug-gnu-emacs@gnu.org; Sat, 08 Jun 2019 18:39: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: Sat, 08 Jun 2019 22:39: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.156003353322714 (code B ref 36052); Sat, 08 Jun 2019 22:39:01 +0000 Original-Received: (at 36052) by debbugs.gnu.org; 8 Jun 2019 22:38:53 +0000 Original-Received: from localhost ([127.0.0.1]:53862 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hZjzB-0005uH-Ea for submit@debbugs.gnu.org; Sat, 08 Jun 2019 18:38:53 -0400 Original-Received: from mail-io1-f45.google.com ([209.85.166.45]:34495) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hZjz8-0005u2-W5 for 36052@debbugs.gnu.org; Sat, 08 Jun 2019 18:38:51 -0400 Original-Received: by mail-io1-f45.google.com with SMTP id k8so4176561iot.1 for <36052@debbugs.gnu.org>; Sat, 08 Jun 2019 15:38:50 -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=JQXmQdO9/0I0U/aTKg60OniT58QI80Zss5PjRLgohy8=; b=EwY9sl82XyP4TQOReVAaLEYDl+P2Tub003D6H8AUprPbbqGYwW5yHGNGq7TNAXJ3sO yymZoARO5Q3r30n7pajagBw1Y5JlgkeGUGjSvLPZeOrTFX8YsKVL5ROs++rnpMnoA64B 6XtSP+gQLUs3OzxCMXGZGMm6FnH/NE+qVFXe58uYsM5wAqYbQOuKDRmVWg8JYRNywtJ8 IFzLjGWw6sHi/ykKY4jU75v+azVmdTHBHjBxrjm2aQ4qGkzw55pwjituWODJUVWj2q2N 5++xL0/pMyeM+R50/WZ4PMSwh6k/rfsvpOaptG28Y4ZdBnNZKMDbRK6BK3XarR3Twk+/ 0Brw== 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=JQXmQdO9/0I0U/aTKg60OniT58QI80Zss5PjRLgohy8=; b=BNUoeNL3i7IUpa95jgWsDfvP+zQuEaXndJ92HYDPQ8qGxplwWGdn/eyqtb75I3FT5T iZlAfZxMmCx/XiLrD/OsjiS4ZPjzQELKXpsc2+4jb5YHIVMAM1BJUWmPU5956866pVel fb+Oc1fvjNGBzURFRLk8E9+0n7NLBDaBMllYWZ3HirQ96WUNvUUYdPi1jGYZBlJ6aVqc Ck1p1jGbEBGqPh+SLH8LaJZB6SUKiAeClakx9dBLlNk8ZuckziQ/KFrdeuq7rPdqBm7m 7O6u/STOD4OXrg/A+6b+a3JiUxdn7WEStMnF3BsKZbw7uteQG2zbHLizWJMLeSa8E8iM UVVA== X-Gm-Message-State: APjAAAWaOsw6IV1np6dwji6LRewNZdTWBePyY63omUMq77HANynAMn3u 6Td9zJxYYXgoj3lD//c9irc= X-Google-Smtp-Source: APXvYqxiofqT66nalzmE2vlvSt1dgOFMajYx4HejvDljpmmGRFASHIRXfO46PiCJxkp8/IUTAqzBfA== X-Received: by 2002:a6b:4107:: with SMTP id n7mr6236867ioa.12.1560033525230; Sat, 08 Jun 2019 15:38:45 -0700 (PDT) Original-Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.gmail.com with ESMTPSA id z17sm2148103iol.73.2019.06.08.15.38.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 08 Jun 2019 15:38:44 -0700 (PDT) In-Reply-To: <87sgskhydy.fsf@cassou.me> (Damien Cassou's message of "Sat, 08 Jun 2019 17:47:53 +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:160247 Archived-At: Damien Cassou writes: >> >> Double spacing, and this ChangeLog entry is a little sparse. It looks >> like the last two prose paragraphs could be easily made into ChangeLog >> entries, since they're already talking about specific functions. > > > I thought about doing that as well but didn't. If you insist, I will do > the requested changes but here are my reasons for not doing it right > away: > > - The changes are on private methods (with the "--" naming convention) > and I'm not sure how much of private changes should be in the > ChangeLog. AFAIK, we don't keep "private" functions out of the ChangeLog. Same with even more internal C functions. > - The commit message you mention modifies functions that are modified > again by a later patch (named "Refactoring of auth-source-pass"). I > usually only send the latest version of my code and not the whole > history but, this time, I'm not the author of the original version and > I believe the author deserves to have his name in Emacs' git history > because of the massive work he did for the package. > > - I have tried not to rewrite too much of contributor's code and text in > their own commit so that the authorship makes sense. I have no problem > changing contributions in a later commit though (as I've shown in the > patch "Refactoring of auth-source-pass"). Sure that make sense, but I think the commit message only needs some pretty minor formatting (although it seems that the original patch message has a typo in the function name mentioned, it should be auth-source-pass--matching-entries rather than auth-source-pass--applicable-entries), e.g., just change the last two paragraphs into: This commit implements that strategy. It is in spirit a refactor of the existing code. * lisp/auth-source-pass.el (auth-source-pass--matching-entries): New function, generate an ordered list of regular expression matchers for all possible names that could be in the password-store for the entry to be found and then makes a pass over the password-store entry names accumulating the matching entries in a list after the regexp that matched. This implementation ensures the password-store entry list still only has to be scanned once. (auth-source-pass--find-match-unambiguous): Use it to obtain candidate entries and then parse them one by one until an entry containing the desired information is located. When complete, return the parsed data of the entry instead of the entry name so that the information can be used directly to construct the auth-source response. and then at least mention the other functions: (auth-source-pass--build-result): Update accordingly. (auth-source-pass--select-one-entry) (auth-source-pass--entry-valid-p) (auth-source-pass--find-all-by-entry-name) (auth-source-pass--find-one-by-entry-name): Remove. (auth-source-pass--select-from-entries) (auth-source-pass--accumulate-matches) (auth-source-pass--entry-reducer) (auth-source-pass--generate-entry-suffixes) (auth-source-pass--domains) (auth-source-pass--name-port-user-suffixes): New functions.