1 /* vi: set et sw=4 ts=4 cino=t0,(0: */
2 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
4 * This file is part of gsignond
6 * Copyright (C) 2012 Intel Corporation.
8 * Contact: Imran Zaman <imran.zaman@linux.intel.com>
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2.1 of the License, or (at your option) any later version.
15 * This library is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
26 #ifndef __GSIGNOND_DB_CREDENTIALS_DATABASE_H__
27 #define __GSIGNOND_DB_CREDENTIALS_DATABASE_H__
30 #include <glib-object.h>
31 #include "common/gsignond-identity-info.h"
32 #include <gsignond/gsignond-config.h>
33 #include <gsignond/gsignond-secret-storage.h>
35 #include "gsignond-db-metadata-database.h"
42 #define GSIGNOND_DB_TYPE_CREDENTIALS_DATABASE \
43 (gsignond_db_credentials_database_get_type ())
44 #define GSIGNOND_DB_CREDENTIALS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
45 GSIGNOND_DB_TYPE_CREDENTIALS_DATABASE, \
46 GSignondDbCredentialsDatabase))
47 #define GSIGNOND_DB_IS_CREDENTIALS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj),\
48 GSIGNOND_DB_TYPE_CREDENTIALS_DATABASE))
49 #define GSIGNOND_DB_CREDENTIALS_DATABASE_CLASS(klass) \
50 (G_TYPE_CHECK_CLASS_CAST ((klass), \
51 GSIGNOND_DB_TYPE_CREDENTIALS_DATABASE, \
52 GSignondDbCredentialsDatabaseClass))
53 #define GSIGNOND_DB_IS_CREDENTIALS_DATABASE_CLASS(klass) \
54 (G_TYPE_CHECK_CLASS_TYPE ((klass), \
55 GSIGNOND_DB_TYPE_CREDENTIALS_DATABASE))
56 #define GSIGNOND_DB_CREDENTIALS_DATABASE_GET_CLASS(obj) \
57 (G_TYPE_INSTANCE_GET_CLASS ((obj), \
58 GSIGNOND_DB_TYPE_CREDENTIALS_DATABASE, \
59 GSignondDbCredentialsDatabaseClass))
61 typedef struct _GSignondDbCredentialsDatabasePrivate
62 GSignondDbCredentialsDatabasePrivate;
66 GObject parent_instance;
69 GSignondConfig *config;
70 GSignondSecretStorage *secret_storage;
71 GSignondDbCredentialsDatabasePrivate *priv;
72 } GSignondDbCredentialsDatabase;
75 GObjectClass parent_class;
77 } GSignondDbCredentialsDatabaseClass;
79 /* used by GSIGNOND_DB_TYPE_CREDENTIALS_DATABASE */
81 gsignond_db_credentials_database_get_type (void);
83 GSignondDbCredentialsDatabase*
84 gsignond_db_credentials_database_new (
85 GSignondConfig *config,
86 GSignondSecretStorage *storage);
89 gsignond_db_credentials_database_open_secret_storage (
90 GSignondDbCredentialsDatabase *self);
93 gsignond_db_credentials_database_close_secret_storage (
94 GSignondDbCredentialsDatabase *self);
97 gsignond_db_credentials_database_is_open_secret_storage (
98 GSignondDbCredentialsDatabase *self);
101 gsignond_db_credentials_database_clear (
102 GSignondDbCredentialsDatabase *self);
104 GSignondIdentityInfo *
105 gsignond_db_credentials_database_load_identity (
106 GSignondDbCredentialsDatabase *self,
107 const guint32 identity_id,
108 gboolean query_secret);
110 GSignondIdentityInfoList *
111 gsignond_db_credentials_database_load_identities (
112 GSignondDbCredentialsDatabase *self,
113 GSignondDictionary *filter);
116 gsignond_db_credentials_database_update_identity (
117 GSignondDbCredentialsDatabase *self,
118 GSignondIdentityInfo* identity);
121 gsignond_db_credentials_database_remove_identity (
122 GSignondDbCredentialsDatabase *self,
123 const guint32 identity_id);
126 gsignond_db_credentials_database_check_secret (
127 GSignondDbCredentialsDatabase *self,
128 const guint32 identity_id,
129 const gchar *username,
130 const gchar *secret);
133 gsignond_db_credentials_database_load_data (
134 GSignondDbCredentialsDatabase *self,
135 const guint32 identity_id,
136 const gchar *method);
139 gsignond_db_credentials_database_update_data (
140 GSignondDbCredentialsDatabase *self,
141 const guint32 identity_id,
146 gsignond_db_credentials_database_remove_data (
147 GSignondDbCredentialsDatabase *self,
148 const guint32 identity_id,
149 const gchar *method);
152 gsignond_db_credentials_database_get_methods (
153 GSignondDbCredentialsDatabase *self,
154 const guint32 identity_id,
155 GSignondSecurityContext* sec_ctx);
158 gsignond_db_credentials_database_insert_reference (
159 GSignondDbCredentialsDatabase *self,
160 const guint32 identity_id,
161 const GSignondSecurityContext *ref_owner,
162 const gchar *reference);
164 gsignond_db_credentials_database_remove_reference (
165 GSignondDbCredentialsDatabase *self,
167 const GSignondSecurityContext *ref_owner,
168 const gchar *reference);
171 gsignond_db_credentials_database_get_references (
172 GSignondDbCredentialsDatabase *self,
174 const GSignondSecurityContext *ref_owner);
176 GSignondSecurityContextList *
177 gsignond_db_credentials_database_get_accesscontrol_list(
178 GSignondDbCredentialsDatabase *self,
179 const guint32 identity_id);
181 GSignondSecurityContext *
182 gsignond_db_credentials_database_get_owner(
183 GSignondDbCredentialsDatabase *self,
184 const guint32 identity_id);
186 GSignondSecurityContext *
187 gsignond_db_credentials_database_get_identity_owner (
188 GSignondDbCredentialsDatabase *self,
189 const guint32 identity_id);
192 gsignond_db_credentials_database_get_last_error (
193 GSignondDbCredentialsDatabase *self);
197 #endif /* __GSIGNOND_DB_CREDENTIALS_DATABASE_H__ */