gnunet-svn
[Top][All Lists]
Advanced

[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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]