[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] 01/25: Adapted Namestore and reclaim REST
From: |
gnunet |
Subject: |
[gnunet] 01/25: Adapted Namestore and reclaim REST |
Date: |
Mon, 13 Jan 2020 13:46:46 +0100 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a commit to branch master
in repository gnunet.
commit 60d2660de243053bc0f41657ad9d67537723276c
Author: Markus Voggenreiter <address@hidden>
AuthorDate: Wed Oct 9 19:51:40 2019 +0200
Adapted Namestore and reclaim REST
---
src/include/gnunet_gnsrecord_lib.h | 5 ++++
src/reclaim/plugin_gnsrecord_reclaim.c | 3 +++
src/reclaim/plugin_rest_reclaim.c | 43 ++++++++++++++++++++++++++++++++++
3 files changed, 51 insertions(+)
diff --git a/src/include/gnunet_gnsrecord_lib.h
b/src/include/gnunet_gnsrecord_lib.h
index 3a49d98b9..41e23e1ab 100644
--- a/src/include/gnunet_gnsrecord_lib.h
+++ b/src/include/gnunet_gnsrecord_lib.h
@@ -140,6 +140,11 @@ extern "C" {
*/
#define GNUNET_GNSRECORD_TYPE_RECLAIM_OIDC_REDIRECT 65553
+/**
+ * Record type for reclaim attestation records
+ */
+#define GNUNET_GNSRECORD_TYPE_RECLAIM_ATTEST_ATTR 65554
+
/**
* Flags that can be set for a record.
*/
diff --git a/src/reclaim/plugin_gnsrecord_reclaim.c
b/src/reclaim/plugin_gnsrecord_reclaim.c
index d530ef01d..58345edc4 100644
--- a/src/reclaim/plugin_gnsrecord_reclaim.c
+++ b/src/reclaim/plugin_gnsrecord_reclaim.c
@@ -54,6 +54,7 @@ value_to_string (void *cls, uint32_t type, const void *data,
size_t data_size)
case GNUNET_GNSRECORD_TYPE_RECLAIM_ATTR_REF:
case GNUNET_GNSRECORD_TYPE_RECLAIM_TICKET:
case GNUNET_GNSRECORD_TYPE_RECLAIM_MASTER:
+ case GNUNET_GNSRECORD_TYPE_RECLAIM_ATTEST_ATTR:
return GNUNET_STRINGS_data_to_string_alloc (data, data_size);
default:
@@ -93,6 +94,7 @@ string_to_value (void *cls, uint32_t type, const char *s,
void **data,
case GNUNET_GNSRECORD_TYPE_RECLAIM_ATTR_REF:
case GNUNET_GNSRECORD_TYPE_RECLAIM_MASTER:
case GNUNET_GNSRECORD_TYPE_RECLAIM_TICKET:
+ case GNUNET_GNSRECORD_TYPE_RECLAIM_ATTEST_ATTR:
return GNUNET_STRINGS_string_to_data (s, strlen (s), *data, *data_size);
default:
@@ -112,6 +114,7 @@ static struct
} name_map[] = {
{ "RECLAIM_ATTR", GNUNET_GNSRECORD_TYPE_RECLAIM_ATTR },
{ "RECLAIM_ATTR_REF", GNUNET_GNSRECORD_TYPE_RECLAIM_ATTR_REF },
+ { "RECLAIM_ATTEST", GNUNET_GNSRECORD_TYPE_RECLAIM_ATTEST_ATTR },
{ "RECLAIM_MASTER", GNUNET_GNSRECORD_TYPE_RECLAIM_MASTER },
{ "RECLAIM_OIDC_CLIENT", GNUNET_GNSRECORD_TYPE_RECLAIM_OIDC_CLIENT },
{ "RECLAIM_OIDC_REDIRECT", GNUNET_GNSRECORD_TYPE_RECLAIM_OIDC_REDIRECT },
diff --git a/src/reclaim/plugin_rest_reclaim.c
b/src/reclaim/plugin_rest_reclaim.c
index 9a75b2d16..c58b1560b 100644
--- a/src/reclaim/plugin_rest_reclaim.c
+++ b/src/reclaim/plugin_rest_reclaim.c
@@ -48,6 +48,11 @@
*/
#define GNUNET_REST_API_NS_RECLAIM_ATTRIBUTES "/reclaim/attributes"
+/**
+ * Attestation namespace
+ */
+#define GNUNET_REST_API_NS_RECLAIM_ATTESTATION_REFERENCE "/reclaim/attestation"
+
/**
* Ticket namespace
*/
@@ -432,7 +437,36 @@ ticket_collect (void *cls, const struct
GNUNET_RECLAIM_Ticket *ticket)
GNUNET_free (tmp);
GNUNET_RECLAIM_ticket_iteration_next (handle->ticket_it);
}
+static void
+add_attestation_cont (struct GNUNET_REST_RequestHandle *con_handle,
+ const char *url,
+ void *cls)
+{
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Adding Attestations not supported\n");
+ GNUNET_SCHEDULER_add_now (&do_error, handle);
+ return;
+}
+/*Placeholder*/
+static void
+list_attestation_cont (struct GNUNET_REST_RequestHandle *con_handle,
+ const char *url,
+ void *cls)
+{
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Listing Attestations not supported\n");
+ GNUNET_SCHEDULER_add_now (&do_error, handle);
+ return;
+}
+/*Placeholder*/
+static void
+delete_attestation_cont (struct GNUNET_REST_RequestHandle *con_handle,
+ const char *url,
+ void *cls)
+{
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Deleting Attestations not
supported\n");
+ GNUNET_SCHEDULER_add_now (&do_error, handle);
+ return;
+}
/**
* List tickets for identity request
@@ -968,6 +1002,15 @@ init_cont (struct RequestHandle *handle)
{ MHD_HTTP_METHOD_DELETE,
GNUNET_REST_API_NS_RECLAIM_ATTRIBUTES,
&delete_attribute_cont },
+ { MHD_HTTP_METHOD_GET,
+ GNUNET_REST_API_NS_RECLAIM_ATTESTATION_REFERENCE,
+ &list_attestation_cont },
+ { MHD_HTTP_METHOD_POST,
+ GNUNET_REST_API_NS_RECLAIM_ATTESTATION_REFERENCE,
+ &add_attestation_cont },
+ { MHD_HTTP_METHOD_DELETE,
+ GNUNET_REST_API_NS_RECLAIM_ATTESTATION_REFERENCE,
+ &delete_attestation_cont },
{ MHD_HTTP_METHOD_GET,
GNUNET_REST_API_NS_IDENTITY_TICKETS,
&list_tickets_cont },
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnunet] branch master updated (c0a6838a1 -> e52520756), gnunet, 2020/01/13
- [gnunet] 03/25: Initial Fixes of plugin, gnunet, 2020/01/13
- [gnunet] 01/25: Adapted Namestore and reclaim REST,
gnunet <=
- [gnunet] 02/25: Adapted JSON Conversion and Serialization, gnunet, 2020/01/13
- [gnunet] 04/25: Fixed direct Namestore Access, gnunet, 2020/01/13
- [gnunet] 05/25: Direct Namestore Deletion Implemented, gnunet, 2020/01/13
- [gnunet] 06/25: Add Attestations via Reclaim Service, gnunet, 2020/01/13
- [gnunet] 07/25: Delete Attestation via Service, gnunet, 2020/01/13
- [gnunet] 08/25: Prepare Listing Attestations, gnunet, 2020/01/13
- [gnunet] 10/25: some comments, gnunet, 2020/01/13
- [gnunet] 09/25: Listing Attestations through service, gnunet, 2020/01/13
- [gnunet] 11/25: Preparation for Reference Type, gnunet, 2020/01/13
- [gnunet] 12/25: Adding Reference Type Implemented, gnunet, 2020/01/13