GSignondSecretStorage

GSignondSecretStorage — provides access to the database that stores user credentials and identity/method cache

Synopsis

#include <gsignond/gsignond-secret-storage.h>

                    GSignondSecretStorage;
                    GSignondSecretStorageClass;
gboolean            gsignond_secret_storage_check_credentials
                                                        (GSignondSecretStorage *self,
                                                         GSignondCredentials *creds);
gboolean            gsignond_secret_storage_clear_db    (GSignondSecretStorage *self);
gboolean            gsignond_secret_storage_close_db    (GSignondSecretStorage *self);
const GError *      gsignond_secret_storage_get_last_error
                                                        (GSignondSecretStorage *self);
gboolean            gsignond_secret_storage_is_open_db  (GSignondSecretStorage *self);
GSignondCredentials * gsignond_secret_storage_load_credentials
                                                        (GSignondSecretStorage *self,
                                                         const guint32 id);
GHashTable *        gsignond_secret_storage_load_data   (GSignondSecretStorage *self,
                                                         const guint32 id,
                                                         const guint32 method);
gboolean            gsignond_secret_storage_open_db     (GSignondSecretStorage *self);
gboolean            gsignond_secret_storage_remove_credentials
                                                        (GSignondSecretStorage *self,
                                                         const guint32 id);
gboolean            gsignond_secret_storage_remove_data (GSignondSecretStorage *self,
                                                         const guint32 id,
                                                         const guint32 method);
gboolean            gsignond_secret_storage_update_credentials
                                                        (GSignondSecretStorage *self,
                                                         GSignondCredentials *creds);
gboolean            gsignond_secret_storage_update_data (GSignondSecretStorage *self,
                                                         const guint32 id,
                                                         const guint32 method,
                                                         GHashTable *data);

Object Hierarchy

  GObject
   +----GSignondSecretStorage

Properties

  "config"                   GSignondConfig*       : Read / Write / Construct Only

Description

GSignondSecretStorage provides access to the database where sensitive identity data (GSignondCredentials) and identity/method cache are stored. It's preferred that this database is protected against access by processes other than gSSO.

gSSO can be configured to use a custom extension that provides a subclassed implementation of GSignondSecretStorage (see GSignondExtension), otherwise a default implementation is used.

Details

GSignondSecretStorage

typedef struct _GSignondSecretStorage GSignondSecretStorage;

Opaque GSignondSecretStorage data structure.


GSignondSecretStorageClass

typedef struct {
    GObjectClass parent_class;

    gboolean
    (*open_db) (GSignondSecretStorage *self);

    gboolean
    (*close_db) (GSignondSecretStorage *self);

    gboolean
    (*clear_db) (GSignondSecretStorage *self);

    gboolean
    (*is_open_db) (GSignondSecretStorage *self);

    GSignondCredentials*
    (*load_credentials) (
            GSignondSecretStorage *self,
            const guint32 id);

    gboolean
    (*update_credentials) (
            GSignondSecretStorage *self,
            GSignondCredentials* creds);

    gboolean
    (*remove_credentials) (
            GSignondSecretStorage *self,
            const guint32 id);

    gboolean
    (*check_credentials) (
            GSignondSecretStorage *self,
            GSignondCredentials* creds);

    GSignondDictionary*
    (*load_data) (
            GSignondSecretStorage *self,
            const guint32 id,
            const guint32 method);

    gboolean
    (*update_data) (
            GSignondSecretStorage *self,
            const guint32 id,
            const guint32 method,
            GSignondDictionary *data);

    gboolean
    (*remove_data) (
            GSignondSecretStorage *self,
            const guint32 id,
            const guint32 method);

    const GError*
    (*get_last_error) (GSignondSecretStorage *self);
} GSignondSecretStorageClass;

GSignondSecretStorageClass class containing pointers to class methods.

GObjectClass parent_class;

parent class.

open_db ()

an implementation of gsignond_secret_storage_open_db()

close_db ()

an implementation of gsignond_secret_storage_close_db()

clear_db ()

an implementation of gsignond_secret_storage_clear_db()

is_open_db ()

an implementation of gsignond_secret_storage_is_open_db()

load_credentials ()

an implementation of gsignond_secret_storage_load_credentials()

update_credentials ()

an implementation of gsignond_secret_storage_update_credentials()

remove_credentials ()

an implementation of gsignond_secret_storage_remove_credentials()

check_credentials ()

an implementation of gsignond_secret_storage_check_credentials()

load_data ()

an implementation of gsignond_secret_storage_load_data()

update_data ()

an implementation of gsignond_secret_storage_update_data()

remove_data ()

an implementation of gsignond_secret_storage_remove_data()

get_last_error ()

