aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2012-04-04 17:28:57 +0200
committerMichael Albinus2012-04-04 17:28:57 +0200
commit0317dd510d318698cc4cc982b002fb79a70b5bc9 (patch)
tree4245e1e5d3b088ec31c5442a8ba2139e05dd4b14
parent245d176baccb64765ec2f1726f39b927c95a3e16 (diff)
downloademacs-0317dd510d318698cc4cc982b002fb79a70b5bc9.tar.gz
emacs-0317dd510d318698cc4cc982b002fb79a70b5bc9.zip
* auth.texi (Secret Service API): Add the missing text.
-rw-r--r--doc/misc/ChangeLog4
-rw-r--r--doc/misc/auth.texi130
2 files changed, 133 insertions, 1 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index b7b981d8653..45f6c9455df 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,7 @@
12012-04-04 Michael Albinus <michael.albinus@gmx.de>
2
3 * auth.texi (Secret Service API): Add the missing text.
4
12012-04-04 Chong Yidong <cyd@gnu.org> 52012-04-04 Chong Yidong <cyd@gnu.org>
2 6
3 * message.texi (Using PGP/MIME): Note that epg is now the default. 7 * message.texi (Using PGP/MIME): Note that epg is now the default.
diff --git a/doc/misc/auth.texi b/doc/misc/auth.texi
index b6368cf0517..fe6464ae6b6 100644
--- a/doc/misc/auth.texi
+++ b/doc/misc/auth.texi
@@ -227,7 +227,135 @@ necessary if you have an unusual (see earlier comment on those) setup.
227@node Secret Service API 227@node Secret Service API
228@chapter Secret Service API 228@chapter Secret Service API
229 229
230TODO: how does it work generally, how does secrets.el work, some examples. 230The @dfn{Secret Service API} is a standard from
231@uref{http://www.freedesktop.org/wiki/Specifications/secret-storage-spec,,freedesktop.org}
232to securely store passwords and other confidential information.
233Implementations of compliant daemons are the GNOME Keyring and the KDE
234Wallet.
235
236Although the usage of the client library secrets.el is hidden in Emacs
237via the auth-source library, its functionality can be used also
238directly in other packages.
239
240@defvar secrets-enabled
241After loading @file{secrets.el}, a non-@code{nil} value of this
242variable indicates the existence of a daemon providing the Secret
243Service API.
244@end defvar
245
246@deffn Command secrets-show-secrets
247All collections, items, and their attributes are inspected by this command.
248@end deffn
249
250The atomic objects to be managed by the Secret Service API are
251@dfn{secret items}, which are something an application wishes to store
252securely. A good example is a password that an application needs to
253save and use at a later date.
254
255Secret items are grouped in @dfn{collections}. A collection is
256similar in concept to the terms @samp{keyring} or @samp{wallet}. A
257common collection is called @samp{"login"}. A collection is stored
258permanently under the user's permissions, and can be accessed in a
259user session context.
260
261A collection can have an alias name. The use case for this is to
262set the alias @samp{"default"} for a given collection, making it
263transparent for clients, which collection is used. Other aliases
264are not supported (yet). Since an alias is visible to all
265applications, this setting shall be performed with care.
266
267@defun secrets-list-collections
268This function returns a list of collection names.
269@end defun
270
271@defun secrets-set-alias collection alias
272Set @var{alias} as alias of collection labeled @var{collection}.
273For the time being, only the alias @samp{"default"} is supported.
274@end defun
275
276@defun secrets-get-alias alias
277Return the collection name @var{alias} is referencing to.
278For the time being, only the alias @samp{"default"} is supported.
279@end defun
280
281Collections can be created and deleted by the functions
282@code{secrets-create-collection} and @code{secrets-delete-collection}.
283Usually, this is not applied from within Emacs. Common collections,
284like @samp{"login"}, shall never be deleted.
285
286There exists a special collection called @samp{"session"}, which has
287the lifetime of the corresponding client session (aka Emacs's
288lifetime). It is created automatically when Emacs uses the Secret
289Service interface, and it is deleted when Emacs is killed. Therefore,
290it can be used to store and retrieve secret items temporarily. This
291shall be preferred over creation of a persistent collection, when the
292information shall not live longer than Emacs. The session collection
293can be addressed either by the string @samp{"session"}, or by
294@code{nil}, whenever a collection parameter is needed in the following
295functions.
296
297As already said, a collection is a group of secret items. A secret
298item has a label, the @dfn{secret} (which is a string), and a set of
299lookup attributes. The attributes can be used to search and retrieve
300a secret item at a later date.
301
302@defun secrets-list-items collection
303Returns a list of all item labels of @var{collection}.
304@end defun
305
306@defun secrets-create-item collection item password &rest attributes
307This function creates a new item in @var{collection} with label
308@var{item} and password @var{PASSWORD}. @var{attributes} are
309key-value pairs set for the created item. The keys are keyword
310symbols, starting with a colon. Example:
311
312@example
313(secrets-create-item "session" "my item" "geheim"
314 :method "sudo" :user "joe" :host "remote-host")
315@end example
316@end defun
317
318@defun secrets-get-secret collection item
319Return the secret of item labeled @var{item} in @var{collection}.
320If there is no such item, return @code{nil}.
321@end defun
322
323@defun secrets-delete-item collection item
324This function deletes item @var{item} in @var{collection}.
325@end defun
326
327The lookup attributes, which are specified during creation of a
328secret item, must be a key-value pair. Keys are keyword symbols,
329starting with a colon; values are strings. They can be retrieved
330from a given secret item, and they can be used for searching of items.
331
332@defun secrets-get-attribute collection item attribute
333Returns the value of key @var{attribute} of item labeled @var{item} in
334@var{collection}. If there is no such item, or the item doesn't own
335this key, the function returns @code{nil}.
336@end defun
337
338@defun secrets-get-attributes collection item
339Return the lookup attributes of item labeled @var{item} in
340@var{collection}. If there is no such item, or the item has no
341attributes, it returns @code{nil}. Example:
342
343@example
344(secrets-get-attributes "session" "my item")
345 @result{} ((:user . "joe") (:host ."remote-host"))
346@end example
347@end defun
348
349@defun secrets-search-items collection &rest attributes
350Searchs items in @var{collection} with @var{attributes}.
351@var{attributes} are key-value pairs, as used in
352@code{secrets-create-item}. Example:
353
354@example
355(secrets-search-items "session" :user "joe")
356 @result{} ("my item" "another item")
357@end example
358@end defun
231 359
232@node Help for developers 360@node Help for developers
233@chapter Help for developers 361@chapter Help for developers