From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#38284: 27.0.50; [PATCH] Make auth-source-pass-search understand port lists Date: Thu, 21 Nov 2019 19:06:39 +0000 Message-ID: References: <87ftijz9df.fsf@gmail.com> <874kyxt78p.fsf@cassou.me> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="128221"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 38284@debbugs.gnu.org, Nicolas Petton To: Damien Cassou Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 21 20:07:26 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 1iXrnZ-000XCQ-Ue for geb-bug-gnu-emacs@m.gmane.org; Thu, 21 Nov 2019 20:07:26 +0100 Original-Received: from localhost ([::1]:45312 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iXrnY-0000CT-GA for geb-bug-gnu-emacs@m.gmane.org; Thu, 21 Nov 2019 14:07:24 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60902) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iXrnE-0000Bp-UA for bug-gnu-emacs@gnu.org; Thu, 21 Nov 2019 14:07:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iXrnD-0007Oi-JA for bug-gnu-emacs@gnu.org; Thu, 21 Nov 2019 14:07:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44520) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iXrnD-0007OM-9S for bug-gnu-emacs@gnu.org; Thu, 21 Nov 2019 14:07:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iXrnC-0008B7-5k for bug-gnu-emacs@gnu.org; Thu, 21 Nov 2019 14:07:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 21 Nov 2019 19:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38284 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 38284-submit@debbugs.gnu.org id=B38284.157436321831425 (code B ref 38284); Thu, 21 Nov 2019 19:07:02 +0000 Original-Received: (at 38284) by debbugs.gnu.org; 21 Nov 2019 19:06:58 +0000 Original-Received: from localhost ([127.0.0.1]:53341 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iXrn7-0008Am-UL for submit@debbugs.gnu.org; Thu, 21 Nov 2019 14:06:58 -0500 Original-Received: from mail-io1-f66.google.com ([209.85.166.66]:39916) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iXrn6-0008Aa-B6 for 38284@debbugs.gnu.org; Thu, 21 Nov 2019 14:06:56 -0500 Original-Received: by mail-io1-f66.google.com with SMTP id k1so4754256ioj.6 for <38284@debbugs.gnu.org>; Thu, 21 Nov 2019 11:06:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=MBgiy+8weKrG6HPzzoI/9X/s9Z8ELAeFZLHiA6cety0=; b=MVXP4KaDIO4j2ES+ixgbizoHG5iJ7KJ6HwAd7xhuCnjkhUq/7sHIUE64AWZ0nuS2WE 1Cwpl3TP/WC+h03RxiVKwlnZlRU+QpblYHXBjmlk3PsoMKd8WSIGJvZwrDxyK5/od7/G 1XNO0G804XVekH6tK6BNFGN5FxtoRN2kc6X/BTrTOrdxhwxJciDtwpOb+70AE/779dPI nE6CSEhNBosfCRuITpeT3WBJ7kNg07ixVshCr8xkzxPCLghcpHv1u9uGMNGSmiSlrS9m 2+BqYpN5Tp4wz34gkGB+Jh2X5gvo8kX9bpsg5Cm4dMeYjpT2dE2sQF01+YfF5fZhWOxg wGMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=MBgiy+8weKrG6HPzzoI/9X/s9Z8ELAeFZLHiA6cety0=; b=DxadjlnuONvQ1I5mGBgsTnNtMWMJtcJWfdN8VNXgu2XGajIjaPTyfgUTrbjWKVYnN3 OBlY9YZaY7NfIe9Xq/LeUjNxRqDzMUxIdzH/DYYF39Tv+LVzFLjFvFmluVCbDgZJr6JR bjLsD29xR0v47lr4H2EoQP9S7f9shfBk8UkmHx7UIMfsQcXydhJZMC+G/aa3MMEnNLKc lotnGFTJifmtMuYmaAjcxA7FKLoHtB9yiu5tgnseeCg1fHDlevvTXfUHDiT82ssHTeg7 c+TFtgQOkVHaoAKZyjsUAK/eGE/ELAbfFLTFMKgiHd83zBqhwHh+LraGU616ETIpYKpc llWA== X-Gm-Message-State: APjAAAUoD+MxIkLocu+GmyFndcblAaRHSsQl/3u82bpOtgnERVsEN6ef UbZ7FVCvIRVbn0vLvHR3/Pw7vcdcQ9x7HkCHMMdOdBW3 X-Google-Smtp-Source: APXvYqxR4dq38+8GbNDmtvZiz/pZPm0HifjQiVJcQN4DUXSe+1sMutkvgPGJl3BNOfXzbNI4j3MWjTNjDNwtVAbXkDQ= X-Received: by 2002:a02:c54b:: with SMTP id g11mr7379004jaj.136.1574363210553; Thu, 21 Nov 2019 11:06:50 -0800 (PST) In-Reply-To: <874kyxt78p.fsf@cassou.me> 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:172153 Archived-At: On Thu, Nov 21, 2019 at 6:27 PM Damien Cassou wrote: > > Hi Jo=C3=A3o, > > Jo=C3=A3o T=C3=A1vora writes: > > [=E2=80=A6] Eventually I came to this patch, which seems to do the righ= t > > thing. > > > great job, thank you. Some feedback below. > > > (let ((domains (auth-source-pass--domains (split-string hostname "\\= .")))) > > - (seq-mapcat (lambda (n) > > - (auth-source-pass--name-port-user-suffixes n user po= rt)) > > + (seq-mapcat (lambda (d) > > > can you please rename "d" to "domain"? ok. I do call your attention that it was already the single letter n there, so I was following what I though was shorthand convention, just adjusting it to the first letter of the concept actually used. > > + (seq-mapcat > > + (lambda (p) > > > same for "p". ok. > > + (auth-source-pass--name-port-user-suffixes d user= p)) > > + (if (listp port) port (list port)))) > > domains))) > > > Can you please add a unit test covering this new use-case? No. This is too much work for such a trivial change that can be reasoned about locally. I don't usually write tests for those. If you permit me to exagerate, it's like testing that (+ 2 2) really equals 4. But some people do write tests at this level, and I of course don't mind if you do. --=20 Jo=C3=A3o T=C3=A1vora