| Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
| Safe Haskell | None |
| Language | Haskell2010 |
GI.Gio.Objects.DBusAuthObserver
Contents
Description
The DBusAuthObserver type provides a mechanism for participating
in how a DBusServer (or a DBusConnection) authenticates remote
peers. Simply instantiate a DBusAuthObserver and connect to the
signals you are interested in. Note that new signals may be added
in the future
For example, if you only want to allow D-Bus connections from processes owned by the same uid as the server, you would use a signal handler like the following:
C code
static gboolean
on_authorize_authenticated_peer (GDBusAuthObserver *observer,
GIOStream *stream,
GCredentials *credentials,
gpointer user_data)
{
gboolean authorized;
authorized = FALSE;
if (credentials != NULL)
{
GCredentials *own_credentials;
own_credentials = g_credentials_new ();
if (g_credentials_is_same_user (credentials, own_credentials, NULL))
authorized = TRUE;
g_object_unref (own_credentials);
}
return authorized;
}- newtype DBusAuthObserver = DBusAuthObserver (ManagedPtr DBusAuthObserver)
- class GObject o => IsDBusAuthObserver o
- toDBusAuthObserver :: IsDBusAuthObserver o => o -> IO DBusAuthObserver
- noDBusAuthObserver :: Maybe DBusAuthObserver
- data DBusAuthObserverAllowMechanismMethodInfo
- dBusAuthObserverAllowMechanism :: (HasCallStack, MonadIO m, IsDBusAuthObserver a) => a -> Text -> m Bool
- data DBusAuthObserverAuthorizeAuthenticatedPeerMethodInfo
- dBusAuthObserverAuthorizeAuthenticatedPeer :: (HasCallStack, MonadIO m, IsDBusAuthObserver a, IsIOStream b, IsCredentials c) => a -> b -> Maybe c -> m Bool
- dBusAuthObserverNew :: (HasCallStack, MonadIO m) => m DBusAuthObserver
- type C_DBusAuthObserverAllowMechanismCallback = Ptr () -> CString -> Ptr () -> IO CInt
- type DBusAuthObserverAllowMechanismCallback = Text -> IO Bool
- data DBusAuthObserverAllowMechanismSignalInfo
- afterDBusAuthObserverAllowMechanism :: (GObject a, MonadIO m) => a -> DBusAuthObserverAllowMechanismCallback -> m SignalHandlerId
- genClosure_DBusAuthObserverAllowMechanism :: DBusAuthObserverAllowMechanismCallback -> IO Closure
- mk_DBusAuthObserverAllowMechanismCallback :: C_DBusAuthObserverAllowMechanismCallback -> IO (FunPtr C_DBusAuthObserverAllowMechanismCallback)
- noDBusAuthObserverAllowMechanismCallback :: Maybe DBusAuthObserverAllowMechanismCallback
- onDBusAuthObserverAllowMechanism :: (GObject a, MonadIO m) => a -> DBusAuthObserverAllowMechanismCallback -> m SignalHandlerId
- wrap_DBusAuthObserverAllowMechanismCallback :: DBusAuthObserverAllowMechanismCallback -> Ptr () -> CString -> Ptr () -> IO CInt
- type C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback = Ptr () -> Ptr IOStream -> Ptr Credentials -> Ptr () -> IO CInt
- type DBusAuthObserverAuthorizeAuthenticatedPeerCallback = IOStream -> Maybe Credentials -> IO Bool
- data DBusAuthObserverAuthorizeAuthenticatedPeerSignalInfo
- afterDBusAuthObserverAuthorizeAuthenticatedPeer :: (GObject a, MonadIO m) => a -> DBusAuthObserverAuthorizeAuthenticatedPeerCallback -> m SignalHandlerId
- genClosure_DBusAuthObserverAuthorizeAuthenticatedPeer :: DBusAuthObserverAuthorizeAuthenticatedPeerCallback -> IO Closure
- mk_DBusAuthObserverAuthorizeAuthenticatedPeerCallback :: C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback -> IO (FunPtr C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback)
- noDBusAuthObserverAuthorizeAuthenticatedPeerCallback :: Maybe DBusAuthObserverAuthorizeAuthenticatedPeerCallback
- onDBusAuthObserverAuthorizeAuthenticatedPeer :: (GObject a, MonadIO m) => a -> DBusAuthObserverAuthorizeAuthenticatedPeerCallback -> m SignalHandlerId
- wrap_DBusAuthObserverAuthorizeAuthenticatedPeerCallback :: DBusAuthObserverAuthorizeAuthenticatedPeerCallback -> Ptr () -> Ptr IOStream -> Ptr Credentials -> Ptr () -> IO CInt
Exported types
newtype DBusAuthObserver Source #
Constructors
| DBusAuthObserver (ManagedPtr DBusAuthObserver) |
Instances
| GObject DBusAuthObserver Source # | |
| IsObject DBusAuthObserver Source # | |
| IsDBusAuthObserver DBusAuthObserver Source # | |
| ((~) * info (ResolveDBusAuthObserverMethod t DBusAuthObserver), MethodInfo * info DBusAuthObserver p) => IsLabel t (DBusAuthObserver -> p) Source # | |
| ((~) * info (ResolveDBusAuthObserverMethod t DBusAuthObserver), MethodInfo * info DBusAuthObserver p) => IsLabelProxy t (DBusAuthObserver -> p) Source # | |
| HasAttributeList * DBusAuthObserver Source # | |
| type AttributeList DBusAuthObserver Source # | |
| type SignalList DBusAuthObserver Source # | |
class GObject o => IsDBusAuthObserver o Source #
Instances
toDBusAuthObserver :: IsDBusAuthObserver o => o -> IO DBusAuthObserver Source #
Methods
allowMechanism
data DBusAuthObserverAllowMechanismMethodInfo Source #
Instances
| ((~) * signature (Text -> m Bool), MonadIO m, IsDBusAuthObserver a) => MethodInfo * DBusAuthObserverAllowMechanismMethodInfo a signature Source # | |
dBusAuthObserverAllowMechanism Source #
Arguments
| :: (HasCallStack, MonadIO m, IsDBusAuthObserver a) | |
| => a |
|
| -> Text |
|
| -> m Bool | Returns: |
Emits the DBusAuthObserver::allow-mechanism signal on observer.
Since: 2.34
authorizeAuthenticatedPeer
data DBusAuthObserverAuthorizeAuthenticatedPeerMethodInfo Source #
Instances
| ((~) * signature (b -> Maybe c -> m Bool), MonadIO m, IsDBusAuthObserver a, IsIOStream b, IsCredentials c) => MethodInfo * DBusAuthObserverAuthorizeAuthenticatedPeerMethodInfo a signature Source # | |
dBusAuthObserverAuthorizeAuthenticatedPeer Source #
Arguments
| :: (HasCallStack, MonadIO m, IsDBusAuthObserver a, IsIOStream b, IsCredentials c) | |
| => a |
|
| -> b |
|
| -> Maybe c |
|
| -> m Bool |
Emits the DBusAuthObserver::authorize-authenticated-peer signal on observer.
Since: 2.26
new
Arguments
| :: (HasCallStack, MonadIO m) | |
| => m DBusAuthObserver | Returns: A |
Creates a new DBusAuthObserver object.
Since: 2.26
Signals
allowMechanism
afterDBusAuthObserverAllowMechanism :: (GObject a, MonadIO m) => a -> DBusAuthObserverAllowMechanismCallback -> m SignalHandlerId Source #
genClosure_DBusAuthObserverAllowMechanism :: DBusAuthObserverAllowMechanismCallback -> IO Closure Source #
mk_DBusAuthObserverAllowMechanismCallback :: C_DBusAuthObserverAllowMechanismCallback -> IO (FunPtr C_DBusAuthObserverAllowMechanismCallback) Source #
onDBusAuthObserverAllowMechanism :: (GObject a, MonadIO m) => a -> DBusAuthObserverAllowMechanismCallback -> m SignalHandlerId Source #
wrap_DBusAuthObserverAllowMechanismCallback :: DBusAuthObserverAllowMechanismCallback -> Ptr () -> CString -> Ptr () -> IO CInt Source #
authorizeAuthenticatedPeer
type C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback = Ptr () -> Ptr IOStream -> Ptr Credentials -> Ptr () -> IO CInt Source #
type DBusAuthObserverAuthorizeAuthenticatedPeerCallback = IOStream -> Maybe Credentials -> IO Bool Source #
afterDBusAuthObserverAuthorizeAuthenticatedPeer :: (GObject a, MonadIO m) => a -> DBusAuthObserverAuthorizeAuthenticatedPeerCallback -> m SignalHandlerId Source #
genClosure_DBusAuthObserverAuthorizeAuthenticatedPeer :: DBusAuthObserverAuthorizeAuthenticatedPeerCallback -> IO Closure Source #
mk_DBusAuthObserverAuthorizeAuthenticatedPeerCallback :: C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback -> IO (FunPtr C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback) Source #
noDBusAuthObserverAuthorizeAuthenticatedPeerCallback :: Maybe DBusAuthObserverAuthorizeAuthenticatedPeerCallback Source #