Mark most of unstable API as stable
authorStef Walter <stefw@gnome.org>
Wed, 11 Dec 2013 09:32:25 +0000 (10:32 +0100)
committerStef Walter <stefw@gnome.org>
Wed, 11 Dec 2013 09:57:22 +0000 (10:57 +0100)
This is with the exception of the 'path' functions.

18 files changed:
docs/reference/libsecret/libsecret-using.sgml
libsecret/Makefile.am
libsecret/secret-collection.c
libsecret/secret-item.c
libsecret/secret-methods.c
libsecret/secret-password.c
libsecret/secret-paths.c
libsecret/secret-prompt.c
libsecret/secret-service.c
libsecret/secret-value.c
libsecret/secret.h
libsecret/tests/Makefile.am
libsecret/tests/test-clear-password.py
libsecret/tests/test-lookup-password.py
libsecret/tests/test-store-password.py
libsecret/tests/test-unstable.js [deleted file]
libsecret/tests/test-unstable.py [deleted file]
libsecret/tests/test-vala-unstable.vala

index c531b15..0add7c9 100644 (file)
@@ -64,22 +64,6 @@ var schema = new Secret.Schema.new("org.mock.Schema",
        Secret.SchemaFlags.NONE, { "name", Secret.SchemaAttributeType.STRING });
 </programlisting></informalexample>
 
-<para>
-Some parts of the <application>libsecret</application> API are not yet stable.
-It is <emphasis>not</emphasis> recommended that you use these unstable parts
-from javascript. Your code <emphasis>will break</emphasis> when the unstable API
-changes, and due to the lack of a compiler you will have no way of knowing when
-it does. If you must use the unstable API, you would do it like this:
-</para>
-
-<informalexample><programlisting language="javascript">
-// Warning: if you use the unstable API from javascript, your're going to have a bad time
-const SecretUnstable = imports.gi.SecretUnstable;
-
-// ... and a here's sample line of code which uses the import
-var collection = SecretUnstable.Collection.for_alias(null, "default", null);
-</programlisting></informalexample>
-
 </chapter>
 
 <chapter id="using-python">
@@ -98,22 +82,6 @@ schema = Secret.Schema.new("org.mock.Schema",
        Secret.SchemaFlags.NONE, { "name", Secret.SchemaAttributeType.STRING })
 </programlisting></informalexample>
 
-<para>
-Some parts of the <application>libsecret</application> API are not yet stable.
-It is <emphasis>not</emphasis> recommended that you use these unstable parts
-from python. Your code <emphasis>will break</emphasis> when the unstable API
-changes, and due to the lack of a compiler you will have no way of knowing when
-it does. If you must use the unstable API, you would do it like this:
-</para>
-
-<informalexample><programlisting language="py">
-# Warning: if you use the unstable API from python, your're going to have a bad time
-from gi.repository import SecretUnstable
-
-# ... and a here's sample line of code which uses the import
-collection = SecretUnstable.Collection.for_alias(None, "default", None);
-</programlisting></informalexample>
-
 </chapter>
 
 <chapter id="using-vala">
index 6e1fe7b..0bf99b4 100644 (file)
@@ -39,20 +39,20 @@ BUILT_SOURCES = \
 
 STABLE_FILES = \
        secret-attributes.h secret-attributes.c \
+       secret-collection.h secret-collection.c \
+       secret-item.h secret-item.c \
+       secret-methods.c \
        secret-password.h secret-password.c \
+       secret-prompt.h secret-prompt.c \
        secret-schema.h secret-schema.c \
        secret-schemas.h secret-schemas.c \
+       secret-service.h secret-service.c \
        secret-types.h \
+       secret-value.h secret-value.c \
        $(NULL)
 
 UNSTABLE_FILES = \
-       secret-collection.h secret-collection.c \
-       secret-item.h secret-item.c \
-       secret-methods.c \
        secret-paths.h secret-paths.c \
