Commit Graph

32 Commits

Author SHA1 Message Date
Andy Holmes
226fa114ac
Fix minor gi-docgen reference
Apparently `GLib.Type` is in fact `GObject.Type`.

See: https://docs.gtk.org/gobject/alias.Type.html
2024-03-20 20:23:53 -07:00
Daiki Ueno
f83cd26858 secret-service: Don't unnecessary increase refcount
As the GVariant returned in secret_service_real_prompt_finish should
be already sunk by secret_prompt_perform_finish, calling
g_variant_ref_sink actually increases the refcount and causes a leak.

Signed-off-by: Daiki Ueno <dueno@src.gnome.org>
2023-10-19 13:52:59 +09:00
Niels De Graef
0f04e5d371 Stop using GSlice
GLib is discussing deprecating/removing it upstream [1] since it has
only limited uses. Next to that, it seems to bork stack traces here when
using ASAN (for which you also have to specify `G_SLICE=always-malloc`
and some other envvars too).

In other words, let's just get rid of using `GSlice` and call the
allocation APIs directly.

[1]: https://gitlab.gnome.org/GNOME/glib/-/issues/1079
2023-01-16 19:17:59 +01:00
Daiki Ueno
d768ce4efe Properly chain-up GTasks around GDBusProxy::init_async
Our GAsyncInitable implementations in SecretService, SecretCollection,
and SecretItem internally wrap GDBusProxy::init_async and perform
additional error processing. To chain up we used to pass around a
single GTask, which caused an issue in the (additional) error path:
GDBusProxy::init_async may have already called
g_task_return_boolean(task, TRUE) and in that case GLib produces the
following warning:

  g_task_return_error: assertion '!task->ever_returned' failed

This fixes the issue by creating a temporary GTask around
GDBusProxy::init_async call.

Signed-off-by: Daiki Ueno <dueno@src.gnome.org>
2022-05-09 16:27:44 +02:00
Maximiliano Sandoval R
56bf2c8fe9
docs: Remove large indentations
Indentations by more than four spaces make gi-docgen read them as a
quote block.
2022-02-07 13:02:10 +01:00
Maximiliano Sandoval R
8726110219
docs: All docs should have a header line
This line should have a single sentence.
2022-02-07 13:02:10 +01:00
Maximiliano
2c3a34cca4 Port documentation to gi-docgen 2022-02-02 12:19:14 +00:00
Dhanuka Warusadura
7e713cf65a Fix issues flagged by static analyzers
These changes specifically fix the issues flagged by clang-analyzer.
Fixes: #59
2021-03-31 10:59:04 +00:00
Niels De Graef
41c8a8282f Mark optional GCancellables as (nullable) 2021-02-06 16:46:23 +00:00
Niels De Graef
402c9fb7fd Get rid of (allow-none) annotations
The `(allow-none)` annotation was deprecated for `(nullable)` and
`(optional)` to solve some ambiguous uses of the tag.
2021-02-06 16:46:23 +00:00
Daiki Ueno
b37d2b8d20 secret-backend: Add a way to uncache singleton instance
This is ugly, but necessary to handle instance uncaching in
SecretBackend when the backend instance is gone.
2019-10-08 07:55:55 +00:00
Daiki Ueno
71a19a95ae secret-service: Implement SecretBackendInterface 2019-10-08 07:55:55 +00:00
Daiki Ueno
e6456698ec secret-service: Move parent property setting to constructor
This makes it possible to instantiate a SecretService instance
directly through g_initable_new() or g_async_initable_new_async().
2019-10-08 07:55:55 +00:00
Jan Alexander Steffens (heftig)
aae0329ba3
service: Fix secret_service_ensure_session_finish error propagation
The condition checking g_task_is_valid was inverted, resulting in errors
being ignored.

Move the check to a g_return_val_if_fail to be in line with all other
uses of g_task_is_valid.

Fixes https://bugs.archlinux.org/task/63666
2019-09-05 18:42:26 +02:00
Niels De Graef
f165f721d8 Port Service and Session to GTask
GSimpleAsyncResult is deprecated in favor of the simpler GTask, so use
that instead. This cuts down on the deprecation warnings.

