GSignondSecretStorage

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

Functions

Includes

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

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.

Functions

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 to determine database location in the filesystem.

The default implementation is using SQLite for the storage.

Parameters

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().

Parameters

self

instance of GSignondSecretStorage

 

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.

Parameters

self

instance of GSignondSecretStorage

 

Returns

TRUE if successful, FALSE otherwise.


gsignond_secret_storage_is_open_db ()

gboolean
gsignond_secret_storage_is_open_db (GSignondSecretStorage *self);

Checks if the database is open or not.

Parameters

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.

Parameters

self

instance of GSignondSecretStorage

 

id

the identity id whose credentials are being loaded.

 

Returns

GSignondCredentials if successful, NULL otherwise.

[transfer full][nullable]


gsignond_secret_storage_update_credentials ()

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

Stores/updates the credentials for the given identity.

Parameters

self

instance of GSignondSecretStorage

 

creds

the credentials that are being updated.

[transfer none]

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.

Parameters

self

instance of GSignondSecretStorage

 

id

the identity whose credentials are being updated.

 

Returns

TRUE if successful, FALSE otherwise.


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.

Parameters

self

instance of GSignondSecretStorage

 

creds

the credentials that are being checked.

[transfer none]

Returns

TRUE if successful, FALSE otherwise.


gsignond_secret_storage_load_data ()

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

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

Parameters

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_update_data ()

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

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

Parameters

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.


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.

Parameters

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_get_last_error ()

const GError *
gsignond_secret_storage_get_last_error
                               (GSignondSecretStorage *self);

Retrieves the last occurred error that has occurred

Parameters

self

instance of GSignondSecretStorage

 

Returns

last occurred GError.

[transfer none]