-       secret-prompt.h secret-prompt.c \
-       secret-service.h secret-service.c \
-       secret-value.h secret-value.c \
        $(NULL)
 
 PRIVATE_FILES = \
@@ -144,7 +144,9 @@ SecretUnstable_0_gir_FILES = $(UNSTABLE_FILES)
 SecretUnstable_0_gir_SCANNERFLAGS = --c-include "libsecret/secret.h" --identifier-prefix=Secret --symbol-prefix=secret --include-uninstalled=$(builddir)/Secret-@SECRET_MAJOR@.gir
 
 girdir = $(datadir)/gir-1.0
-gir_DATA = $(INTROSPECTION_GIRS)
+gir_DATA = Secret-@SECRET_MAJOR@.gir
+
+noinst_DATA = SecretUnstable-0.gir
 
 typelibsdir = $(libdir)/girepository-1.0
 typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
@@ -217,6 +219,7 @@ CLEANFILES += \
        $(pkgconfig_DATA) \
        $(gir_DATA) \
        $(typelibs_DATA) \
+       $(noinst_DATA) \
        temp-dbus-generated.c \
        temp-dbus-generated.h \
        $(NULL)
index ad668f3..3acdacd 100644 (file)
  * lookup the items in the collection. There may not be any items exposed when
  * the collection is locked.
  *
- * These functions have an unstable API and may change across versions. Use
- * <literal>libsecret-unstable</literal> package to access them.
- *
- * Stability: Unstable
+ * Stability: Stable
  */
 
 /**
@@ -1467,7 +1464,7 @@ secret_collection_search (SecretCollection *self,
  *
  * Complete asynchronous operation to search for items in a collection.
  *
- * Returns: (transfer full) (element-type SecretUnstable.Item):
+ * Returns: (transfer full) (element-type Secret.Item):
  *          a list of items that matched the search
  */
 GList *
