From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pierre Penninckx Newsgroups: gmane.emacs.devel Subject: Re: auth-source-search regex/fuzzy/partial match Date: Thu, 13 Aug 2020 23:37:39 -0700 Message-ID: <878seh20ng.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21879"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.5.5; emacs 27.1 Cc: emacs-devel@gnu.org To: Ted Zlatanov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Aug 14 15:34:46 2020 Return-path: Envelope-to: ged-emacs-devel@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 1k6Zr4-0005b1-NO for ged-emacs-devel@m.gmane-mx.org; Fri, 14 Aug 2020 15:34:46 +0200 Original-Received: from localhost ([::1]:38080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k6Zr3-0005QE-NF for ged-emacs-devel@m.gmane-mx.org; Fri, 14 Aug 2020 09:34:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58920) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k6TLV-0003Bk-OC for emacs-devel@gnu.org; Fri, 14 Aug 2020 02:37:45 -0400 Original-Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]:46619) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k6TLU-0000tm-2y for emacs-devel@gnu.org; Fri, 14 Aug 2020 02:37:45 -0400 Original-Received: by mail-pg1-x536.google.com with SMTP id 189so3424067pgg.13 for ; Thu, 13 Aug 2020 23:37:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:message-id :date:mime-version; bh=xC7X6lLTqqDmgJ1h7kyOGHiPKtV6FwOvtHm3u1uuIok=; b=VHyopPLHhBPtV/MuWYW8Qm4+3nH/vxbBdepEs+189MxrNBKklKxgP86Tm1hzbpbGMD +zMvpUzxyrbKLAJFLvonsNWJLzCXHhNmRhZ7ZRLWWdC1ViNxXJK87uNU0FSdm8LCr/Iy hBvlzoqYK1X4DTyyTQfO3/cjjDDmgCfMUMJjW5C/32efDCVoEBhXPfNRyOeIPF2an6Ol PTTwVGsM+xH1dULty79AFrhDSs7pvOEbo7rsH0qXephLafaAlZT6Hxr5ncJBTLFNjrXC 4j4PLOTdwjxq0ijXoktdRtZXntdDVioqG637PBi1TROePKAGAnqMaRLIcA/UQY+DE9Y7 Fa5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:message-id:date:mime-version; bh=xC7X6lLTqqDmgJ1h7kyOGHiPKtV6FwOvtHm3u1uuIok=; b=Bp9QXlNdwVn2KCGj4JZds/3u6K3sd5ZHO41E5k3pAx2BQyRuh/MbBndI/O+z1zKJJW N4lvgH4bQ99h6AAo2Zz12t2qsFGgqNS/Csc5xZzwO6cRMiGhKRNc4vY0Kw7f/P9uIPxi 4hz0CtuTXqbEmrR9eVEzzqBdt1OtAC3xz+/7ZY5SEB50RGZs76tUc3VWhS7xSww7u3RR RNHm5odg9J4ywlVb6/AJppCiZci3zoO76qbmiuNb0B1J6pPEJBoNVx5cUgPytRkOwDpc DkbRBfh1Gz37LTEFWjVCgxRs3dOYLP7XzxIv+vKZm/r1VZYnBuniYmb8oL5p1ahZ7BdI pWTg== X-Gm-Message-State: AOAM530tV3FcsDC4B0FjRm88PE/jO8ZBYJH5a3lFaIoZpYrmH5u+BNPf 4Shmoy6WPnpGEwddu0T8HZ+ld5mfQu0= X-Google-Smtp-Source: ABdhPJzUz39GEt1jRgHz6PI5NF+UqeOXVZvV9fnJdPXca/u3QWiyM0uo959HQqv5vZc8CqGh+7yicg== X-Received: by 2002:a65:64cb:: with SMTP id t11mr802631pgv.359.1597387061316; Thu, 13 Aug 2020 23:37:41 -0700 (PDT) Original-Received: from timac (104-11-137-175.lightspeed.irvnca.sbcglobal.net. [104.11.137.175]) by smtp.gmail.com with ESMTPSA id 131sm7594073pgh.67.2020.08.13.23.37.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Aug 2020 23:37:40 -0700 (PDT) In-reply-to: Received-SPF: pass client-ip=2607:f8b0:4864:20::536; envelope-from=ibizapeanut@gmail.com; helo=mail-pg1-x536.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 14 Aug 2020 09:34:04 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:253768 Archived-At: > On Fri, 21 Jun 2019 21:41:06 -0700 Pierre Penninckx wrote: > > PP> I was wondering if some work was done already to allow for > PP> `auth-source-search' to return entries that partially match the given > PP> spec. I didn't find anything on this subject after a some research. > > PP> For example, say `(auth-source-search :host "test" :max 10)' finds one match. > PP> I'd like `:host "tes"' or `:host "est"' to find that match too. > > PP> If a backend provides something like this, it's by using some custom > PP> code circumventing `auth-source-search'. > > PP> I'm thinking the best way to add this would be to enhance the `spec' > PP> argument from `auth-source-search' to take an additional `:regex' > PP> property. > > PP> Or would adding a new function make more sense? > > Hi Pierre. Sorry for the late reply. > > We can certainly add this generally, but my concern is that it would > make queries less precise and thus a little more likely to leak > credentials unintentionally. > > OTOH I can imagine some use cases for :host regex matching specifically: > > * based on the domain name, ignoring the hostname > * based on a hostname pattern without the domain name > * against the whole FQDN > > Would that be sufficient for your needs or would you propose other use cases? > > Thank you > Ted Thanks Ted for answering. It's been a while since I didn't need this - I don't even remember why I needed this in the first place. If I ever get the need again, I'll reply with a thorough email. :) Have a great day, Pierre