![]() |
GNUnet
0.11.x
|
GNUnet Identity REST plugin. More...
#include "platform.h"
#include "gnunet_rest_plugin.h"
#include "gnunet_identity_service.h"
#include "gnunet_rest_lib.h"
#include "microhttpd.h"
#include <jansson.h>
Go to the source code of this file.
Data Structures | |
struct | Plugin |
Handle for a plugin. More... | |
struct | EgoEntry |
The ego list. More... | |
struct | RequestHandle |
The request handle. More... | |
Macros | |
#define | GNUNET_REST_API_NS_IDENTITY "/identity" |
Identity Namespace. More... | |
#define | GNUNET_REST_API_NS_IDENTITY_PUBKEY "/identity/pubkey" |
Identity Namespace with public key specifier. More... | |
#define | GNUNET_REST_API_NS_IDENTITY_NAME "/identity/name" |
Identity Namespace with public key specifier. More... | |
#define | GNUNET_REST_API_NS_IDENTITY_SUBSYSTEM "/identity/subsystem" |
Identity Subsystem Namespace. More... | |
#define | GNUNET_REST_IDENTITY_PARAM_PUBKEY "pubkey" |
Parameter public key. More... | |
#define | GNUNET_REST_IDENTITY_PARAM_PRIVKEY "privkey" |
Parameter private key. More... | |
#define | GNUNET_REST_IDENTITY_PARAM_SUBSYSTEM "subsystem" |
Parameter subsystem. More... | |
#define | GNUNET_REST_IDENTITY_PARAM_NAME "name" |
Parameter name. More... | |
#define | GNUNET_REST_IDENTITY_PARAM_NEWNAME "newname" |
Parameter new name. More... | |
#define | GNUNET_REST_IDENTITY_ERROR_UNKNOWN "Unknown Error" |
Error message Unknown Error. More... | |
#define | GNUNET_REST_IDENTITY_NOT_FOUND "No identity found" |
Error message No identity found. More... | |
#define | GNUNET_REST_IDENTITY_MISSING_NAME "Missing identity name" |
Error message Missing identity name. More... | |
#define | GNUNET_REST_IDENTITY_MISSING_PUBKEY "Missing identity public key" |
Error message Missing identity name. More... | |
#define | GNUNET_REST_ERROR_NO_DATA "No data" |
Error message No data. More... | |
#define | GNUNET_REST_ERROR_DATA_INVALID "Data invalid" |
Error message Data invalid. More... | |
#define | ID_REST_STATE_INIT 0 |
State while collecting all egos. More... | |
#define | ID_REST_STATE_POST_INIT 1 |
Done collecting egos. More... | |
Functions | |
static void | cleanup_handle (void *cls) |
Cleanup lookup handle. More... | |
static void | do_error (void *cls) |
Task run on errors. More... | |
struct EgoEntry * | get_egoentry (struct RequestHandle *handle, char *pubkey, char *name) |
Get EgoEntry from list with either a public key or a name If public key and name are not NULL, it returns the public key result first. More... | |
static void | ego_get_for_subsystem (void *cls, struct GNUNET_IDENTITY_Ego *ego, void **ctx, const char *name) |
Callback for GET Request with subsystem. More... | |
void | ego_get_subsystem (struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls) |
Handle identity GET request for subsystem. More... | |
void | ego_get_all (struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls) |
Handle identity GET request - responds with all identities. More... | |
void | ego_get_response (struct RequestHandle *handle, struct EgoEntry *ego_entry) |
Responds with the ego_entry identity. More... | |
void | ego_get_pubkey (struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls) |
Handle identity GET request with a public key. More... | |
void | ego_get_name (struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls) |
Handle identity GET request with a name. More... | |
static void | do_finished (void *cls, const char *emsg) |
Processing finished. More... | |
static void | do_finished_create (void *cls, const struct GNUNET_IDENTITY_PrivateKey *pk, const char *emsg) |
Processing finished, when creating an ego. More... | |
void | ego_edit (struct RequestHandle *handle, struct EgoEntry *ego_entry) |
Processing edit ego with EgoEntry ego_entry. More... | |
void | ego_edit_pubkey (struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls) |
Handle identity PUT request with public key. More... | |
void | ego_edit_name (struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls) |
Handle identity PUT request with name. More... | |
void | ego_edit_subsystem (struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls) |
Handle identity subsystem PUT request with name. More... | |
void | ego_create (struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls) |
Handle identity POST request. More... | |
void | ego_delete_pubkey (struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls) |
Handle identity DELETE request with public key. More... | |
void | ego_delete_name (struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls) |
Handle identity DELETE request with name. More... | |
static void | options_cont (struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls) |
Respond to OPTIONS request. More... | |
static void | list_ego (void *cls, struct GNUNET_IDENTITY_Ego *ego, void **ctx, const char *identifier) |
static enum GNUNET_GenericReturnValue | rest_process_request (struct GNUNET_REST_RequestHandle *rest_handle, GNUNET_REST_ResultProcessor proc, void *proc_cls) |
Function processing the REST call. More... | |
void * | libgnunet_plugin_rest_identity_init (void *cls) |
Entry point for the plugin. More... | |
void * | libgnunet_plugin_rest_identity_done (void *cls) |
Exit point from the plugin. More... | |
Variables | |
const struct GNUNET_CONFIGURATION_Handle * | cfg |
The configuration handle. More... | |
static char * | allow_methods |
HTTP methods allows for this plugin. More... | |
static struct EgoEntry * | ego_head |
Ego list. More... | |
static struct EgoEntry * | ego_tail |
Ego list. More... | |
static int | state |
The processing state. More... | |
static struct GNUNET_IDENTITY_Handle * | identity_handle |
Handle to Identity service. More... | |
static struct RequestHandle * | requests_head |
DLL. More... | |
static struct RequestHandle * | requests_tail |
DLL. More... | |
GNUnet Identity REST plugin.
Definition in file plugin_rest_identity.c.
#define GNUNET_REST_API_NS_IDENTITY "/identity" |
Identity Namespace.
Definition at line 37 of file plugin_rest_identity.c.
Referenced by ego_create(), libgnunet_plugin_rest_identity_init(), and rest_process_request().
#define GNUNET_REST_API_NS_IDENTITY_PUBKEY "/identity/pubkey" |
Identity Namespace with public key specifier.
Definition at line 42 of file plugin_rest_identity.c.
Referenced by ego_delete_pubkey(), ego_edit_pubkey(), ego_get_pubkey(), and rest_process_request().
#define GNUNET_REST_API_NS_IDENTITY_NAME "/identity/name" |
Identity Namespace with public key specifier.
Definition at line 47 of file plugin_rest_identity.c.
Referenced by ego_delete_name(), ego_edit_name(), ego_get_name(), and rest_process_request().
#define GNUNET_REST_API_NS_IDENTITY_SUBSYSTEM "/identity/subsystem" |
Identity Subsystem Namespace.
Definition at line 52 of file plugin_rest_identity.c.
Referenced by ego_edit_subsystem(), ego_get_subsystem(), and rest_process_request().
#define GNUNET_REST_IDENTITY_PARAM_PUBKEY "pubkey" |
Parameter public key.
Definition at line 57 of file plugin_rest_identity.c.
Referenced by ego_get_all(), ego_get_for_subsystem(), and ego_get_response().
#define GNUNET_REST_IDENTITY_PARAM_PRIVKEY "privkey" |
Parameter private key.
Definition at line 62 of file plugin_rest_identity.c.
Referenced by ego_create(), ego_get_all(), and ego_get_response().
#define GNUNET_REST_IDENTITY_PARAM_SUBSYSTEM "subsystem" |
Parameter subsystem.
Definition at line 67 of file plugin_rest_identity.c.
Referenced by ego_edit_subsystem().
#define GNUNET_REST_IDENTITY_PARAM_NAME "name" |
Parameter name.
Definition at line 72 of file plugin_rest_identity.c.
Referenced by ego_create(), ego_get_all(), ego_get_for_subsystem(), and ego_get_response().
#define GNUNET_REST_IDENTITY_PARAM_NEWNAME "newname" |
#define GNUNET_REST_IDENTITY_ERROR_UNKNOWN "Unknown Error" |
Error message Unknown Error.
Definition at line 82 of file plugin_rest_identity.c.
Referenced by do_error().
#define GNUNET_REST_IDENTITY_NOT_FOUND "No identity found" |
Error message No identity found.
Definition at line 87 of file plugin_rest_identity.c.
Referenced by ego_delete_name(), ego_delete_pubkey(), ego_edit_name(), ego_edit_pubkey(), ego_edit_subsystem(), ego_get_for_subsystem(), ego_get_name(), ego_get_pubkey(), and ego_get_subsystem().
Error message Missing identity name.
Definition at line 92 of file plugin_rest_identity.c.
Referenced by ego_delete_name(), ego_edit_name(), ego_edit_subsystem(), and ego_get_name().
Error message Missing identity name.
Definition at line 97 of file plugin_rest_identity.c.
Referenced by ego_delete_pubkey(), ego_edit_pubkey(), and ego_get_pubkey().
#define GNUNET_REST_ERROR_NO_DATA "No data" |
Error message No data.
Definition at line 102 of file plugin_rest_identity.c.
Referenced by ego_create(), ego_edit(), and ego_edit_subsystem().
#define GNUNET_REST_ERROR_DATA_INVALID "Data invalid" |
Error message Data invalid.
Definition at line 107 of file plugin_rest_identity.c.
Referenced by ego_create(), ego_edit(), and ego_edit_subsystem().
#define ID_REST_STATE_INIT 0 |
State while collecting all egos.
Definition at line 112 of file plugin_rest_identity.c.
Referenced by libgnunet_plugin_rest_identity_init(), and list_ego().
#define ID_REST_STATE_POST_INIT 1 |
Done collecting egos.
Definition at line 117 of file plugin_rest_identity.c.
Referenced by list_ego().
|
static |
Cleanup lookup handle.
handle | Handle to clean up |
Definition at line 279 of file plugin_rest_identity.c.
References RequestHandle::emsg, GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_SCHEDULER_cancel(), handle, RequestHandle::name, RequestHandle::timeout_task, and RequestHandle::url.
Referenced by do_error(), do_finished(), ego_create(), ego_edit(), ego_get_all(), ego_get_for_subsystem(), ego_get_response(), libgnunet_plugin_rest_identity_done(), options_cont(), and rest_process_request().
|
static |
Task run on errors.
Reports an error and cleans up everything.
cls | the struct RequestHandle |
Definition at line 309 of file plugin_rest_identity.c.
References cleanup_handle(), RequestHandle::emsg, GNUNET_free, GNUNET_REST_create_response(), GNUNET_REST_IDENTITY_ERROR_UNKNOWN, GNUNET_SCHEDULER_add_now(), GNUNET_strdup, handle, RequestHandle::proc, RequestHandle::proc_cls, response, and RequestHandle::response_code.
Referenced by do_finished(), ego_create(), ego_delete_name(), ego_delete_pubkey(), ego_edit(), ego_edit_name(), ego_edit_pubkey(), ego_edit_subsystem(), ego_get_for_subsystem(), ego_get_name(), ego_get_pubkey(), ego_get_subsystem(), and rest_process_request().
struct EgoEntry* get_egoentry | ( | struct RequestHandle * | handle, |
char * | pubkey, | ||
char * | name | ||
) |
Get EgoEntry from list with either a public key or a name If public key and name are not NULL, it returns the public key result first.
handle | the RequestHandle |
pubkey | the public key of an identity (only one can be NULL) |
name | the name of an identity (only one can be NULL) |
Definition at line 343 of file plugin_rest_identity.c.
References EgoEntry::identifier, EgoEntry::keystring, and EgoEntry::next.
Referenced by ego_delete_name(), ego_delete_pubkey(), ego_edit(), ego_edit_name(), ego_edit_pubkey(), ego_edit_subsystem(), ego_get_name(), and ego_get_pubkey().
|
static |
Callback for GET Request with subsystem.
cls | the RequestHandle |
ego | the Ego found |
ctx | the context |
name | the id of the ego |
Definition at line 380 of file plugin_rest_identity.c.
References cleanup_handle(), do_error(), RequestHandle::emsg, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_IDENTITY_ego_get_public_key(), GNUNET_IDENTITY_public_key_to_string(), GNUNET_log, GNUNET_REST_create_response(), GNUNET_REST_IDENTITY_NOT_FOUND, GNUNET_REST_IDENTITY_PARAM_NAME, GNUNET_REST_IDENTITY_PARAM_PUBKEY, GNUNET_SCHEDULER_add_now(), GNUNET_strdup, handle, RequestHandle::proc, RequestHandle::proc_cls, and RequestHandle::response_code.
Referenced by ego_get_subsystem().
void ego_get_subsystem | ( | struct GNUNET_REST_RequestHandle * | con_handle, |
const char * | url, | ||
void * | cls | ||
) |
Handle identity GET request for subsystem.
con_handle | the connection handle |
url | the url |
cls | the RequestHandle |
Definition at line 432 of file plugin_rest_identity.c.
References do_error(), ego_get_for_subsystem(), RequestHandle::emsg, GNUNET_ERROR_TYPE_DEBUG, GNUNET_IDENTITY_get(), GNUNET_log, GNUNET_REST_API_NS_IDENTITY_SUBSYSTEM, GNUNET_REST_IDENTITY_NOT_FOUND, GNUNET_SCHEDULER_add_now(), GNUNET_strdup, handle, RequestHandle::op, RequestHandle::response_code, subsystem, and RequestHandle::url.
Referenced by rest_process_request().
void ego_get_all | ( | struct GNUNET_REST_RequestHandle * | con_handle, |
const char * | url, | ||
void * | cls | ||
) |
Handle identity GET request - responds with all identities.
con_handle | the connection handle |
url | the url |
cls | the RequestHandle |
Definition at line 472 of file plugin_rest_identity.c.
References cleanup_handle(), EgoEntry::ego, GNUNET_CONTAINER_multihashmap_contains(), GNUNET_CRYPTO_hash(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_IDENTITY_ego_get_private_key(), GNUNET_IDENTITY_private_key_to_string(), GNUNET_log, GNUNET_REST_create_response(), GNUNET_REST_IDENTITY_PARAM_NAME, GNUNET_REST_IDENTITY_PARAM_PRIVKEY, GNUNET_REST_IDENTITY_PARAM_PUBKEY, GNUNET_SCHEDULER_add_now(), GNUNET_YES, handle, EgoEntry::identifier, EgoEntry::keystring, EgoEntry::next, RequestHandle::proc, RequestHandle::proc_cls, RequestHandle::rest_handle, and GNUNET_REST_RequestHandle::url_param_map.
Referenced by rest_process_request().
void ego_get_response | ( | struct RequestHandle * | handle, |
struct EgoEntry * | ego_entry | ||
) |
Responds with the ego_entry identity.
handle | the struct RequestHandle |
ego_entry | the struct EgoEntry for the response |
Definition at line 532 of file plugin_rest_identity.c.
References cleanup_handle(), EgoEntry::ego, GNUNET_CONTAINER_multihashmap_contains(), GNUNET_CRYPTO_hash(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_IDENTITY_ego_get_private_key(), GNUNET_IDENTITY_private_key_to_string(), GNUNET_log, GNUNET_REST_create_response(), GNUNET_REST_IDENTITY_PARAM_NAME, GNUNET_REST_IDENTITY_PARAM_PRIVKEY, GNUNET_REST_IDENTITY_PARAM_PUBKEY, GNUNET_SCHEDULER_add_now(), GNUNET_YES, EgoEntry::identifier, EgoEntry::keystring, RequestHandle::proc, RequestHandle::proc_cls, RequestHandle::rest_handle, and GNUNET_REST_RequestHandle::url_param_map.
Referenced by ego_get_name(), and ego_get_pubkey().
void ego_get_pubkey | ( | struct GNUNET_REST_RequestHandle * | con_handle, |
const char * | url, | ||
void * | cls | ||
) |
Handle identity GET request with a public key.
con_handle | the connection handle |
url | the url |
cls | the RequestHandle |
Definition at line 579 of file plugin_rest_identity.c.
References do_error(), ego_get_response(), RequestHandle::emsg, get_egoentry(), GNUNET_REST_API_NS_IDENTITY_PUBKEY, GNUNET_REST_IDENTITY_MISSING_PUBKEY, GNUNET_REST_IDENTITY_NOT_FOUND, GNUNET_SCHEDULER_add_now(), GNUNET_strdup, handle, EgoEntry::keystring, RequestHandle::response_code, and RequestHandle::url.
Referenced by rest_process_request().
void ego_get_name | ( | struct GNUNET_REST_RequestHandle * | con_handle, |
const char * | url, | ||
void * | cls | ||
) |
Handle identity GET request with a name.
con_handle | the connection handle |
url | the url |
cls | the RequestHandle |
Definition at line 619 of file plugin_rest_identity.c.
References do_error(), ego_get_response(), RequestHandle::emsg, get_egoentry(), GNUNET_REST_API_NS_IDENTITY_NAME, GNUNET_REST_IDENTITY_MISSING_NAME, GNUNET_REST_IDENTITY_NOT_FOUND, GNUNET_SCHEDULER_add_now(), GNUNET_strdup, handle, RequestHandle::response_code, and RequestHandle::url.
Referenced by rest_process_request().
|
static |
Processing finished.
cls | request handle |
emsg | error message |
Definition at line 658 of file plugin_rest_identity.c.
References cleanup_handle(), do_error(), RequestHandle::emsg, GNUNET_REST_create_response(), GNUNET_SCHEDULER_add_now(), GNUNET_strdup, handle, RequestHandle::op, RequestHandle::proc, RequestHandle::proc_cls, and RequestHandle::response_code.
Referenced by do_finished_create(), ego_delete_name(), ego_delete_pubkey(), ego_edit(), and ego_edit_subsystem().
|
static |
Processing finished, when creating an ego.
cls | request handle |
private | key of the ego, or NULL on error |
emsg | error message |
Definition at line 688 of file plugin_rest_identity.c.
References do_finished(), and handle.
Referenced by ego_create().
void ego_edit | ( | struct RequestHandle * | handle, |
struct EgoEntry * | ego_entry | ||
) |
Processing edit ego with EgoEntry ego_entry.
handle | the struct RequestHandle |
ego_entry | the struct EgoEntry we want to edit |
Definition at line 706 of file plugin_rest_identity.c.
References cleanup_handle(), RequestHandle::data, RequestHandle::data_size, do_error(), do_finished(), RequestHandle::emsg, get_egoentry(), GNUNET_IDENTITY_rename(), GNUNET_memcpy, GNUNET_REST_create_response(), GNUNET_REST_ERROR_DATA_INVALID, GNUNET_REST_ERROR_NO_DATA, GNUNET_REST_IDENTITY_PARAM_NEWNAME, GNUNET_SCHEDULER_add_now(), GNUNET_strdup, EgoEntry::identifier, RequestHandle::op, RequestHandle::proc, and RequestHandle::proc_cls.
Referenced by ego_edit_name(), and ego_edit_pubkey().
void ego_edit_pubkey | ( | struct GNUNET_REST_RequestHandle * | con_handle, |
const char * | url, | ||
void * | cls | ||
) |
Handle identity PUT request with public key.
con_handle | the connection handle |
url | the url |
cls | the RequestHandle |
Definition at line 802 of file plugin_rest_identity.c.
References do_error(), ego_edit(), RequestHandle::emsg, get_egoentry(), GNUNET_REST_API_NS_IDENTITY_PUBKEY, GNUNET_REST_IDENTITY_MISSING_PUBKEY, GNUNET_REST_IDENTITY_NOT_FOUND, GNUNET_SCHEDULER_add_now(), GNUNET_strdup, handle, EgoEntry::keystring, RequestHandle::response_code, and RequestHandle::url.
Referenced by rest_process_request().
void ego_edit_name | ( | struct GNUNET_REST_RequestHandle * | con_handle, |
const char * | url, | ||
void * | cls | ||
) |
Handle identity PUT request with name.
con_handle | the connection handle |
url | the url |
cls | the RequestHandle |
Definition at line 842 of file plugin_rest_identity.c.
References do_error(), ego_edit(), RequestHandle::emsg, get_egoentry(), GNUNET_REST_API_NS_IDENTITY_NAME, GNUNET_REST_IDENTITY_MISSING_NAME, GNUNET_REST_IDENTITY_NOT_FOUND, GNUNET_SCHEDULER_add_now(), GNUNET_strdup, handle, Plugin::name, RequestHandle::response_code, and RequestHandle::url.
Referenced by rest_process_request().
void ego_edit_subsystem | ( | struct GNUNET_REST_RequestHandle * | con_handle, |
const char * | url, | ||
void * | cls | ||
) |
Handle identity subsystem PUT request with name.
con_handle | the connection handle |
url | the url |
cls | the RequestHandle |
Definition at line 882 of file plugin_rest_identity.c.
References RequestHandle::data, RequestHandle::data_size, do_error(), do_finished(), EgoEntry::ego, RequestHandle::emsg, get_egoentry(), GNUNET_IDENTITY_set(), GNUNET_memcpy, GNUNET_REST_API_NS_IDENTITY_SUBSYSTEM, GNUNET_REST_ERROR_DATA_INVALID, GNUNET_REST_ERROR_NO_DATA, GNUNET_REST_IDENTITY_MISSING_NAME, GNUNET_REST_IDENTITY_NOT_FOUND, GNUNET_REST_IDENTITY_PARAM_SUBSYSTEM, GNUNET_SCHEDULER_add_now(), GNUNET_strdup, handle, Plugin::name, RequestHandle::op, RequestHandle::response_code, and RequestHandle::url.
Referenced by rest_process_request().
void ego_create | ( | struct GNUNET_REST_RequestHandle * | con_handle, |
const char * | url, | ||
void * | cls | ||
) |
Handle identity POST request.
con_handle | the connection handle |
url | the url |
cls | the RequestHandle |
Definition at line 991 of file plugin_rest_identity.c.
References cleanup_handle(), RequestHandle::data, RequestHandle::data_size, do_error(), do_finished_create(), RequestHandle::emsg, GNUNET_IDENTITY_create(), GNUNET_IDENTITY_TYPE_ECDSA, GNUNET_memcpy, GNUNET_REST_API_NS_IDENTITY, GNUNET_REST_create_response(), GNUNET_REST_ERROR_DATA_INVALID, GNUNET_REST_ERROR_NO_DATA, GNUNET_REST_IDENTITY_PARAM_NAME, GNUNET_REST_IDENTITY_PARAM_PRIVKEY, GNUNET_SCHEDULER_add_now(), GNUNET_strdup, GNUNET_STRINGS_string_to_data(), GNUNET_STRINGS_utf8_tolower(), handle, EgoEntry::identifier, RequestHandle::name, EgoEntry::next, RequestHandle::op, pk, RequestHandle::proc, RequestHandle::proc_cls, RequestHandle::response_code, and RequestHandle::url.
Referenced by rest_process_request().
void ego_delete_pubkey | ( | struct GNUNET_REST_RequestHandle * | con_handle, |
const char * | url, | ||
void * | cls | ||
) |
Handle identity DELETE request with public key.
con_handle | the connection handle |
url | the url |
cls | the RequestHandle |
Definition at line 1101 of file plugin_rest_identity.c.
References do_error(), do_finished(), RequestHandle::emsg, get_egoentry(), GNUNET_IDENTITY_delete(), GNUNET_REST_API_NS_IDENTITY_PUBKEY, GNUNET_REST_IDENTITY_MISSING_PUBKEY, GNUNET_REST_IDENTITY_NOT_FOUND, GNUNET_SCHEDULER_add_now(), GNUNET_strdup, handle, EgoEntry::identifier, EgoEntry::keystring, RequestHandle::op, RequestHandle::response_code, and RequestHandle::url.
Referenced by rest_process_request().
void ego_delete_name | ( | struct GNUNET_REST_RequestHandle * | con_handle, |
const char * | url, | ||
void * | cls | ||
) |
Handle identity DELETE request with name.
con_handle | the connection handle |
url | the url |
cls | the RequestHandle |
Definition at line 1145 of file plugin_rest_identity.c.
References do_error(), do_finished(), RequestHandle::emsg, get_egoentry(), GNUNET_IDENTITY_delete(), GNUNET_REST_API_NS_IDENTITY_NAME, GNUNET_REST_IDENTITY_MISSING_NAME, GNUNET_REST_IDENTITY_NOT_FOUND, GNUNET_SCHEDULER_add_now(), GNUNET_strdup, handle, EgoEntry::identifier, Plugin::name, RequestHandle::op, RequestHandle::response_code, and RequestHandle::url.
Referenced by rest_process_request().
|
static |
Respond to OPTIONS request.
con_handle | the connection handle |
url | the url |
cls | the RequestHandle |
Definition at line 1189 of file plugin_rest_identity.c.
References allow_methods, cleanup_handle(), GNUNET_REST_create_response(), GNUNET_SCHEDULER_add_now(), handle, RequestHandle::proc, and RequestHandle::proc_cls.
Referenced by rest_process_request().
|
static |
Definition at line 1206 of file plugin_rest_identity.c.
References EgoEntry::ego, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_CONTAINER_DLL_remove, GNUNET_free, GNUNET_IDENTITY_ego_get_public_key(), GNUNET_IDENTITY_public_key_to_string(), GNUNET_new, GNUNET_strdup, ID_REST_STATE_INIT, ID_REST_STATE_POST_INIT, EgoEntry::identifier, EgoEntry::keystring, EgoEntry::next, and state.
Referenced by libgnunet_plugin_rest_identity_init().
|
static |
Function processing the REST call.
method | HTTP method |
url | URL of the HTTP request |
data | body of the HTTP request (optional) |
data_size | length of the body |
proc | callback function for the result |
proc_cls | closure for callback function |
Definition at line 1293 of file plugin_rest_identity.c.
References cleanup_handle(), GNUNET_REST_RequestHandle::data, RequestHandle::data, GNUNET_REST_RequestHandle::data_size, RequestHandle::data_size, do_error(), ego_create(), ego_delete_name(), ego_delete_pubkey(), ego_edit_name(), ego_edit_pubkey(), ego_edit_subsystem(), ego_get_all(), ego_get_name(), ego_get_pubkey(), ego_get_subsystem(), GNUNET_CONTAINER_DLL_insert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_new, GNUNET_NO, GNUNET_REST_API_NS_IDENTITY, GNUNET_REST_API_NS_IDENTITY_NAME, GNUNET_REST_API_NS_IDENTITY_PUBKEY, GNUNET_REST_API_NS_IDENTITY_SUBSYSTEM, GNUNET_REST_handle_request(), GNUNET_REST_HANDLER_END, GNUNET_SCHEDULER_add_delayed(), GNUNET_strdup, GNUNET_TIME_UNIT_FOREVER_REL, GNUNET_YES, handle, options_cont(), GNUNET_REST_RequestHandler::proc, RequestHandle::proc, RequestHandle::proc_cls, RequestHandle::response_code, RequestHandle::rest_handle, RequestHandle::timeout, RequestHandle::timeout_task, GNUNET_REST_RequestHandle::url, and RequestHandle::url.
Referenced by libgnunet_plugin_rest_identity_init().
void* libgnunet_plugin_rest_identity_init | ( | void * | cls | ) |
Entry point for the plugin.
cls | Config info |
Definition at line 1361 of file plugin_rest_identity.c.
References _, allow_methods, Plugin::api, Plugin::cfg, GNUNET_REST_Plugin::cls, GNUNET_asprintf(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_IDENTITY_connect(), GNUNET_log, GNUNET_new, GNUNET_REST_API_NS_IDENTITY, ID_REST_STATE_INIT, list_ego(), GNUNET_REST_Plugin::name, plugin, GNUNET_REST_Plugin::process_request, rest_process_request(), and state.
void* libgnunet_plugin_rest_identity_done | ( | void * | cls | ) |
Exit point from the plugin.
cls | the plugin context (as returned by "init") |
Definition at line 1397 of file plugin_rest_identity.c.
References allow_methods, Plugin::api, Plugin::cfg, cleanup_handle(), GNUNET_REST_Plugin::cls, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_IDENTITY_disconnect(), GNUNET_log, EgoEntry::identifier, EgoEntry::keystring, EgoEntry::next, and plugin.
const struct GNUNET_CONFIGURATION_Handle* cfg |
The configuration handle.
Handle to our configuration.
Definition at line 122 of file plugin_rest_identity.c.
|
static |
HTTP methods allows for this plugin.
Definition at line 127 of file plugin_rest_identity.c.
Referenced by libgnunet_plugin_rest_identity_done(), libgnunet_plugin_rest_identity_init(), and options_cont().
|
static |
Ego list.
Definition at line 132 of file plugin_rest_identity.c.
|
static |
Ego list.
Definition at line 137 of file plugin_rest_identity.c.
|
static |
The processing state.
Definition at line 142 of file plugin_rest_identity.c.
Referenced by libgnunet_plugin_rest_identity_init(), and list_ego().
|
static |
Handle to Identity service.
Definition at line 147 of file plugin_rest_identity.c.
|
static |
DLL.
Definition at line 267 of file plugin_rest_identity.c.
|
static |
DLL.
Definition at line 272 of file plugin_rest_identity.c.