docs: Move the GDBusAuthObserver SECTION

Move contents to struct docs.

Helps: #3037
This commit is contained in:
Matthias Clasen 2023-09-26 21:27:30 -04:00 committed by Philip Withnall
parent 985bc0fab3
commit c0243f7eaa

View File

@ -32,26 +32,25 @@
#include "gmarshal-internal.h" #include "gmarshal-internal.h"
/** /**
* SECTION:gdbusauthobserver * GDBusAuthObserver:
* @short_description: Object used for authenticating connections
* @include: gio/gio.h
* *
* The #GDBusAuthObserver type provides a mechanism for participating * `GDBusAuthObserver` provides a mechanism for participating
* in how a #GDBusServer (or a #GDBusConnection) authenticates remote * in how a [class@Gio.DBusServer] (or a [class@Gio.DBusConnection])
* peers. Simply instantiate a #GDBusAuthObserver and connect to the * authenticates remote peers.
*
* Simply instantiate a `GDBusAuthObserver` and connect to the
* signals you are interested in. Note that new signals may be added * signals you are interested in. Note that new signals may be added
* in the future * in the future.
* *
* ## Controlling Authentication Mechanisms * ## Controlling Authentication Mechanisms
* *
* By default, a #GDBusServer or server-side #GDBusConnection will allow * By default, a `GDBusServer` or server-side `GDBusConnection` will allow
* any authentication mechanism to be used. If you only * any authentication mechanism to be used. If you only want to allow D-Bus
* want to allow D-Bus connections with the `EXTERNAL` mechanism, * connections with the `EXTERNAL` mechanism, which makes use of credentials
* which makes use of credentials passing and is the recommended * passing and is the recommended mechanism for modern Unix platforms such
* mechanism for modern Unix platforms such as Linux and the BSD family, * as Linux and the BSD family, you would use a signal handler like this:
* you would use a signal handler like this:
* *
* |[<!-- language="C" --> * ```c
* static gboolean * static gboolean
* on_allow_mechanism (GDBusAuthObserver *observer, * on_allow_mechanism (GDBusAuthObserver *observer,
* const gchar *mechanism, * const gchar *mechanism,
@ -64,19 +63,19 @@
* *
* return FALSE; * return FALSE;
* } * }
* ]| * ```
* *
* ## Controlling Authorization # {#auth-observer} * ## Controlling Authorization
* *
* By default, a #GDBusServer or server-side #GDBusConnection will accept * By default, a `GDBusServer` or server-side `GDBusConnection` will accept
* connections from any successfully authenticated user (but not from * connections from any successfully authenticated user (but not from
* anonymous connections using the `ANONYMOUS` mechanism). If you only * anonymous connections using the `ANONYMOUS` mechanism). If you only
* want to allow D-Bus connections from processes owned by the same uid * want to allow D-Bus connections from processes owned by the same uid
* as the server, since GLib 2.68, you should use the * as the server, since GLib 2.68, you should use the
* %G_DBUS_SERVER_FLAGS_AUTHENTICATION_REQUIRE_SAME_USER flag. Its equivalent * `G_DBUS_SERVER_FLAGS_AUTHENTICATION_REQUIRE_SAME_USER` flag. Its equivalent
* to the following signal handler: * to the following signal handler:
* *
* |[<!-- language="C" --> * ```c
* static gboolean * static gboolean
* on_authorize_authenticated_peer (GDBusAuthObserver *observer, * on_authorize_authenticated_peer (GDBusAuthObserver *observer,
* GIOStream *stream, * GIOStream *stream,
@ -97,7 +96,9 @@
* *
* return authorized; * return authorized;
* } * }
* ]| * ```
*
* Since: 2.26
*/ */
typedef struct _GDBusAuthObserverClass GDBusAuthObserverClass; typedef struct _GDBusAuthObserverClass GDBusAuthObserverClass;
@ -126,14 +127,6 @@ struct _GDBusAuthObserverClass
const gchar *mechanism); const gchar *mechanism);
}; };
/**
* GDBusAuthObserver:
*
* The #GDBusAuthObserver structure contains only private data and
* should only be accessed using the provided API.
*
* Since: 2.26
*/
struct _GDBusAuthObserver struct _GDBusAuthObserver
{ {
GObject parent_instance; GObject parent_instance;