From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Bj=C3=B6rn?= Bidar via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs,gmane.emacs.erc.general Subject: bug#58985: 29.0.50; Have auth-source-pass behave more like other back ends Date: Thu, 10 Nov 2022 15:40:45 +0200 Message-ID: <87cz9vhqqq.fsf@thaodan.de> References: <87wn8cb0ym.fsf@neverwas.me> <874jvdardn.fsf__3771.40490324877$1667692584$gmane$org@neverwas.me> <87pme09vis.fsf@gmx.de> <87a653z7dl.fsf@neverwas.me> <874jvbnje1.fsf@gmx.de> <875yfpmtwb.fsf__40235.4477484309$1667915906$gmane$org@neverwas.me> <87o7tfiqws.fsf@thaodan.de> <875yfnnzy6.fsf@neverwas.me> Reply-To: =?UTF-8?Q?Bj=C3=B6rn?= Bidar Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21083"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Damien Cassou , emacs-erc@gnu.org, Michael Albinus , 58985@debbugs.gnu.org To: "J.P." Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 10 14:41:14 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ot7nu-0005Iu-9V for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Nov 2022 14:41:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ot7nl-0006xX-55; Thu, 10 Nov 2022 08:41:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ot7nj-0006xP-6W for bug-gnu-emacs@gnu.org; Thu, 10 Nov 2022 08:41:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ot7ni-0000rC-UB for bug-gnu-emacs@gnu.org; Thu, 10 Nov 2022 08:41:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ot7ni-0002f8-CB for bug-gnu-emacs@gnu.org; Thu, 10 Nov 2022 08:41:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Bj=C3=B6rn?= Bidar Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 10 Nov 2022 13:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58985 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 58985-submit@debbugs.gnu.org id=B58985.166808765410213 (code B ref 58985); Thu, 10 Nov 2022 13:41:02 +0000 Original-Received: (at 58985) by debbugs.gnu.org; 10 Nov 2022 13:40:54 +0000 Original-Received: from localhost ([127.0.0.1]:42274 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ot7na-0002ef-9O for submit@debbugs.gnu.org; Thu, 10 Nov 2022 08:40:54 -0500 Original-Received: from thaodan.de ([185.216.177.71]:51238) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ot7nV-0002eQ-8X for 58985@debbugs.gnu.org; Thu, 10 Nov 2022 08:40:52 -0500 Original-Received: from odin (dsl-trebng12-b04885-76.dhcp.inet.fi [176.72.133.76]) by thaodan.de (Postfix) with ESMTPSA id C1274D02507; Thu, 10 Nov 2022 15:40:45 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=thaodan.de; s=mail; t=1668087646; bh=ClUfdwta2r6/D6NyOQAnhVtcepJgZmhMOQABah2YRlo=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=FvXkk0FKmzGv139mJx3YLGXN9C3mDG/alEeMhGyC+ZHSpnJmRShDt4wY3KZnMY/fo IQQ2lF35TUEHbgYPidBnV/j1jBiyGRpnP5NktZO77quTGg35djppNS8rnXl/1mvwDs qnK1RrfTQzZFeQ/RjhfCEVt8ZkmzgtDKkX6yRmCevovOW3Hpt6OcHGi5nUTdqxdUQd 2a9IxIpZ4NImg2sWUi032KqpDQ6fQ7HZ1gGyBOsshZhz88KZ2gbxcwZWMXkonjO3JH H5iuDOBQenDkazsk+U9V+GU3NiCnCLfF6ErmOfKG++R6dn7ORS+RD85Kc/WZgDhf5A uXA15+ZioCmm/PXONk1hJ1+KiptY50lDx/rVUU8nS5XuO14MDTYhaotZWfAQNPzv+E RWzUKx9LarneY5uACaVkO7aBgbdmIRh90LLsexIspRB72FQADmAXRGM2X0N2OI0Bav fsGNDqvHnO/icDST29uz9nhheNjwqpSiCiNoxozv0AUlpIFwD3oZZlD+PDDbBn/BNA hxVr8WWNEbckjX5B//Rr0vgbaMcUif01uhLiLJziRqtf9Rr/XRqlpMp8t7EFUCDCwK eQUbRD6Ua2sfFtWbOLLilGuj7zFqMiJoRZPEUZMeR8rIo9AjoSE6BDeB+R7hvPehUb KVUhNMpCCs9iohalve7G+C88= In-Reply-To: <875yfnnzy6.fsf@neverwas.me> (J. P.'s message of "Wed, 09 Nov 2022 21:25:21 -0800") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:247517 gmane.emacs.erc.general:1966 Archived-At: "J.P." writes: > I know this is asking a lot, but if you get a chance, please apply the > v2 patches and try them out. (Actually, you can omit the second one in > the set, which only affects ERC.) I want to add I'm not an ERC user but circe user, I've got interested in the patch as I use the backend with circe, gnus, magit, elfeed and so on. >> will this mean the backend will act less like Passwordstore.org >> describes or more? > > That's a good question. My main goal thus far has been to make its query > behavior as close as possible to that of the other auth-source back > ends. Glancing at that web page, it seems auth-source-pass has taken > some liberties WRT to query features, like drilling down into the tail > of a file's contents and ascribing semantics to parts of a file name. A lot of programs don't implement the full path traversal and just end up having a static or a bogus path (e.g. those that implement Freedesktop SecretService with pass). So I favor a correct implementation, any progress is welcome. >> I think the backend should follow the users organization of the >> passwordstore folder if possible. > > From this I'll infer that the current implementation of auth-source-pass > does that sufficiently. If that's so and the changes I'm proposing > threaten to interfere with that, what's your opinion on the default > value of a knob to toggle the new behavior? Hm it depends if there are any backends that workaround that old behavior. >From what I see the only difference really is that you can specify require and max. My personal bindings for circe to auth-source currently only exist of small functions: ;; Adopted from Ghub.el, refactored for use with Circe IRC (defun circe--ident (username network) (format "%s^%s" username network)) (defun circe--auth-source-get (keys &rest spec) (declare (indent 1)) (let ((plist (car (apply #'auth-source-search (append spec (list :max 1)))))) (mapcar (lambda (k) (plist-get plist k)) keys))) (defun circe-pass-get (host user &optional network) "\fn(fn host user &optional network)" (auth-source-forget (list :host host :user user :max 1)) (when network (setq user (circe--ident user network))) (let ((match (car (circe--auth-source-get (list :secret) :host host :user user)))) (cond ((null match) (error "Auth source empty for %s %s %s" host user network)) ((functionp match) (funcall match)) (t match)))) Which makes me wonder why ERC needs the different behavior but then I'm not really a good lisp programmer more a novice. Br, Bj=C3=B6rn