[PATCH 2/2] Support for collection aliases.

Stef Walter stef at memberwebs.com
Fri Dec 11 13:57:59 PST 2009


The collection aliases are present under:

/org/freedesktop/secrets/aliases/xxxx

So the default and network collections would be usable via
the object path, in addition to their normal object paths:

/org/freedesktop/secrets/aliases/default
/org/freedesktop/secrets/aliases/network

To manage the aliases, two new methods are added to the
Service interface: ReadAlias() and SetAlias(). BTW, These
are not properties on Collection because a collection can
be have multiple aliases pointing to it.
---
 specifications/Secrets/org.freedesktop.Secrets.xml |   26 +++++++++++++++----
 specifications/Secrets/specification.xml           |   11 +++-----
 2 files changed, 24 insertions(+), 13 deletions(-)

diff --git a/specifications/Secrets/org.freedesktop.Secrets.xml b/specifications/Secrets/org.freedesktop.Secrets.xml
index f1f4ba8..1630ee4 100644
--- a/specifications/Secrets/org.freedesktop.Secrets.xml
+++ b/specifications/Secrets/org.freedesktop.Secrets.xml
@@ -83,12 +83,6 @@
                 <tp:docstring>The object paths of all collections (ie: keyrings)</tp:docstring>
             </property>
 
-            <property name="DefaultCollection" type="o" access="readwrite">
-                <tp:docstring>
-                    The object path of the default collection, or an empty string if no collections exist.
-                </tp:docstring>
-            </property>
-
             <method name="OpenSession">
                 <tp:docstring>Open a unique session for the caller application.</tp:docstring>
                 <arg name="algorithm" type="s" direction="in">
@@ -170,6 +164,26 @@
                 </arg>
             </method>
 
+            <method name="ReadAlias">
+                <tp:docstring>Get the collection with the given alias.</tp:docstring>
+                <arg name="name" type='s' direction='in'>
+                    <tp:docstring>An alias, such as 'default'.</tp:docstring>
+                </arg>
+                <arg name="collection" type='o' direction='out'>
+                    <tp:docstring>The collection or the the path '/' if no such collection exists.</tp:docstring>
+                </arg>
+            </method>
+
+            <method name="SetAlias">
+                <tp:docstring>Setup a collection alias.</tp:docstring>
+                <arg name="name" type='s' direction='in'>
+                    <tp:docstring>An alias, such as 'default'.</tp:docstring>
+                </arg>
+                <arg name="collection" type='o' direction='in'>
+                    <tp:docstring>The collection.</tp:docstring>
+                </arg>
+            </method>
+
             <signal name="CollectionCreated">
                 <tp:docstring>A collection was created.</tp:docstring>
                 <arg name="collection" type="o">
diff --git a/specifications/Secrets/specification.xml b/specifications/Secrets/specification.xml
index 5ec4158..64b2980 100644
--- a/specifications/Secrets/specification.xml
+++ b/specifications/Secrets/specification.xml
@@ -109,11 +109,7 @@
 			 error should be raised.</para>
 
 			<para>Client applications without special requirements should store in the default 
-			collection. Use the 
-			<link linkend='org.freedesktop.Secret.Service.DefaultCollection'>
-			<property>DefaultCollection</property></link>
-			property on the Service interface to determine the default collection. In addition 
-			the default collection is always accessible through a 
+			collection. The default collection is always accessible through a
 			<link linkend='object-paths'>specific object path</link>.</para>
 			
 			<para>A new item can be created with the
@@ -485,9 +481,10 @@
 			<para>The object path for a session, where <emphasis>ssss</emphasis> is an auto-generated
 			session specific identifier.</para>
 			
-			<programlisting>/org/freedesktop/secrets/default</programlisting>
+			<programlisting>/org/freedesktop/secrets/aliases/default</programlisting>
 			<para>The default collection for client applications to store secrets is available under
-			this object path in addition to its real object path (above).</para>
+			this object path in addition to its real object path (above). Other aliases may also be
+			present.</para>
 		</chapter>
 
 		<xi:include href="reference.xml" xpointer="interfaces" xmlns:xi="http://www.w3.org/2001/XInclude">
-- 
1.6.3.3


--------------040504090302070203090008--


More information about the Authentication mailing list