This is with the exception of the 'path' functions.
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">
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">
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 = \
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)
$(pkgconfig_DATA) \
$(gir_DATA) \
$(typelibs_DATA) \
+ $(noinst_DATA) \
temp-dbus-generated.c \
temp-dbus-generated.h \
$(NULL)
* 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
*/
/**
*
* 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 *
* 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 *
*
* 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()
*/
*
* 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
*/
/**
/**
* 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
/**
* 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
*
*
* 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 *
* 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 *
* 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
*/
/**
* 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
*/
*
* 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.
*/
*
* 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.
*/
* 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
*/
/**
* 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
*/
/**
* 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 *
* #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);
/**
* 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.
#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 */
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 \
test-lookup-password.py \
test-clear-password.py \
test-store-password.py \
- test-unstable.py
+ $(NULL)
PY_ENV = $(JS_ENV)
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,
Mock.start("mock-service-normal.py")
def tearDown(self):
- SecretUnstable.Service.disconnect()
+ Secret.Service.disconnect()
Mock.stop()
def testSynchronous(self):
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,
Mock.start("mock-service-normal.py")
def tearDown(self):
- SecretUnstable.Service.disconnect()
+ Secret.Service.disconnect()
Mock.stop()
def testSynchronous(self):
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,
Mock.start("mock-service-normal.py")
def tearDown(self):
- SecretUnstable.Service.disconnect()
+ Secret.Service.disconnect()
Mock.stop()
def testSynchronous(self):
+++ /dev/null
-/*
- * 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();
+++ /dev/null
-#!/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()
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);