[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] 58/75: added name search
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] 58/75: added name search |
Date: |
Thu, 09 Aug 2018 23:58:55 +0200 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a commit to branch master
in repository gnunet.
commit 4992eacc10bedaa0edfa03b401253408c6267798
Author: Phil <address@hidden>
AuthorDate: Wed Jul 25 17:43:37 2018 +0200
added name search
---
src/identity/plugin_rest_identity.c | 23 ++++++++++++++++++++---
src/identity/test_plugin_rest_identity.sh | 6 ++++++
2 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/src/identity/plugin_rest_identity.c
b/src/identity/plugin_rest_identity.c
index f1d33b0f3..59dad66c7 100644
--- a/src/identity/plugin_rest_identity.c
+++ b/src/identity/plugin_rest_identity.c
@@ -346,7 +346,8 @@ ego_get (struct GNUNET_REST_RequestHandle *con_handle,
const char* url,
handle->subsystem);
handle->op = GNUNET_IDENTITY_get (handle->identity_handle,
- handle->subsystem, &ego_get_for_subsystem,
+ handle->subsystem,
+ &ego_get_for_subsystem,
handle);
if (NULL == handle->op)
{
@@ -359,9 +360,10 @@ ego_get (struct GNUNET_REST_RequestHandle *con_handle,
const char* url,
egoname = NULL;
keystring = NULL;
- //if only one identity requested
+ //if only one identity requested with key
GNUNET_CRYPTO_hash (GNUNET_REST_PARAM_PUBKEY,
- strlen (GNUNET_REST_PARAM_PUBKEY), &key);
+ strlen (GNUNET_REST_PARAM_PUBKEY),
+ &key);
if ( GNUNET_YES
== GNUNET_CONTAINER_multihashmap_contains (
handle->rest_handle->url_param_map, &key))
@@ -379,6 +381,21 @@ ego_get (struct GNUNET_REST_RequestHandle *con_handle,
const char* url,
}
}
+ //if only one identity requested with name
+ if (NULL == egoname)
+ {
+ GNUNET_CRYPTO_hash (GNUNET_REST_PARAM_NAME,
+ strlen (GNUNET_REST_PARAM_NAME),
+ &key);
+ if ( GNUNET_YES
+ == GNUNET_CONTAINER_multihashmap_contains (
+ handle->rest_handle->url_param_map, &key))
+ {
+ egoname = GNUNET_CONTAINER_multihashmap_get (
+ handle->rest_handle->url_param_map, &key);
+ }
+ }
+
json_root = json_array ();
//Return ego/egos
for (ego_entry = handle->ego_head;
diff --git a/src/identity/test_plugin_rest_identity.sh
b/src/identity/test_plugin_rest_identity.sh
index b48becc45..170f3e928 100755
--- a/src/identity/test_plugin_rest_identity.sh
+++ b/src/identity/test_plugin_rest_identity.sh
@@ -84,6 +84,12 @@ fi
id="$(gnunet-identity -d | grep "Test - " | sed "s/Test - //g")"
#Test GET (one identity) for success and error json
+cache="$(curl --silent "${link_to_api}?name=Test" | grep "error")"
+if [ "" != "$cache" ]
+then
+ exit 1
+fi
+#Test GET (one identity) for success and error json
cache="$(curl --silent "${link_to_api}?pubkey=$id" | grep "error")"
if [ "" != "$cache" ]
then
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnunet] 51/75: -Merge branch 'master' of ssh://gnunet.org/gnunet into gsoc2018/rest_api, (continued)
- [GNUnet-SVN] [gnunet] 51/75: -Merge branch 'master' of ssh://gnunet.org/gnunet into gsoc2018/rest_api, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 47/75: remove dead file, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 56/75: -Merge branch 'master' of ssh://gnunet.org/gnunet into gsoc2018/rest_api, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 48/75: Expanding libgnunetcurl., gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 13/75: doc: stagging file 'FROM_SOURCE' with old repetive instructions, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 35/75: ensure datacache does not return expired records, fixig pq behavior with respect to FOREVER absolute time, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 27/75: rps profiler: rewrite statistics handling, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 44/75: fix, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 43/75: seems like mysql is currently broken in Guix, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 49/75: update dockerfile, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 58/75: added name search,
gnunet <=
- [GNUnet-SVN] [gnunet] 61/75: fix makefiles, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 53/75: -Merge branch 'master' of ssh://gnunet.org/gnunet into gsoc2018/rest_api, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 54/75: -Merge branch 'master' of ssh://gnunet.org/gnunet into gsoc2018/rest_api, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 75/75: Merge branch 'gsoc2018/rest_api', gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 64/75: fix lowercase identities, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 62/75: -fix json and namestore, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 68/75: fix gns and identity test script, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 57/75: -fix identity file, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 72/75: Peerinfo Rest API finished, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 59/75: -wip namestore api, changed adding gnsrecord, gnunet, 2018/08/09