gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnunet-rest-api] branch master updated: add some reclaim d


From: gnunet
Subject: [GNUnet-SVN] [gnunet-rest-api] branch master updated: add some reclaim docs
Date: Mon, 27 May 2019 17:32:15 +0200

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

martin-schanzenbach pushed a commit to branch master
in repository gnunet-rest-api.

The following commit(s) were added to refs/heads/master by this push:
     new 89b1936  add some reclaim docs
89b1936 is described below

commit 89b19366faa2fb2d3dff3582938c46e9f86d0ebe
Author: Schanzenbach, Martin <address@hidden>
AuthorDate: Mon May 27 17:31:40 2019 +0200

    add some reclaim docs
---
 source/index.rst   |   1 +
 source/reclaim.rst | 178 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 179 insertions(+)

diff --git a/source/index.rst b/source/index.rst
index d05197b..3f8c95e 100644
--- a/source/index.rst
+++ b/source/index.rst
@@ -36,6 +36,7 @@ Services
    identity
    namestore
    gns
+   reclaim
    peerinfo
 
 
diff --git a/source/reclaim.rst b/source/reclaim.rst
new file mode 100644
index 0000000..6fc8674
--- /dev/null
+++ b/source/reclaim.rst
@@ -0,0 +1,178 @@
+re:claimID API
+==============
+
+Definition
+~~~~~~~~~~
+
+Variables in single quotes ``'...'`` can or must be changed according to your 
specific case.
+
+``ego`` is the name of an identity.
+
+``name`` is the attribute name.
+
+``value`` is the attribute value.
+
+``type`` is the attribute type.
+
+``id`` is the attribute ID. This ID is the name under which the attribute can
+be found in the namestore.
+
+
+
+Error Response
+--------------
+
+An error response is sent in the JSON format: 
``{"error":"*error_description*"}``
+
+Following numbers are added for references inside the documentation only.
+
+Error descriptions are::
+    
+    Nr. Error Description           - Explanation
+    1)  Unknown Error               - Error is not specified
+    2)  No identity found           - Identity was not found with given name, 
public key or no identity was found at all
+    3)  Missing identity public key - Identity public key length is zero
+    4)  Missing identity name       - Identity name length is zero
+    5)  Missing subsystem name      - Subsystem name length is zero
+    6)  No data                     - No JSON data given
+    7)  Data invalid                - Wrong JSON data given
+    8)  Rename failed               - Rename request failed due to wrong name, 
etc.
+    9)  Setting subsystem failed    - Setting the subsystem for an identity 
failed (usually this error does not occur)
+
+Error ``1)`` is always possible and is not listed in following requests.
+
+ATTENTION: Any error message from the Identity API (not REST API) can occur 
and can be returned in the error response. These responses are not listed here.
+
+Response Code
+-------------
+
+A response of a message has a HTTP response code. Usually, this code is 200 OK 
for a successful response. The code changes in some cases::
+
+    a) 200 OK         - Normal response (but may contain an error message)
+    b) 201 Created    - Success after POST request
+    c) 204 No Content - Success PUT or DELETE request
+    d) 404 Not Found  - Identity is not found with identifier
+    e) 409 Conflict   - PUT or POST request not possible due to existing 
duplicate
+
+    ``d) 404 Not Found`` is always used when the error message is either 
``2)``, ``3)`` or ``4)``.
+
+Requests
+~~~~~~~~
+
+GET Requests
+------------
+
++--------------------+---------------------------------------------------------------+
+|**Title**           |Returns all attributes for an identity                   
      |
++--------------------+---------------------------------------------------------------+
+|**URL**             |:literal:`/reclaim/attributes/'ego'`                     
      |
++--------------------+---------------------------------------------------------------+
+|**Method**          |**GET**                                                  
      |
++--------------------+---------------------------------------------------------------+
+|**URL Params**      |none                                                     
      |
++--------------------+---------------------------------------------------------------+
+|**Data Params**     |none                                                     
      |
++--------------------+---------------------------------------------------------------+
+|**Success Response**|[{"value":"*value*", "name":"*name*",                    
      |
+|                    |  "type": "*type*", "id": "*id*"},...]                   
      |
++--------------------+---------------------------------------------------------------+
+|**Error Response**  | {"error":"*error_desc*"} :sup:`2`                       
      |
++--------------------+---------------------------------------------------------------+
+|**Attention**       | The response in this request is an array.               
      |
++--------------------+---------------------------------------------------------------+
+
+POST Request
+------------
+
++--------------------+----------------------------------------------------------------+
+|**Title**           |Add an attribute to an identity                          
       |
