2 This file is part of GNUnet
3 Copyright (C) 2012, 2013 GNUnet e.V.
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
22 * @author Martin Schanzenbach
25 * Plugin API for the idp database backend
27 * @defgroup identity-provider-plugin IdP service plugin API
28 * Plugin API for the idp database backend
31 #ifndef GNUNET_IDENTITY_PROVIDER_PLUGIN_H
32 #define GNUNET_IDENTITY_PROVIDER_PLUGIN_H
34 #include "gnunet_util_lib.h"
35 #include "gnunet_identity_provider_service.h"
40 #if 0 /* keep Emacsens' auto-indent happy */
47 * Function called by for each matching ticket.
50 * @param ticket the ticket
52 typedef void (*GNUNET_IDENTITY_PROVIDER_TicketIterator) (void *cls,
53 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket,
54 const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs);
58 * @brief struct returned by the initialization function of the plugin
60 struct GNUNET_IDENTITY_PROVIDER_PluginFunctions
64 * Closure to pass to all plugin functions.
69 * Store a ticket in the database.
71 * @param cls closure (internal context for the plugin)
72 * @param ticket the ticket to store
73 * @return #GNUNET_OK on success, else #GNUNET_SYSERR
75 int (*store_ticket) (void *cls,
76 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket,
77 const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs);
80 * Delete a ticket from the database.
82 * @param cls closure (internal context for the plugin)
83 * @param ticket the ticket to store
84 * @return #GNUNET_OK on success, else #GNUNET_SYSERR
86 int (*delete_ticket) (void *cls,
87 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket);
92 * Iterate over all tickets
94 * @param cls closure (internal context for the plugin)
95 * @param identity the identity
96 * @param audience GNUNET_YES if the identity is the audience of the ticket
97 * else it is considered the issuer
98 * @param iter function to call with the result
99 * @param iter_cls closure for @a iter
100 * @return #GNUNET_OK on success, #GNUNET_NO if there were no results, #GNUNET_SYSERR on error
102 int (*iterate_tickets) (void *cls,
103 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
106 GNUNET_IDENTITY_PROVIDER_TicketIterator iter, void *iter_cls);
108 int (*get_ticket_attributes) (void* cls,
109 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket,
110 GNUNET_IDENTITY_PROVIDER_TicketIterator iter,
114 #if 0 /* keep Emacsens' auto-indent happy */
123 /** @} */ /* end of group */