Gnus development mailing list
 help / color / mirror / Atom feed
From: Ted Zlatanov <tzz@lifelogs.com>
To: ding@gnus.org
Subject: Re: auth-source-search
Date: Wed, 09 Mar 2011 09:39:48 -0600	[thread overview]
Message-ID: <87r5agpakb.fsf@lifelogs.com> (raw)
In-Reply-To: <87pqq225cf.fsf@lifelogs.com>

On Mon, 07 Mar 2011 11:44:16 -0600 Ted Zlatanov <tzz@lifelogs.com> wrote: 

TZ> On Sat, 05 Mar 2011 11:21:12 +0100 Lars Magne Ingebrigtsen <larsi@gnus.org> wrote: 
LMI> Ted Zlatanov <tzz@lifelogs.com> writes:
>>> So maybe for user convenience I can provide a wrapper like
>>> `auth-source-pick-first-secret' but I am seriously concerned that such a
>>> wrapper will grow in complexity and "convenience" until its complexity
>>> overwhelms its utility.

LMI> I think it would make sense to add that, otherwise all the auth-source
LMI> consumers will just implement their own, buggier versions of the same,
LMI> probably.  :-)

TZ> Are you thinking of a wrapper around `auth-source-search' that gets
TZ> :secret from the first result and evaluates it if it's a function?  That
TZ> seems OK.  Or do you mean we need a separate query syntax?

How about this implementation:

(defun auth-source-pick-first-secret (spec)
  "Pick the first secret found from applying SPEC to `auth-source-search'."
  (let* ((result (nth 0 (apply 'auth-source-search spec)))
         (secret (plist-get result :secret)))

    (if (functionp secret)
        (funcall secret)
      secret)))

Is that OK with you?

Ted




  reply	other threads:[~2011-03-09 15:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-03 16:11 auth-source-search Richard Riley
2011-03-03 20:00 ` auth-source-search Richard Riley
2011-03-03 22:14   ` auth-source-search Ted Zlatanov
2011-03-04 10:10     ` auth-source-search Richard Riley
2011-03-04 14:55       ` auth-source-search Ted Zlatanov
2011-03-05 10:21         ` auth-source-search Lars Magne Ingebrigtsen
2011-03-07 17:44           ` auth-source-search Ted Zlatanov
2011-03-09 15:39             ` Ted Zlatanov [this message]
     [not found]               ` <14vczs2spa.fsf@news.eternal-september.org>
2011-03-09 17:38                 ` auth-source-search Ted Zlatanov
2011-03-15 16:41               ` auth-source-search Lars Magne Ingebrigtsen
2011-03-09 15:35         ` auth-source-search Ted Zlatanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r5agpakb.fsf@lifelogs.com \
    --to=tzz@lifelogs.com \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).