gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] branch master updated (bcda92da2 -> 89485145a)


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated (bcda92da2 -> 89485145a)
Date: Sun, 12 Aug 2018 01:47:06 +0200

This is an automated email from the git hooks/post-receive script.

phil pushed a change to branch master
in repository gnunet.

    from bcda92da2 added additional namespaces in identity rest api
     new 4898de509 split namespace of put request in identity rest api
     new 89485145a rewrite error handling and subsystem PUT

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/identity/plugin_rest_identity.c       | 294 +++++++++++++++++++-----------
 src/identity/test_plugin_rest_identity.sh |  15 +-
 2 files changed, 196 insertions(+), 113 deletions(-)

diff --git a/src/identity/plugin_rest_identity.c 
b/src/identity/plugin_rest_identity.c
index 9a05a2054..9f1765a63 100644
--- a/src/identity/plugin_rest_identity.c
+++ b/src/identity/plugin_rest_identity.c
@@ -77,12 +77,22 @@
 /**
  * Error message Unknown Error
  */
-#define GNUNET_REST_IDENTITY_ERROR_UNKNOWN "Unknown error"
+#define GNUNET_REST_IDENTITY_ERROR_UNKNOWN "Unknown Error"
 
 /**
- * Error message Resource location invalid
+ * Error message No identity found
  */
-#define GNUNET_REST_ERROR_RESOURCE_INVALID "Resource location invalid"
+#define GNUNET_REST_IDENTITY_NOT_FOUND "No identity found"
+
+/**
+ * Error message Missing identity name
+ */
+#define GNUNET_REST_IDENTITY_MISSING_NAME "Missing identity name"
+
+/**
+ * Error message Missing identity name
+ */
+#define GNUNET_REST_IDENTITY_MISSING_PUBKEY "Missing identity public key"
 
 /**
  * Error message No data
@@ -235,7 +245,7 @@ struct RequestHandle
   char *emsg;
 
   /**
-   * Reponse code
+   * Response code
    */
   int response_code;
 