@@ -1557,7 +1554,7 @@ collection_load_items_sync (SecretCollection *self,
  * This function may block indefinetely. Use the asynchronous version
  * in user interface threads.
  *
- * Returns: (transfer full) (element-type SecretUnstable.Item):
+ * Returns: (transfer full) (element-type Secret.Item):
  *          a list of items that matched the search
  */
 GList *
@@ -1778,7 +1775,7 @@ secret_collection_get_flags (SecretCollection *self)
  *
  * Get the list of items in this collection.
  *
- * Returns: (transfer full) (element-type SecretUnstable.Item): a list of items,
+ * Returns: (transfer full) (element-type Secret.Item): a list of items,
  * when done, the list should be freed with g_list_free, and each item should
  * be released with g_object_unref()
  */
index bf9b2e3..abcfa62 100644 (file)
  *
  * Items can be created with secret_item_create() or secret_service_store().
  *
- * These functions have an unstable API and may change across versions. Use
- * <literal>libsecret-unstable</literal> package to access them.
- *
- * Stability: Unstable
+ * Stability: Stable
  */
 
 /**
@@ -1405,7 +1402,7 @@ on_loads_secrets_session (GObject *source,
 
 /**
  * secret_item_load_secrets:
- * @items: (element-type SecretUnstable.Item): the items to retrieve secrets for
+ * @items: (element-type Secret.Item): the items to retrieve secrets for
  * @cancellable: optional cancellation object
  * @callback: called when the operation completes
  * @user_data: data to pass to the callback
@@ -1504,7 +1501,7 @@ secret_item_load_secrets_finish (GAsyncResult *result,
 
 /**
  * secret_item_load_secrets_sync:
- * @items: (element-type SecretUnstable.Item): the items to retrieve secrets for
+ * @items: (element-type Secret.Item): the items to retrieve secrets for
  * @cancellable: optional cancellation object
  * @error: location to place an error on failure
  *
index 6c98b16..48eb716 100644 (file)
@@ -342,7 +342,7 @@ secret_service_search (SecretService *service,
  *
  * Complete asynchronous operation to search for items.
  *
- * Returns: (transfer full) (element-type SecretUnstable.Item):
+ * Returns: (transfer full) (element-type Secret.Item):
  *          a list of items that matched the search
  */
 GList *
@@ -432,7 +432,7 @@ service_load_items_sync (SecretService *service,
  * This function may block indefinetely. Use the asynchronous version
  * in user interface threads.
  *
- * Returns: (transfer full) (element-type SecretUnstable.Item):
+ * Returns: (transfer full) (element-type Secret.Item):
  *          a list of items that matched the search
  */
 GList *
index d0df50f..97d7f7a 100644 (file)
  * Each of the functions accept a variable list of attributes names and their
  * values. Include a %NULL to terminate the list of attributes.
  *
- * These functions have an unstable API and may change across versions. Use
- * <literal>libsecret-unstable</literal> package to access them.
- *
- * Stability: Unstable
+ * Stability: Stable
  */
 
 /**
index 93e6e94..042dcc8 100644 (file)
@@ -36,9 +36,6 @@
  * service using the DBus API directly, and only wish to use a few calls
  * in libsecret.
  *
- * These functions have an unstable API and may change across versions. Use
- * <literal>libsecret-unstable</literal> package to access them.
- *
  * Stability: Unstable
  */
 
@@ -906,7 +903,7 @@ secret_service_get_secrets_for_dbus_paths (SecretService *self,
  *
  * Items that are locked will not be included the results.
  *
- * Returns: (transfer full) (element-type utf8 SecretUnstable.Value): a newly
+ * Returns: (transfer full) (element-type utf8 Secret.Value): a newly
  *          allocated hash table of item_path keys to #SecretValue
  *          values.
  */
@@ -949,7 +946,7 @@ secret_service_get_secrets_for_dbus_paths_finish (SecretService *self,
  *
  * Items that are locked will not be included the results.
  *
- * Returns: (transfer full) (element-type utf8 SecretUnstable.Value): a newly
+ * Returns: (transfer full) (element-type utf8 Secret.Value): a newly
  *          allocated hash table of item_path keys to #SecretValue
  *          values.
  */
index 8d84b7f..a1724fe 100644 (file)
  * SecretServiceClass::prompt_async and SecretServiceClass::prompt_finish
  * virtual methods of the #SecretService class.
  *
- * These functions have an unstable API and may change across versions. Use
- * <literal>libsecret-unstable</literal> package to access them.
- *
- * Stability: Unstable
+ * Stability: Stable
  */
 
 /**
index 7954b8c..0179f64 100644 (file)
  * In order to customize prompt handling, override the <literal>prompt_async</literal>
  * and <literal>prompt_finish</literal> virtual methods of the #SecretService class.
  *
- * These functions have an unstable API and may change across versions. Use
- * <literal>libsecret-unstable</literal> package to access them.
- *
- * Stability: Unstable
+ * Stability: Stable
  */
 
 /**
@@ -1101,7 +1098,7 @@ secret_service_get_flags (SecretService *self)
  * initializing #SecretService proxy object, then this method will return
  * %NULL. Use secret_service_load_collections() to load the collections.
  *
- * Returns: (transfer full) (element-type SecretUnstable.Collection) (allow-none): a
+ * Returns: (transfer full) (element-type Secret.Collection) (allow-none): a
  *          list of the collections in the secret service
  */
 GList *
index 64130e0..af59a20 100644 (file)
  * #SecretValue is reference counted and immutable. The secret data is only
  * freed when all references have been released via secret_value_unref().
  *
- * These functions have an unstable API and may change across versions. Use
- * <literal>libsecret-unstable</literal> package to access them.
- *
- * Stability: Unstable
+ * Stability: Stable
  */
 
 static gboolean     is_password_value    (SecretValue *value);
@@ -226,7 +223,7 @@ secret_value_ref (SecretValue *value)
 
 /**
  * secret_value_unref:
- * @value: (type SecretUnstable.Value) (allow-none): value to unreference
+ * @value: (type Secret.Value) (allow-none): value to unreference
  *
  * Unreference a #SecretValue. When the last reference is gone, then
  * the value will be freed.
index 24208be..12c22f6 100644 (file)
 #define __SECRET_INSIDE_HEADER__
 
 #include <libsecret/secret-attributes.h>
+#include <libsecret/secret-collection.h>
+#include <libsecret/secret-enum-types.h>
+#include <libsecret/secret-item.h>
 #include <libsecret/secret-password.h>
+#include <libsecret/secret-prompt.h>
 #include <libsecret/secret-schema.h>
 #include <libsecret/secret-schemas.h>
+#include <libsecret/secret-service.h>
 #include <libsecret/secret-types.h>
+#include <libsecret/secret-value.h>
 
 /* SECRET_WITH_UNSTABLE is defined in the secret-unstable.pc pkg-config file */
 #if defined(SECRET_WITH_UNSTABLE) || defined(SECRET_API_SUBJECT_TO_CHANGE)
 #warning "Some parts of the libsecret API are unstable. Define SECRET_API_SUBJECT_TO_CHANGE to acknowledge"
 #endif
 
-#include <libsecret/secret-collection.h>
-#include <libsecret/secret-enum-types.h>
-#include <libsecret/secret-item.h>
 #include <libsecret/secret-paths.h>
-#include <libsecret/secret-prompt.h>
-#include <libsecret/secret-service.h>
-#include <libsecret/secret-value.h>
 
 #endif /* SECRET_WITH_UNSTABLE || SECRET_API_SUBJECT_TO_CHANGE */
 
index 7e4413d..e385d88 100644 (file)
@@ -59,7 +59,7 @@ JS_TESTS = \
        test-lookup-password.js \
        test-clear-password.js \
        test-store-password.js \
-       test-unstable.js
+       $(NULL)
 
 JS_ENV = \
        LD_LIBRARY_PATH=$(builddir)/../.libs:$(builddir)/.libs \
@@ -69,7 +69,7 @@ PY_TESTS = \
        test-lookup-password.py \
        test-clear-password.py \
        test-store-password.py \
-       test-unstable.py
+       $(NULL)
 
 PY_ENV = $(JS_ENV)
 
index 32276f6..5b5ac11 100644 (file)
@@ -15,7 +15,7 @@ import sys
 import unittest
 
 from gi.repository import MockService as Mock
-from gi.repository import Secret, SecretUnstable, GLib
+from gi.repository import Secret, GLib
 
 STORE_SCHEMA = Secret.Schema.new("org.mock.Schema",
        Secret.SchemaFlags.NONE,
@@ -31,7 +31,7 @@ class TestRemove(unittest.TestCase):
                Mock.start("mock-service-normal.py")
 
        def tearDown(self):
-               SecretUnstable.Service.disconnect()
+               Secret.Service.disconnect()
                Mock.stop()
 
        def testSynchronous(self):
index 157b585..c701043 100644 (file)
@@ -14,7 +14,7 @@
 import unittest
 
 from gi.repository import MockService as Mock
-from gi.repository import Secret, SecretUnstable, GLib
+from gi.repository import Secret, GLib
 
 STORE_SCHEMA = Secret.Schema.new("org.mock.Schema",
        Secret.SchemaFlags.NONE,
@@ -30,7 +30,7 @@ class TestLookup(unittest.TestCase):
                Mock.start("mock-service-normal.py")
 
        def tearDown(self):
-               SecretUnstable.Service.disconnect()
+               Secret.Service.disconnect()
                Mock.stop()
 
        def testSynchronous(self):
index 8b6f86b..8362d84 100644 (file)
@@ -14,7 +14,7 @@
 import unittest
 
 from gi.repository import MockService as Mock
-from gi.repository import Secret, SecretUnstable, GLib
+from gi.repository import Secret, GLib
 
 STORE_SCHEMA = Secret.Schema.new("org.mock.Schema",
        Secret.SchemaFlags.NONE,
@@ -30,7 +30,7 @@ class TestStore(unittest.TestCase):
                Mock.start("mock-service-normal.py")
 
        def tearDown(self):
-               SecretUnstable.Service.disconnect()
+               Secret.Service.disconnect()
                Mock.stop()
 
        def testSynchronous(self):
diff --git a/libsecret/tests/test-unstable.js b/libsecret/tests/test-unstable.js
deleted file mode 100644 (file)
index d0bb9ac..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright 2012 Red Hat Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the licence or (at
- * your option) any later version.
- *
- * See the included COPYING file for more information.
- */
-
-const Mock = imports.gi.MockService;
-const Secret = imports.gi.SecretUnstable;
-const GLib = imports.gi.GLib;
-
-const JsUnit = imports.jsUnit;
-const assertNotEquals = JsUnit.assertNotEquals;
-
-Mock.start("mock-service-normal.py");
-
-var service = Secret.Service.get_sync(Secret.ServiceFlags.NONE, null);
-var path = service.read_alias_dbus_path_sync("default", null);
-
-/* Just running this without error is good enough for us to test the unstable gir */
-assertNotEquals(path, null);
-
-Mock.stop();
diff --git a/libsecret/tests/test-unstable.py b/libsecret/tests/test-unstable.py
deleted file mode 100644 (file)
index 2aa6d2b..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/usr/bin/env python
-
-#
-# Copyright 2012 Red Hat Inc.
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License as published
-# by the Free Software Foundation; either version 2.1 of the licence or (at
-# your option) any later version.
-#
-# See the included COPYING file for more information.
-#
-
-import unittest
-
-from gi.repository import MockService as Mock
-from gi.repository import SecretUnstable, Secret, GLib
-
-EXAMPLE_SCHEMA = Secret.Schema.new('org.mock.type.Store',
-       Secret.SchemaFlags.NONE,
-       {
-               'number': Secret.SchemaAttributeType.INTEGER,
-               'string': Secret.SchemaAttributeType.STRING,
-               'even': Secret.SchemaAttributeType.BOOLEAN,
-       }
-)
-
-attributes = {
-       'number': '8',
-       'string': 'eight',
-       'even': 'true'
-}
-
-class TestStore(unittest.TestCase):
-       def setUp(self):
-               Mock.start("mock-service-normal.py")
-
-       def tearDown(self):
-               SecretUnstable.Service.disconnect()
-               Mock.stop()
-
-       def testSynchronous(self):
-               service = SecretUnstable.Service.get_sync(SecretUnstable.ServiceFlags.NONE, None);
-               path = service.read_alias_dbus_path_sync("default", None);
-
-               # Just running this without error is good enough for us to test the unstable gir
-               self.assertNotEqual(path, None);
-
-       def testValueGet(self):
-               Secret.password_store_sync(EXAMPLE_SCHEMA, attributes, Secret.COLLECTION_DEFAULT,
-                                          'the label', 'the password', None)
-
-               service = SecretUnstable.Service.get_sync(SecretUnstable.ServiceFlags.NONE, None)
-               items = service.search_sync(EXAMPLE_SCHEMA, { 'even': 'true' },
-                                                  SecretUnstable.SearchFlags.ALL | SecretUnstable.SearchFlags.LOAD_SECRETS,
-                                                  None)
-
-               item = items[0]
-               item_secret = item.get_secret()
-               self.assertEqual(item_secret.get(), "the password")
-
-if __name__ == '__main__':
-               unittest.main()
index f508991..142bc23 100644 (file)
@@ -12,7 +12,7 @@
 private void test_read_alias () {
        try {
                var service = Secret.Service.get_sync(Secret.ServiceFlags.NONE);
-               var path = service.read_alias_dbus_path_sync("default", null);
+               var path = Secret.service_read_alias_dbus_path_sync(service, "default", null);
                GLib.assert (path != null);
        } catch ( GLib.Error e ) {
                GLib.error (e.message);