aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_identity_provider_plugin.h123
-rw-r--r--src/include/gnunet_identity_provider_service.h20
-rw-r--r--src/include/gnunet_protocols.h6
3 files changed, 143 insertions, 6 deletions
diff --git a/src/include/gnunet_identity_provider_plugin.h b/src/include/gnunet_identity_provider_plugin.h
new file mode 100644
index 000000000..5867a5b80
--- /dev/null
+++ b/src/include/gnunet_identity_provider_plugin.h
@@ -0,0 +1,123 @@
1/*
2 This file is part of GNUnet
3 Copyright (C) 2012, 2013 GNUnet e.V.
4
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.
9
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.
14
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.
19*/
20
21/**
22 * @author Martin Schanzenbach
23 *
24 * @file
25 * Plugin API for the idp database backend
26 *
27 * @defgroup identity-provider-plugin IdP service plugin API
28 * Plugin API for the idp database backend
29 * @{
30 */
31#ifndef GNUNET_IDENTITY_PROVIDER_PLUGIN_H
32#define GNUNET_IDENTITY_PROVIDER_PLUGIN_H
33
34#include "gnunet_util_lib.h"
35#include "gnunet_identity_provider_service.h"
36
37#ifdef __cplusplus
38extern "C"
39{
40#if 0 /* keep Emacsens' auto-indent happy */
41}
42#endif
43#endif
44
45
46/**
47 * Function called by for each matching ticket.
48 *
49 * @param cls closure
50 * @param ticket the ticket
51 * @prarm attrs the attributes
52 */
53typedef void (*GNUNET_IDENTITY_PROVIDER_TicketIterator) (void *cls,
54 const struct GNUNET_IDENTITY_PROVIDER_Ticket2 *ticket,
55 const struct GNUNET_IDENTITY_PROVIDER_AttributeList *attrs);
56
57
58/**
59 * @brief struct returned by the initialization function of the plugin
60 */
61struct GNUNET_IDENTITY_PROVIDER_PluginFunctions
62{
63
64 /**
65 * Closure to pass to all plugin functions.
66 */
67 void *cls;
68
69 /**
70 * Store a ticket in the database.
71 *
72 * @param cls closure (internal context for the plugin)
73 * @param ticket the ticket to store
74 * @param attrs the attributes shared with the ticket
75 * @return #GNUNET_OK on success, else #GNUNET_SYSERR
76 */
77 int (*store_ticket) (void *cls,
78 const struct GNUNET_IDENTITY_PROVIDER_Ticket2 *ticket,
79 const struct GNUNET_IDENTITY_PROVIDER_AttributeList *attrs);
80
81 /**
82 * Delete a ticket from the database.
83 *
84 * @param cls closure (internal context for the plugin)
85 * @param ticket the ticket to store
86 * @return #GNUNET_OK on success, else #GNUNET_SYSERR
87 */
88 int (*delete_ticket) (void *cls,
89 const struct GNUNET_IDENTITY_PROVIDER_Ticket2 *ticket);
90
91
92
93 /**
94 * Iterate over all tickets
95 *
96 * @param cls closure (internal context for the plugin)
97 * @param identity the identity
98 * @param audience GNUNET_YES if the identity is the audience of the ticket
99 * else it is considered the issuer
100 * @param iter function to call with the result
101 * @param iter_cls closure for @a iter
102 * @return #GNUNET_OK on success, #GNUNET_NO if there were no results, #GNUNET_SYSERR on error
103 */
104 int (*iterate_tickets) (void *cls,
105 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
106 int audience,
107 uint64_t offset,
108 GNUNET_IDENTITY_PROVIDER_TicketIterator iter, void *iter_cls);
109
110
111};
112
113
114#if 0 /* keep Emacsens' auto-indent happy */
115{
116#endif
117#ifdef __cplusplus
118}
119#endif
120
121#endif
122
123/** @} */ /* end of group */
diff --git a/src/include/gnunet_identity_provider_service.h b/src/include/gnunet_identity_provider_service.h
index 049f891cc..02cd15959 100644
--- a/src/include/gnunet_identity_provider_service.h
+++ b/src/include/gnunet_identity_provider_service.h
@@ -336,17 +336,25 @@ GNUNET_IDENTITY_PROVIDER_get_attributes_stop (struct GNUNET_IDENTITY_PROVIDER_At
336 * token 336 * token
337 * 337 *
338 * @param cls closure 338 * @param cls closure
339 * @param grant the label in GNS pointing to the token
340 * @param ticket the ticket 339 * @param ticket the ticket
341 * @param token the issued token
342 * @param name name assigned by the user for this ego,
343 * NULL if the user just deleted the ego and it
344 * must thus no longer be used
345 */ 340 */
346typedef void 341typedef void
347(*GNUNET_IDENTITY_PROVIDER_TicketCallback)(void *cls, 342(*GNUNET_IDENTITY_PROVIDER_TicketCallback)(void *cls,
348 const struct GNUNET_IDENTITY_PROVIDER_Ticket2 *ticket); 343 const struct GNUNET_IDENTITY_PROVIDER_Ticket2 *ticket);
349 344
345/**
346 * Method called when issued tickets are retrieved. Also returns the attributes
347 * that were issued at the time.
348 *
349 * @param cls closure
350 * @param ticket the ticket
351 * @param attrs the attributes as list
352 */
353typedef void
354(*GNUNET_IDENTITY_PROVIDER_TicketResult)(void *cls,
355 const struct GNUNET_IDENTITY_PROVIDER_Ticket2 *ticket,
356 const struct GNUNET_IDENTITY_PROVIDER_AttributeList *attrs);
357
350 358
351/** 359/**
352 * Issues a ticket to another identity. The identity may use 360 * Issues a ticket to another identity. The identity may use
@@ -389,7 +397,7 @@ GNUNET_IDENTITY_PROVIDER_idp_ticket_revoke (struct GNUNET_IDENTITY_PROVIDER_Hand
389 397
390 398
391 399
392/** TODO 400/**
393 * Consumes an issued ticket. The ticket is persisted 401 * Consumes an issued ticket. The ticket is persisted
394 * and used to retrieve identity information from the issuer 402 * and used to retrieve identity information from the issuer
395 * 403 *
diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h
index 63afeba8d..743a28946 100644
--- a/src/include/gnunet_protocols.h
+++ b/src/include/gnunet_protocols.h
@@ -2646,6 +2646,12 @@ extern "C"
2646 2646
2647#define GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_CONSUME_TICKET 973 2647#define GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_CONSUME_TICKET 973
2648 2648
2649#define GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ITERATION_START 974
2650
2651#define GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ITERATION_STOP 975
2652
2653#define GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ITERATION_NEXT 976
2654
2649/************************************************** 2655/**************************************************
2650 * 2656 *
2651 * CREDENTIAL MESSAGE TYPES 2657 * CREDENTIAL MESSAGE TYPES