@@ -373,7 +383,8 @@ ego_get_for_subsystem (void *cls,
 
   if(NULL == ego)
   {
-    handle->emsg = GNUNET_strdup("No identity found for subsystem");
+    handle->response_code = MHD_HTTP_NOT_FOUND;
+    handle->emsg = GNUNET_strdup(GNUNET_REST_IDENTITY_NOT_FOUND);
     GNUNET_SCHEDULER_add_now (&do_error, handle);
     return;
   }
@@ -418,7 +429,7 @@ ego_get_subsystem (struct GNUNET_REST_RequestHandle 
*con_handle,
 
   if (strlen (GNUNET_REST_API_NS_IDENTITY_SUBSYSTEM) >= strlen (handle->url))
   {
-    handle->emsg = GNUNET_strdup("Missing subsystem");
+    handle->emsg = GNUNET_strdup("Missing subsystem name");
     GNUNET_SCHEDULER_add_now (&do_error, handle);
     return;
   }
@@ -434,7 +445,8 @@ ego_get_subsystem (struct GNUNET_REST_RequestHandle 
*con_handle,
 
   if (NULL == handle->op)
   {
-    handle->emsg = GNUNET_strdup("No identity found for subsystem");
+    handle->response_code = MHD_HTTP_NOT_FOUND;
+    handle->emsg = GNUNET_strdup(GNUNET_REST_IDENTITY_NOT_FOUND);
     GNUNET_SCHEDULER_add_now (&do_error, handle);
     return;
   }
@@ -479,7 +491,8 @@ ego_get_all (struct GNUNET_REST_RequestHandle *con_handle,
   if ((size_t) 0 == json_array_size (json_root))
   {
     json_decref (json_root);
-    handle->emsg = GNUNET_strdup("No identities found!");
+    handle->response_code = MHD_HTTP_NOT_FOUND;
+    handle->emsg = GNUNET_strdup(GNUNET_REST_IDENTITY_NOT_FOUND);
     GNUNET_SCHEDULER_add_now (&do_error, handle);
     return;
   }
@@ -547,7 +560,8 @@ ego_get_pubkey (struct GNUNET_REST_RequestHandle 
*con_handle,
 
   if (strlen (GNUNET_REST_API_NS_IDENTITY_PUBKEY) >= strlen (handle->url))
   {
-    handle->emsg = GNUNET_strdup("Missing public key");
+    handle->response_code = MHD_HTTP_NOT_FOUND;
+    handle->emsg = GNUNET_strdup(GNUNET_REST_IDENTITY_MISSING_PUBKEY);
     GNUNET_SCHEDULER_add_now (&do_error, handle);
     return;
   }
@@ -556,7 +570,8 @@ ego_get_pubkey (struct GNUNET_REST_RequestHandle 
*con_handle,
 
   if (NULL == ego_entry)
   {
-    handle->emsg = GNUNET_strdup("No identity found for public key");
+    handle->response_code = MHD_HTTP_NOT_FOUND;
+    handle->emsg = GNUNET_strdup(GNUNET_REST_IDENTITY_NOT_FOUND);
     GNUNET_SCHEDULER_add_now (&do_error, handle);
     return;
   }
@@ -584,7 +599,8 @@ ego_get_name (struct GNUNET_REST_RequestHandle *con_handle,
 
   if (strlen (GNUNET_REST_API_NS_IDENTITY_NAME) >= strlen (handle->url))
   {
-    handle->emsg = GNUNET_strdup("Missing name");
+    handle->response_code = MHD_HTTP_NOT_FOUND;
+    handle->emsg = GNUNET_strdup(GNUNET_REST_IDENTITY_MISSING_NAME);
     GNUNET_SCHEDULER_add_now (&do_error, handle);
     return;
   }
@@ -593,7 +609,8 @@ ego_get_name (struct GNUNET_REST_RequestHandle *con_handle,
 
   if (NULL == ego_entry)
   {
-    handle->emsg = GNUNET_strdup("No identity found for name");
+    handle->response_code = MHD_HTTP_NOT_FOUND;
+    handle->emsg = GNUNET_strdup(GNUNET_REST_IDENTITY_NOT_FOUND);
     GNUNET_SCHEDULER_add_now (&do_error, handle);
     return;
   }
@@ -644,7 +661,6 @@ ego_edit (struct RequestHandle *handle, struct EgoEntry 
*ego_entry)
   struct MHD_Response *resp;
   json_t *data_js;
   json_error_t err;
-  char *newsubsys;
   char *newname;
   char term_data[handle->data_size + 1];
   int json_state;
@@ -676,95 +692,56 @@ ego_edit (struct RequestHandle *handle, struct EgoEntry 
*ego_entry)
                           GNUNET_REST_IDENTITY_PARAM_NEWNAME,
                           &newname);
   //Change name with pubkey or name identifier
-  if (0 == json_state)
+  if (0 != json_state)
   {
-    if (NULL == newname)
-    {
-      handle->emsg = GNUNET_strdup(GNUNET_REST_ERROR_DATA_INVALID);
-      GNUNET_SCHEDULER_add_now (&do_error, handle);
-      json_decref (data_js);
-      return;
-    }
 
-    if (0 >= strlen(newname))
-    {
-      handle->emsg = GNUNET_strdup(GNUNET_REST_ERROR_DATA_INVALID);
-      GNUNET_SCHEDULER_add_now (&do_error, handle);
-      json_decref (data_js);
-      return;
-    }
-    GNUNET_STRINGS_utf8_tolower(newname,newname);
-    ego_entry_tmp = get_egoentry(handle,NULL,newname);
-    if (NULL != ego_entry_tmp)
-    {
-      //Ego with same name not allowed (even if its the ego we change)
-      resp = GNUNET_REST_create_response (NULL);
-      handle->proc (handle->proc_cls, resp, MHD_HTTP_CONFLICT);
-      GNUNET_SCHEDULER_add_now (&cleanup_handle, handle);
-      json_decref (data_js);
-      return;
-    }
-    handle->op = GNUNET_IDENTITY_rename (handle->identity_handle,
-                                        ego_entry->identifier,
-                                        newname,
-                                        &do_finished,
-                                        handle);
-    if (NULL == handle->op)
-    {
-      handle->emsg = GNUNET_strdup("Rename was not possible");
-      GNUNET_SCHEDULER_add_now (&do_error, handle);
-      return;
-    }
+    handle->emsg = GNUNET_strdup(GNUNET_REST_ERROR_DATA_INVALID);
+    GNUNET_SCHEDULER_add_now (&do_error, handle);
     json_decref (data_js);
     return;
   }
 
-  newsubsys = NULL;
-  //SUBSYSTEM
-  json_state = 0;
-  json_state = json_unpack(data_js,
-                          "{s:s!}",
-                          GNUNET_REST_IDENTITY_PARAM_SUBSYSTEM,
-                          &newsubsys);
-  //Change subsystem with pubkey or name identifier
-  if (0 == json_state)
+  if (NULL == newname)
   {
-    if (NULL == newsubsys)
-    {
-      handle->emsg = GNUNET_strdup(GNUNET_REST_ERROR_DATA_INVALID);
-      GNUNET_SCHEDULER_add_now (&do_error, handle);
-      json_decref (data_js);
-      return;
-    }
-
-    if (0 >= strlen(newsubsys))
-    {
-      handle->emsg = GNUNET_strdup(GNUNET_REST_ERROR_DATA_INVALID);
-      GNUNET_SCHEDULER_add_now (&do_error, handle);
-      json_decref (data_js);
-      return;
-    }
+    handle->emsg = GNUNET_strdup(GNUNET_REST_ERROR_DATA_INVALID);
+    GNUNET_SCHEDULER_add_now (&do_error, handle);
+    json_decref (data_js);
+    return;
+  }
 
-    handle->response_code = MHD_HTTP_NO_CONTENT;
-    handle->op = GNUNET_IDENTITY_set (handle->identity_handle,
-                                     newsubsys,
-                                     ego_entry->ego,
-                                     &do_finished,
-                                     handle);
-    if (NULL == handle->op)
-    {
-      handle->emsg = GNUNET_strdup("Setting subsystem was not possible");
-      GNUNET_SCHEDULER_add_now (&do_error, handle);
-      return;
-    }
+  if (0 >= strlen (newname))
+  {
+    handle->emsg = GNUNET_strdup(GNUNET_REST_ERROR_DATA_INVALID);
+    GNUNET_SCHEDULER_add_now (&do_error, handle);
     json_decref (data_js);
     return;
   }
 
-  handle->emsg = GNUNET_strdup(GNUNET_REST_ERROR_DATA_INVALID);
-  GNUNET_SCHEDULER_add_now (&do_error, handle);
+  ego_entry_tmp = get_egoentry (handle, NULL, newname);
+  if (NULL != ego_entry_tmp)
+  {
+    //Ego with same name not allowed (even if its the ego we change)
+    resp = GNUNET_REST_create_response (NULL);
+    handle->proc (handle->proc_cls, resp, MHD_HTTP_CONFLICT);
+    GNUNET_SCHEDULER_add_now (&cleanup_handle, handle);
+    json_decref (data_js);
+    return;
+  }
+  handle->op = GNUNET_IDENTITY_rename (handle->identity_handle,
+                                      ego_entry->identifier,
+                                      newname,
+                                      &do_finished,
+                                      handle);
+  if (NULL == handle->op)
+  {
+    handle->emsg = GNUNET_strdup("Rename failed");
+    GNUNET_SCHEDULER_add_now (&do_error, handle);
+    json_decref (data_js);
+    return;
+  }
   json_decref (data_js);
   return;
+
 }
 
 
@@ -789,7 +766,7 @@ ego_edit_pubkey (struct GNUNET_REST_RequestHandle 
*con_handle,
   if (strlen (GNUNET_REST_API_NS_IDENTITY_PUBKEY) >= strlen (handle->url))
   {
     handle->response_code = MHD_HTTP_NOT_FOUND;
-    handle->emsg = GNUNET_strdup("Missing public key");
+    handle->emsg = GNUNET_strdup(GNUNET_REST_IDENTITY_MISSING_PUBKEY);
     GNUNET_SCHEDULER_add_now (&do_error, handle);
     return;
   }
@@ -799,7 +776,7 @@ ego_edit_pubkey (struct GNUNET_REST_RequestHandle 
*con_handle,
   if (NULL == ego_entry)
   {
     handle->response_code = MHD_HTTP_NOT_FOUND;
-    handle->emsg = GNUNET_strdup("No identity found for public key");
+    handle->emsg = GNUNET_strdup(GNUNET_REST_IDENTITY_NOT_FOUND);
     GNUNET_SCHEDULER_add_now (&do_error, handle);
     return;
   }
@@ -828,7 +805,7 @@ ego_edit_name (struct GNUNET_REST_RequestHandle *con_handle,
   if (strlen (GNUNET_REST_API_NS_IDENTITY_NAME) >= strlen (handle->url))
   {
     handle->response_code = MHD_HTTP_NOT_FOUND;
-    handle->emsg = GNUNET_strdup("Missing name");
+    handle->emsg = GNUNET_strdup(GNUNET_REST_IDENTITY_MISSING_NAME);
     GNUNET_SCHEDULER_add_now (&do_error, handle);
     return;
   }
@@ -838,7 +815,7 @@ ego_edit_name (struct GNUNET_REST_RequestHandle *con_handle,
   if (NULL == ego_entry)
   {
     handle->response_code = MHD_HTTP_NOT_FOUND;
-    handle->emsg = GNUNET_strdup("No identity found for name");
+    handle->emsg = GNUNET_strdup(GNUNET_REST_IDENTITY_NOT_FOUND);
     GNUNET_SCHEDULER_add_now (&do_error, handle);
     return;
   }
@@ -847,6 +824,115 @@ ego_edit_name (struct GNUNET_REST_RequestHandle 
*con_handle,
 }
 
 /**
+ * Handle identity subsystem PUT request with name
+ *
+ * @param con_handle the connection handle
+ * @param url the url
+ * @param cls the RequestHandle
+ */
+void
+ego_edit_subsystem (struct GNUNET_REST_RequestHandle *con_handle,
+                   const char* url,
+                   void *cls)
+{
+  struct RequestHandle *handle = cls;
+  struct EgoEntry *ego_entry;
+  json_t *data_js;
+  json_error_t err;
+  char *newsubsys;
+  char *name;
+  char term_data[handle->data_size + 1];
+  int json_state;
+
+  name = NULL;
+
+  if (strlen (GNUNET_REST_API_NS_IDENTITY_SUBSYSTEM) >= strlen (handle->url))
+  {
+    handle->response_code = MHD_HTTP_NOT_FOUND;
+    handle->emsg = GNUNET_strdup(GNUNET_REST_IDENTITY_MISSING_NAME);
+    GNUNET_SCHEDULER_add_now (&do_error, handle);
+    return;
+  }
+  name = &handle->url[strlen (GNUNET_REST_API_NS_IDENTITY_SUBSYSTEM)+1];
+  ego_entry = get_egoentry(handle, NULL, name);
+
+  if (NULL == ego_entry)
+  {
+    handle->response_code = MHD_HTTP_NOT_FOUND;
+    handle->emsg = GNUNET_strdup(GNUNET_REST_IDENTITY_NOT_FOUND);
+    GNUNET_SCHEDULER_add_now (&do_error, handle);
+    return;
+  }
+
+  //if no data
+  if (0 >= handle->data_size)
+  {
+    handle->emsg = GNUNET_strdup(GNUNET_REST_ERROR_NO_DATA);
+    GNUNET_SCHEDULER_add_now (&do_error, handle);
+    return;
+  }
+  //if not json
+  term_data[handle->data_size] = '\0';
+  GNUNET_memcpy(term_data, handle->data, handle->data_size);
+  data_js = json_loads (term_data,JSON_DECODE_ANY,&err);
+
+  if (NULL == data_js)
+  {
+    handle->emsg = GNUNET_strdup(GNUNET_REST_ERROR_NO_DATA);
+    GNUNET_SCHEDULER_add_now (&do_error, handle);
+    return;
+  }
+
+  newsubsys = NULL;
+  //SUBSYSTEM
+  json_state = 0;
+  json_state = json_unpack(data_js,
+                          "{s:s!}",
+                          GNUNET_REST_IDENTITY_PARAM_SUBSYSTEM,
+                          &newsubsys);
+  //Change subsystem with pubkey or name identifier
+  if (0 != json_state)
+  {
+    handle->emsg = GNUNET_strdup(GNUNET_REST_ERROR_DATA_INVALID);
+    GNUNET_SCHEDULER_add_now (&do_error, handle);
+    json_decref (data_js);
+    return;
+  }
+
+  if (NULL == newsubsys)
+  {
+    handle->emsg = GNUNET_strdup(GNUNET_REST_ERROR_DATA_INVALID);
+    GNUNET_SCHEDULER_add_now (&do_error, handle);
+    json_decref (data_js);
+    return;
+  }
+
+  if (0 >= strlen (newsubsys))
+  {
+    handle->emsg = GNUNET_strdup(GNUNET_REST_ERROR_DATA_INVALID);
+    GNUNET_SCHEDULER_add_now (&do_error, handle);
+    json_decref (data_js);
+    return;
+  }
+
+  handle->response_code = MHD_HTTP_NO_CONTENT;
+  handle->op = GNUNET_IDENTITY_set (handle->identity_handle,
+                                   newsubsys,
+                                   ego_entry->ego,
+                                   &do_finished,
+                                   handle);
+  if (NULL == handle->op)
+  {
+    handle->emsg = GNUNET_strdup("Setting subsystem failed");
+    GNUNET_SCHEDULER_add_now (&do_error, handle);
+    return;
+  }
+  json_decref (data_js);
+  return;
+
+}
+
+/**
  * Handle identity POST request
  *
  * @param con_handle the connection handle
@@ -869,7 +955,6 @@ ego_create (struct GNUNET_REST_RequestHandle *con_handle,
 
   if (strlen (GNUNET_REST_API_NS_IDENTITY) != strlen (handle->url))
   {
-    handle->emsg = GNUNET_strdup(GNUNET_REST_ERROR_RESOURCE_INVALID);
     GNUNET_SCHEDULER_add_now (&do_error, handle);
     return;
   }
@@ -907,7 +992,7 @@ ego_create (struct GNUNET_REST_RequestHandle *con_handle,
 
   if (NULL == egoname)
   {
-    handle->emsg = GNUNET_strdup("No name provided");
+    handle->emsg = GNUNET_strdup(GNUNET_REST_ERROR_DATA_INVALID);
     GNUNET_SCHEDULER_add_now (&do_error, handle);
     json_decref (data_js);
     return;
@@ -915,7 +1000,7 @@ ego_create (struct GNUNET_REST_RequestHandle *con_handle,
   if (0 >= strlen (egoname))
   {
     json_decref (data_js);
-    handle->emsg = GNUNET_strdup("No name provided");
+    handle->emsg = GNUNET_strdup(GNUNET_REST_ERROR_DATA_INVALID);
     GNUNET_SCHEDULER_add_now (&do_error, handle);
     return;
   }
@@ -953,7 +1038,6 @@ ego_delete_pubkey (struct GNUNET_REST_RequestHandle 
*con_handle,
 {
   struct RequestHandle *handle = cls;
   struct EgoEntry *ego_entry;
-  struct MHD_Response *resp;
   char *keystring;
 
   keystring = NULL;
@@ -961,7 +1045,7 @@ ego_delete_pubkey (struct GNUNET_REST_RequestHandle 
*con_handle,
   if (strlen (GNUNET_REST_API_NS_IDENTITY_PUBKEY) >= strlen (handle->url))
   {
     handle->response_code = MHD_HTTP_NOT_FOUND;
-    handle->emsg = GNUNET_strdup("Missing public key");
+    handle->emsg = GNUNET_strdup(GNUNET_REST_IDENTITY_MISSING_PUBKEY);
     GNUNET_SCHEDULER_add_now (&do_error, handle);
     return;
   }
@@ -970,9 +1054,9 @@ ego_delete_pubkey (struct GNUNET_REST_RequestHandle 
*con_handle,
 
   if (NULL == ego_entry)
   {
-    resp = GNUNET_REST_create_response (NULL);
-    handle->proc (handle->proc_cls, resp, MHD_HTTP_NOT_FOUND);
-    GNUNET_SCHEDULER_add_now (&cleanup_handle, handle);
+    handle->response_code = MHD_HTTP_NOT_FOUND;
+    handle->emsg = GNUNET_strdup(GNUNET_REST_IDENTITY_NOT_FOUND);
+    GNUNET_SCHEDULER_add_now (&do_error, handle);
     return;
   }
 
@@ -998,7 +1082,6 @@ ego_delete_name (struct GNUNET_REST_RequestHandle 
*con_handle,
 {
   struct RequestHandle *handle = cls;
   struct EgoEntry *ego_entry;
-  struct MHD_Response *resp;
   char *name;
 
   name = NULL;
@@ -1006,7 +1089,7 @@ ego_delete_name (struct GNUNET_REST_RequestHandle 
*con_handle,
   if (strlen (GNUNET_REST_API_NS_IDENTITY_NAME) >= strlen (handle->url))
   {
     handle->response_code = MHD_HTTP_NOT_FOUND;
-    handle->emsg = GNUNET_strdup("Missing public key");
+    handle->emsg = GNUNET_strdup(GNUNET_REST_IDENTITY_MISSING_NAME);
     GNUNET_SCHEDULER_add_now (&do_error, handle);
     return;
   }
@@ -1015,9 +1098,9 @@ ego_delete_name (struct GNUNET_REST_RequestHandle 
*con_handle,
 
   if (NULL == ego_entry)
   {
-    resp = GNUNET_REST_create_response (NULL);
-    handle->proc (handle->proc_cls, resp, MHD_HTTP_NOT_FOUND);
-    GNUNET_SCHEDULER_add_now (&cleanup_handle, handle);
+    handle->response_code = MHD_HTTP_NOT_FOUND;
+    handle->emsg = GNUNET_strdup(GNUNET_REST_IDENTITY_NOT_FOUND);
+    GNUNET_SCHEDULER_add_now (&do_error, handle);
     return;
   }
 
@@ -1067,6 +1150,7 @@ init_cont (struct RequestHandle *handle)
       { MHD_HTTP_METHOD_GET, GNUNET_REST_API_NS_IDENTITY_SUBSYSTEM, 
&ego_get_subsystem },
       { MHD_HTTP_METHOD_PUT, GNUNET_REST_API_NS_IDENTITY_PUBKEY, 
&ego_edit_pubkey },
       { MHD_HTTP_METHOD_PUT, GNUNET_REST_API_NS_IDENTITY_NAME, &ego_edit_name 
},
+      { MHD_HTTP_METHOD_PUT, GNUNET_REST_API_NS_IDENTITY_SUBSYSTEM, 
&ego_edit_subsystem },
       { MHD_HTTP_METHOD_POST, GNUNET_REST_API_NS_IDENTITY, &ego_create },
       { MHD_HTTP_METHOD_DELETE, GNUNET_REST_API_NS_IDENTITY_PUBKEY, 
&ego_delete_pubkey },
       { MHD_HTTP_METHOD_DELETE, GNUNET_REST_API_NS_IDENTITY_NAME, 
&ego_delete_name },
diff --git a/src/identity/test_plugin_rest_identity.sh 
b/src/identity/test_plugin_rest_identity.sh
index 3eac0950c..a5879dd7e 100755
--- a/src/identity/test_plugin_rest_identity.sh
+++ b/src/identity/test_plugin_rest_identity.sh
@@ -122,19 +122,18 @@ curl_put 
"${identity_link}/name/test_plugin_rest_identity1" '{"newname":"test_pl
 curl_put "${identity_link}/name/test_plugin_rest_identity" 
'{"newnam":"test_plugin_rest_identityfail"}' "error"
 
 #Test subsystem
-curl_put "${identity_link}/name/test_plugin_rest_identity" 
'{"subsystem":"namestore"}' "HTTP/1.1 204"
-curl_put "${identity_link}/name/test_plugin_rest_identity" 
'{"subsystem":"namestore"}' "HTTP/1.1 204"
+curl_put "${identity_link}/subsystem/test_plugin_rest_identity" 
'{"subsystem":"namestore"}' "HTTP/1.1 204"
+curl_put "${identity_link}/subsystem/test_plugin_rest_identity" 
'{"subsystem":"namestore"}' "HTTP/1.1 204"
 curl_get "${identity_link}/subsystem/namestore" "test_plugin_rest_identity"
-curl_post "${identity_link}" '{"name":"test_plugin_rest_identity1"}' "HTTP/1.1 
201 Created"
 public="$(gnunet-identity -d | grep "test_plugin_rest_identity" | awk 
'NR==1{print $3}')"
-curl_put "${identity_link}/pubkey/$public" '{"subsystem":"namestore"}' 
"HTTP/1.1 204"
-curl_get "${identity_link}/subsystem/namestore" "test_plugin_rest_identity1"
+curl_put "${identity_link}/subsystem/$public" '{"subsystem":"namestore"}' 
"HTTP/1.1 404"
+curl_post "${identity_link}" '{"name":"test_plugin_rest_identity1"}' "HTTP/1.1 
201 Created"
 curl_get "${identity_link}/subsystem/test_plugin_rest_identity_no_subsystem" 
"error"
-curl_put "${identity_link}/name/test_plugin_rest_identity1" 
'{"subsystem":"test_plugin_rest_identity_no_subsystem"}' "HTTP/1.1 204"
+curl_put "${identity_link}/subsystem/test_plugin_rest_identity1" 
'{"subsystem":"test_plugin_rest_identity_no_subsystem"}' "HTTP/1.1 204"
 curl_get "${identity_link}/subsystem/test_plugin_rest_identity_no_subsystem" 
"test_plugin_rest_identity1"
 
-curl_put "${identity_link}/name/test_plugin_rest_identity1" 
'{"subsyste":"test_plugin_rest_identity_no_subsystem"}' "error"
-curl_put "${identity_link}/name/test_plugin_rest_identity1" 
'{"subsystem":"test_plugin_rest_identity_no_subsystem"}' "HTTP/1.1 204"
+curl_put "${identity_link}/subsystem/test_plugin_rest_identity1" 
'{"subsyste":"test_plugin_rest_identity_no_subsystem"}' "error"
+curl_put "${identity_link}/subsystem/test_plugin_rest_identity1" 
'{"subsystem":"test_plugin_rest_identity_no_subsystem"}' "HTTP/1.1 204"
 
 #Test DELETE
 curl_delete "${identity_link}/name/test_plugin_rest_identity" "HTTP/1.1 204"

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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