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 it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your 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 Affero General Public License for more details.
17 * @author Martin Schanzenbach
20 * Plugin API for the idp database backend
22 * @defgroup identity-provider-plugin IdP service plugin API
23 * Plugin API for the idp database backend
26 #ifndef GNUNET_IDENTITY_PROVIDER_PLUGIN_H
27 #define GNUNET_IDENTITY_PROVIDER_PLUGIN_H
29 #include "gnunet_util_lib.h"
30 #include "gnunet_identity_provider_service.h"
35 #if 0 /* keep Emacsens' auto-indent happy */
42 * Function called by for each matching ticket.
45 * @param ticket the ticket
47 typedef void (*GNUNET_IDENTITY_PROVIDER_TicketIterator) (void *cls,
48 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket,
49 const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs);
53 * @brief struct returned by the initialization function of the plugin
55 struct GNUNET_IDENTITY_PROVIDER_PluginFunctions
59 * Closure to pass to all plugin functions.
64 * Store a ticket in the database.
66 * @param cls closure (internal context for the plugin)
67 * @param ticket the ticket to store
68 * @return #GNUNET_OK on success, else #GNUNET_SYSERR
70 int (*store_ticket) (void *cls,
71 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket,
72 const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs);
75 * Delete a ticket from the database.
77 * @param cls closure (internal context for the plugin)
78 * @param ticket the ticket to store
79 * @return #GNUNET_OK on success, else #GNUNET_SYSERR
81 int (*delete_ticket) (void *cls,
82 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket);
87 * Iterate over all tickets
89 * @param cls closure (internal context for the plugin)
90 * @param identity the identity
91 * @param audience GNUNET_YES if the identity is the audience of the ticket
92 * else it is considered the issuer
93 * @param iter function to call with the result
94 * @param iter_cls closure for @a iter
95 * @return #GNUNET_OK on success, #GNUNET_NO if there were no results, #GNUNET_SYSERR on error
97 int (*iterate_tickets) (void *cls,
98 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
101 GNUNET_IDENTITY_PROVIDER_TicketIterator iter, void *iter_cls);
103 int (*get_ticket_attributes) (void* cls,
104 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket,
105 GNUNET_IDENTITY_PROVIDER_TicketIterator iter,
109 #if 0 /* keep Emacsens' auto-indent happy */
118 /** @} */ /* end of group */