I wanted to do both separately, but porting one without the other led to
some faulty casts from GSimpleAsyncResult to GTask (and vice versa).
2019-05-15 18:21:34 +02:00
Niels De Graef
950b22bab6 Remove deprecated g_type_class_add_private()
Use `G_ADD_PRIVATE()` or its shorthand when defining a type using
`G_DEFINE_TYPE_WITH_PRIVATE()`
2019-01-24 00:07:33 +01:00
Ville Skyttä
2624ed771b Spelling fixes 2017-10-15 00:28:01 +03:00
Michael Catanzaro
0660951db3 Fix typos 2015-11-13 14:35:52 -08:00
Stef Walter
59a8238971 libsecret: Fix documentation typos 2014-03-04 14:15:43 +01:00
Stef Walter
b72048c920 Makefile.am: Use a single Makefile.am and parallel tests
Allow parallel building and testing by using a single Makefile.am

Implement parallel testing using TAP, with various drivers and
compilers living in the build/ directory.

Fix all sorts of issues that this caused, including builddir != srcdir,
leaks in tests and so on.

It would have been nice to break out all the above into separate
commits ... blush.
2014-03-04 12:57:19 +01:00
Stef Walter
dd6fcf87bb Mark most of unstable API as stable
This is with the exception of the 'path' functions.
2013-12-11 10:57:22 +01:00
Stef Walter
71e2791ea3 secret-prompt: Use string window ids
This is more portable and exposes what's actually in the Secret
Service API. This change was made before going stable with the
prompting functions.
2013-12-11 10:57:22 +01:00
Stef Walter
482dc34d74 Fix documentation warnings 2013-12-11 08:26:58 +01:00
Stef Walter
bdbdadf40c Pass return_type to prompt async begin functions, rather than finish
Much like g_dbus_connection_call() we now pass our return_type value
when starting the async operation. This unbreaks vala and various
other bindings that make assumptions about the form of xxx_finish()
async calls.

This is an API/API break, but its to the portion of the library
marked as unstable. Only used by seahorse (in jhbuild) and updated
usage there.
2013-06-21 15:11:14 +02:00
Stef Walter
d6367b1de0 Simpler way to use custom service/collection/item types
The previous way of setting collection_gtype and item_gtype
on SecretServiceClass was not very bindings friendly. Instead
allow per instance virtual functions to return the GTypes.
2013-06-21 15:11:14 +02:00
Stef Walter
1758194f26 service: Rename secret_service_new() and friends to open()
The _new() suffix confuses vala and gobject introspection thinking
that it's a constructor, and there's no way to tell it otherwise. And
things really get messy because they're async functions.

So while we're still unstable, rename these functions to
secret_service_open() secret_service_open_sync() and
secret_service_open_finish().

This is an API/API break, but its to the portion of the library
marked as unstable. Only used by seahorse (in jhbuild) and updated
usage there.
2013-06-21 15:11:14 +02:00
Stef Walter
a23ee598c7 Rework how we strip remote DBus errors
* This is necessary because sometimes we don't want to complain,
   for expected errors, when running nested operations.
 * The fact that we have to do this is silly, and soon there
   will be a solution in glib itself.

https://bugzilla.gnome.org/show_bug.cgi?id=688165
2012-11-14 11:11:23 +01:00
Stef Walter
7cea18071b Bring over a new version of the secure memory code from gcr
* This allows libraries to share the pool if they have the same
   version of the secure memory code.
2012-10-27 12:23:39 +02:00
Stef Walter
66a7a81216 Fix introspection tests
* Regressed due to hiding of internal symbols in libsecret.so and
   creation of a separate libsecret-testable.so library
2012-07-31 14:56:52 +02:00
Stef Walter
83c8674a03 Update documentation for to have correct headers
* Add add more warnings to unstable API documentation
2012-07-13 13:04:26 +02:00
Stef Walter
994ae44a77 Split the pkg-config files, gir, and vapi into stable/unstable
* C callers need to use libsecret-0 pkg-config file for stable and
   libsecret-unstable for unstable stuff.
 * Vala callers need to '--pkg libsecret-unstable' for unstable
 * GObject Introspection callers need to use the SecretUnstable package
2012-07-13 11:14:34 +02:00
Stef Walter
5cc30b2b68 Rename the library subdirectory to libsecret
* Death by a thousand paper cuts from gir and vapi not liking
   the fact that the secret.h file was not usable uninstalled
   and installed in the same way.
2012-07-13 10:40:25 +02:00