unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* auth-source-search regex/fuzzy/partial match
@ 2019-06-22  4:41 Pierre Penninckx
  2020-07-12 20:56 ` Ted Zlatanov
  0 siblings, 1 reply; 3+ messages in thread
From: Pierre Penninckx @ 2019-06-22  4:41 UTC (permalink / raw)
  To: emacs-devel

Hello,

I was wondering if some work was done already to allow for
`auth-source-search' to return entries that partially match the given
spec. I didn't find anything on this subject after a some research.

For example, say `(auth-source-search :host "test" :max 10)' finds one match.
I'd like `:host "tes"' or `:host "est"' to find that match too.

If a backend provides something like this, it's by using some custom
code circumventing `auth-source-search'.

I'm thinking the best way to add this would be to enhance the `spec'
argument from `auth-source-search' to take an additional `:regex'
property.

Or would adding a new function make more sense?

Best,
Pierre



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: auth-source-search regex/fuzzy/partial match
  2019-06-22  4:41 auth-source-search regex/fuzzy/partial match Pierre Penninckx
@ 2020-07-12 20:56 ` Ted Zlatanov
  2020-08-14  6:37   ` Pierre Penninckx
  0 siblings, 1 reply; 3+ messages in thread
From: Ted Zlatanov @ 2020-07-12 20:56 UTC (permalink / raw)
  To: Pierre Penninckx; +Cc: emacs-devel

On Fri, 21 Jun 2019 21:41:06 -0700 Pierre Penninckx <ibizapeanut@gmail.com> 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



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: auth-source-search regex/fuzzy/partial match
  2020-07-12 20:56 ` Ted Zlatanov
@ 2020-08-14  6:37   ` Pierre Penninckx
  0 siblings, 0 replies; 3+ messages in thread
From: Pierre Penninckx @ 2020-08-14  6:37 UTC (permalink / raw)
  To: Ted Zlatanov; +Cc: emacs-devel

> On Fri, 21 Jun 2019 21:41:06 -0700 Pierre Penninckx <ibizapeanut@gmail.com> 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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-14  6:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-22  4:41 auth-source-search regex/fuzzy/partial match Pierre Penninckx
2020-07-12 20:56 ` Ted Zlatanov
2020-08-14  6:37   ` Pierre Penninckx

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).