++--------------------+----------------------------------------------------------------+
+|**URL**             |:literal:`/reclaim/attributes/'ego'`                     
       |
++--------------------+----------------------------------------------------------------+
+|**Method**          |**POST**                                                 
       |
++--------------------+----------------------------------------------------------------+
+|**URL Params**      |none                                                     
       |
++--------------------+----------------------------------------------------------------+
+|**Data Params**     |{"value":"*value*", "name":"*name*",                     
       |
+|                    | "type": "*type*", "id": "*id*"}                         
       |
++--------------------+----------------------------------------------------------------+
+|**Success Response**|Response Code: :literal:` b) 200 OK`                     
       |
++--------------------+----------------------------------------------------------------+
+|**Error Response**  | {"error":"*error_desc*"} :sup:`2; 3 or 4`               
       |
++--------------------+----------------------------------------------------------------+
+
+|
+
++--------------------+---------------------------------------------------------------+
+|**Title**           |Revoke an issued ticket                                  
      |
++--------------------+---------------------------------------------------------------+
+|**URL**             |:literal:`/reclaim/revoke`                               
      |
++--------------------+---------------------------------------------------------------+
+|**Method**          |**POST**                                                 
      |
++--------------------+---------------------------------------------------------------+
+|**URL Params**      |none                                                     
      |
++--------------------+---------------------------------------------------------------+
+|**Data Params**     |{"issuer": "*key*", "audience": "*key*", "rnd": "*id*"}  
      |
++--------------------+---------------------------------------------------------------+
+|**Success Response**| Response Code: :literal:` b) 200 OK`                    
      |
++--------------------+---------------------------------------------------------------+
+|**Error Response**  | | {"error":"*error_desc*"} :sup:`6; 7`                  
      |
++--------------------+---------------------------------------------------------------+
+
+|
+
++--------------------+---------------------------------------------------------------+
+|**Title**           |Consume/Exchange a ticket and retrieve attributes        
      |
++--------------------+---------------------------------------------------------------+
+|**URL**             |:literal:`/reclaim/consume`                              
      |
++--------------------+---------------------------------------------------------------+
+|**Method**          |**POST**                                                 
      |
++--------------------+---------------------------------------------------------------+
+|**URL Params**      |none                                                     
      |
++--------------------+---------------------------------------------------------------+
+|**Data Params**     |{"issuer": "*key*", "audience": "*key*", "rnd": "*id*"}  
      |
++--------------------+---------------------------------------------------------------+
+|**Success Response**|[{"value":"*value*", "name":"*name*",                    
      |
+|                    |  "type": "*type*", "id": "*id*"},...]                   
      |
++--------------------+---------------------------------------------------------------+
+|**Error Response**  | | {"error":"*error_desc*"} :sup:`6; 7`                  
      |
++--------------------+---------------------------------------------------------------+
+
+
+DELETE Request
+--------------
+
++--------------------+---------------------------------------------------------------+
+|**Title**           |Delete an attribute from an identity                     
      |
++--------------------+---------------------------------------------------------------+
+|**URL**             |:literal:`/reclaim/attributes/'ego'/'id'`                
      |
++--------------------+---------------------------------------------------------------+
+|**Method**          |**DELETE**                                               
      |
++--------------------+---------------------------------------------------------------+
+|**URL Params**      |none                                                     
      |
++--------------------+---------------------------------------------------------------+
+|**Data Params**     |none                                                     
      |
++--------------------+---------------------------------------------------------------+
+|**Success Response**|Response Code: :literal:` b) 200 OK`                     
      |
++--------------------+---------------------------------------------------------------+
+|**Error Response**  | {"error":"*error_desc*"} :sup:`2; 5`                    
      |
++--------------------+---------------------------------------------------------------+
+
+OPTIONS Request
+---------------
+
++--------------------+----------------------------------------------------------------+
+|**Title**           |Gets request options                                     
       |
++--------------------+----------------------------------------------------------------+
+|**URL**             |:literal:`/reclaim`                                      
       |
++--------------------+----------------------------------------------------------------+
+|**Method**          |**OPTIONS**                                              
       |
++--------------------+----------------------------------------------------------------+
+|**URL Params**      |none                                                     
       |
++--------------------+----------------------------------------------------------------+
+|**Data Params**     |none                                                     
       |
++--------------------+----------------------------------------------------------------+
+|**Success Response**|                                                         
       |
++--------------------+----------------------------------------------------------------+
+|**Error Response**  |none                                                     
       |
++--------------------+----------------------------------------------------------------+

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



reply via email to

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