an implementation of gsignond_secret_storage_get_last_error()

gsignond_secret_storage_check_credentials ()

gboolean            gsignond_secret_storage_check_credentials
                                                        (GSignondSecretStorage *self,
                                                         GSignondCredentials *creds);

Checks whether the given credentials match what is stored in the database.

self :

instance of GSignondSecretStorage

creds :

the credentials that are being checked. [transfer none]

Returns :

TRUE if successful, FALSE otherwise.

gsignond_secret_storage_clear_db ()

gboolean            gsignond_secret_storage_clear_db    (GSignondSecretStorage *self);

Removes all stored secrets from the database.

self :

instance of GSignondSecretStorage

Returns :

TRUE if successful, FALSE otherwise.

gsignond_secret_storage_close_db ()

gboolean            gsignond_secret_storage_close_db    (GSignondSecretStorage *self);

Closes the database. To reopen it, call gsignond_secret_storage_open_db().

self :

instance of GSignondSecretStorage

Returns :

TRUE if successful, FALSE otherwise.

gsignond_secret_storage_get_last_error ()

const GError *      gsignond_secret_storage_get_last_error
                                                        (GSignondSecretStorage *self);

Retrieves the last occurred error that has occured

self :

instance of GSignondSecretStorage

Returns :

last occurred GError. [transfer none]

gsignond_secret_storage_is_open_db ()

gboolean            gsignond_secret_storage_is_open_db  (GSignondSecretStorage *self);

Checks if the database is open or not.

self :

instance of GSignondSecretStorage

Returns :

TRUE if successful, FALSE otherwise.

gsignond_secret_storage_load_credentials ()

GSignondCredentials * gsignond_secret_storage_load_credentials
                                                        (GSignondSecretStorage *self,
                                                         const guint32 id);

Loads the credentials from the database.

self :

instance of GSignondSecretStorage

id :

the identity id whose credentials are being loaded.

Returns :

GSignondCredentials if successful, NULL otherwise. [transfer full]

gsignond_secret_storage_load_data ()

GHashTable *        gsignond_secret_storage_load_data   (GSignondSecretStorage *self,
                                                         const guint32 id,
                                                         const guint32 method);

Loads the secret data associated with a given identity and method.

self :

instance of GSignondSecretStorage

id :

the identity id whose data are fetched

method :

the authentication method the data is used for.

Returns :

the secret data. [transfer full]

gsignond_secret_storage_open_db ()

gboolean            gsignond_secret_storage_open_db     (GSignondSecretStorage *self);

Opens (and initializes) the database. The implementation should take care of creating the DB, if it doesn't exist, and it should use GSIGNOND_CONFIG_GENERAL_SECURE_DIR and GSIGNOND_CONFIG_DB_SECRET_DB_FILENAME to determine database location in the filesystem.

The default implementation is using SQLite for the storage.

self :

instance of GSignondSecretStorage

Returns :

TRUE if successful, FALSE otherwise.

gsignond_secret_storage_remove_credentials ()

gboolean            gsignond_secret_storage_remove_credentials
                                                        (GSignondSecretStorage *self,
                                                         const guint32 id);

Remove the credentials for the given identity.

self :

instance of GSignondSecretStorage

id :

the identity whose credentials are being updated.

Returns :

TRUE if successful, FALSE otherwise.

gsignond_secret_storage_remove_data ()

gboolean            gsignond_secret_storage_remove_data (GSignondSecretStorage *self,
                                                         const guint32 id,
                                                         const guint32 method);

Removes secret data associated with a given id/method.

self :

instance of GSignondSecretStorage

id :

the identity whose data are fetched.

method :

the authentication method the data is used for.

Returns :

TRUE if successful, FALSE otherwise.

gsignond_secret_storage_update_credentials ()

gboolean            gsignond_secret_storage_update_credentials
                                                        (GSignondSecretStorage *self,
                                                         GSignondCredentials *creds);

Stores/updates the credentials for the given identity.

self :

instance of GSignondSecretStorage

creds :

the credentials that are being updated. [transfer none]

Returns :

TRUE if successful, FALSE otherwise.

gsignond_secret_storage_update_data ()

gboolean            gsignond_secret_storage_update_data (GSignondSecretStorage *self,
                                                         const guint32 id,
                                                         const guint32 method,
                                                         GHashTable *data);

Calling this method updates the secret data associated with the given id/method.

self :

instance of GSignondSecretStorage

id :

the identity whose data are fetched.

method :

the authentication method the data is used for.

data :

the data to update. [transfer none]

Returns :

TRUE if successful, FALSE otherwise.

Property Details

The "config" property

  "config"                   GSignondConfig*       : Read / Write / Construct Only

Configuration object.