From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/73661 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.gnus.general Subject: Re: auth-source tokens Date: Fri, 29 Oct 2010 10:04:59 +0200 Message-ID: <87aalxfmqc.fsf@gmx.de> References: <87d3qylr29.fsf@marauder.physik.uni-ulm.de> <87fwvu5ele.fsf_-_@lifelogs.com> <87wrp4yjtk.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1288339578 16246 80.91.229.12 (29 Oct 2010 08:06:18 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 29 Oct 2010 08:06:18 +0000 (UTC) Cc: ding@gnus.org, tramp-devel@gnus.org To: Ted Zlatanov Original-X-From: ding-owner+M22030@lists.math.uh.edu Fri Oct 29 10:06:14 2010 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PBjyX-0002a3-6O for ding-account@gmane.org; Fri, 29 Oct 2010 10:06:13 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1PBjy3-00051y-DV; Fri, 29 Oct 2010 03:05:43 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1PBjy0-00051e-4R for ding@lists.math.uh.edu; Fri, 29 Oct 2010 03:05:40 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1PBjxy-0006DL-1k for ding@lists.math.uh.edu; Fri, 29 Oct 2010 03:05:39 -0500 Original-Received: from mailout-de.gmx.net ([213.165.64.22] helo=mail.gmx.net) by quimby.gnus.org with smtp (Exim 3.36 #1 (Debian)) id 1PBjxx-000169-00 for ; Fri, 29 Oct 2010 10:05:37 +0200 Original-Received: (qmail invoked by alias); 29 Oct 2010 08:05:05 -0000 Original-Received: from p4FC19238.dip0.t-ipconnect.de (EHLO detlef.gmx.de) [79.193.146.56] by mail.gmx.net (mp066) with SMTP; 29 Oct 2010 10:05:05 +0200 X-Authenticated: #3708877 X-Provags-ID: V01U2FsdGVkX19BKNRChMZBwGr+9Tlp8qf57dCyuOq/6NIeooovUT c9FZAUeWKnl/e0 In-Reply-To: <87wrp4yjtk.fsf@lifelogs.com> (Ted Zlatanov's message of "Tue, 26 Oct 2010 11:56:07 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-Y-GMX-Trusted: 0 X-Spam-Score: -1.9 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:73661 Archived-At: Ted Zlatanov writes: > (defun auth-source-search (&rest spec) > "Parse `auth-sources' for matches of the SPEC plist. The major functionality of this defun is returning hits, matching the spec. That the function needs also to parse `auth-sources' in order to decide where to search, is second class information. I would start with the major information. > Common keys are :type, :max, :host, :protocol, and :user. You haven't mentioned :create. > A string value is matched as a regex for the > file (netrc) backend and literally by the Secrets API. A symbol > is matched as its string value. All the SPEC values can be > single values or lists. Hmm, maybe we shall extend secrets.el to support also regexp search? > :create t means to create a token if possible. When it is > 'rewrite-existing, any matching existing token will be copied > into the new token and deleted. This defaults to nil and will > generate an error if used with :max greater than 1.. I have a vague idea what you mean with rewrite-existing, but it is not clear from the explanation. The word `token' is not explained. It shall be clear, that `create' means actions in the chosen backend. > :max N means to return at most N items (defaults to 1) Stupid remark: it shall be greater than 0 :-) An alternative would be to allow 0, and the function just returns t or nil, depending whether there exist a matching token. > :types (A B C) means to match only tokens of types A, B, or C. > Common types include `password and `login. Defaults to t. :type or :types? :type is used above. I believe, this needs more explanation what :type is. Can it have other values but `password' or `login'? > :host (X Y Z) means to match only hosts X, Y, or Z as a regular > expression. Defaults to t. > > :protocol (P Q R) means to match only protocols P, Q, or R. > Defaults to t. Shall explain what you mean with this. Could be also numbers I guess (which is different from above, which allows on symbols or strings). You have not explained :user. > :K (V1 V2 V3) for any other key K will match values V1, V2, or > V3. If any of the values are strings, they are matched as > regular expressions in the file (netrc) backend and literally in > the Secrets API. If any are symbols, they are matched literally > as the symbol name. This duplicates the saying at the beginning. > Return value is a list with at most :max tokens. Each token is a > plist with keys :backend, :value, :type, :max, :host, :protocol, > and :user, plus any other keys provided by the backend. > > The token's :value key can hold a function. In that case you must call > it to obtain the actual value." > ) I would say, that :value relates to :type. Best regards, Michael.