diff options
author | Phil <phil.buschmann@tum.de> | 2018-08-06 02:51:27 +0200 |
---|---|---|
committer | Phil <phil.buschmann@tum.de> | 2018-08-06 02:51:27 +0200 |
commit | 804493770fe509e3abff60e16e93429e06ad593c (patch) | |
tree | e268aa674237dbaa9226bc11405fe8735a4b6db2 | |
parent | 802b073508b373d6d1dd03c134d301b44cc49b64 (diff) | |
download | gnunet-rest-api-804493770fe509e3abff60e16e93429e06ad593c.tar.gz gnunet-rest-api-804493770fe509e3abff60e16e93429e06ad593c.zip |
Changed identity, gns and namestore
-rw-r--r-- | source/conf.py | 4 | ||||
-rw-r--r-- | source/gns.rst | 35 | ||||
-rw-r--r-- | source/identity.rst | 76 | ||||
-rw-r--r-- | source/namestore.rst | 2 |
4 files changed, 92 insertions, 25 deletions
diff --git a/source/conf.py b/source/conf.py index e5ed1eb..45ea518 100644 --- a/source/conf.py +++ b/source/conf.py | |||
@@ -74,7 +74,7 @@ pygments_style = 'sphinx' | |||
74 | # The theme to use for HTML and HTML Help pages. See the documentation for | 74 | # The theme to use for HTML and HTML Help pages. See the documentation for |
75 | # a list of builtin themes. | 75 | # a list of builtin themes. |
76 | # | 76 | # |
77 | html_theme = 'alabaster' | 77 | html_theme = 'nature' |
78 | 78 | ||
79 | # Theme options are theme-specific and customize the look and feel of a theme | 79 | # Theme options are theme-specific and customize the look and feel of a theme |
80 | # further. For a list of options available for each theme, see the | 80 | # further. For a list of options available for each theme, see the |
@@ -152,4 +152,4 @@ texinfo_documents = [ | |||
152 | (master_doc, 'GNUnetRESTAPI', 'GNUnet REST API Documentation', | 152 | (master_doc, 'GNUnetRESTAPI', 'GNUnet REST API Documentation', |
153 | author, 'GNUnetRESTAPI', 'One line description of project.', | 153 | author, 'GNUnetRESTAPI', 'One line description of project.', |
154 | 'Miscellaneous'), | 154 | 'Miscellaneous'), |
155 | ] \ No newline at end of file | 155 | ] |
diff --git a/source/gns.rst b/source/gns.rst index aa76b88..240a9d9 100644 --- a/source/gns.rst +++ b/source/gns.rst | |||
@@ -1,3 +1,5 @@ | |||
1 | .. _ref-type: | ||
2 | |||
1 | GNUnet GNS API Service | 3 | GNUnet GNS API Service |
2 | ====================== | 4 | ====================== |
3 | 5 | ||
@@ -5,26 +7,27 @@ Variables in single quotes ``'...'`` can or must be changed according to your sp | |||
5 | 7 | ||
6 | ``name`` is the name of an identity. | 8 | ``name`` is the name of an identity. |
7 | 9 | ||
8 | ``record_type`` is the record_type. For example, ANY, PKEY... For more information look into the source code of "gnunet_gnsrecord_lib.h". | 10 | ``record_type`` is the record_type. It can be ANY, PKEY, NICK, LEHO, VPN, GNS2DNS, BOX, PLACE, PHONE, ID_ATTR, ID_TOKEN, ID_TOKEN_METADATA, CREDENTIAL, POLICY, ATTRIBUTE, ABE_KEY, ABE_MASTER. You can find more information in header ``src/gnunet_gnsrecord_lib.h`` |
9 | 11 | ||
10 | ============ | 12 | ============ |
11 | GET Requests | 13 | GET Requests |
12 | ============ | 14 | ============ |
13 | 15 | ||
14 | +--------------------+------------------------------------------------------------------------------------------+ | 16 | For this request ``record_type`` is optional. If called with an invalid record_type, it will automatically be set to ANY. |
15 | |**Title** |Return all records for given name | | 17 | |
16 | +--------------------+------------------------------------------------------------------------------------------+ | 18 | +--------------------+--------------------------------------------------------------------------------------------------------------+ |
17 | |**URL** |:literal:`/gns?name='name'&record_type='record_type'` | | 19 | |**Title** |Return all records for given name | |
18 | +--------------------+------------------------------------------------------------------------------------------+ | 20 | +--------------------+--------------------------------------------------------------------------------------------------------------+ |
19 | |**Method** |**GET** | | 21 | |**URL** |:literal:`/gns?name='name'&record_type='record_type'` | |
20 | +--------------------+------------------------------------------------------------------------------------------+ | 22 | +--------------------+--------------------------------------------------------------------------------------------------------------+ |
21 | |**Data Params** |none | | 23 | |**Method** |**GET** | |
22 | +--------------------+------------------------------------------------------------------------------------------+ | 24 | +--------------------+--------------------------------------------------------------------------------------------------------------+ |
23 | |**Success Response**|[*TODO* gns record to string,...] | | 25 | |**Data Params** |none | |
24 | +--------------------+------------------------------------------------------------------------------------------+ | 26 | +--------------------+--------------------------------------------------------------------------------------------------------------+ |
25 | |**Error Response** |{"error":"*error_desc*"} | | 27 | |**Success Response**| [{"value": "*value*", "type": "*type*", "expiration_time": "*time*", "flag": *flag*, "label": "*name*"},...] | |
26 | +--------------------+------------------------------------------------------------------------------------------+ | 28 | +--------------------+--------------------------------------------------------------------------------------------------------------+ |
27 | 29 | |**Error Response** |{"error":"*error_desc*"} | | |
30 | +--------------------+--------------------------------------------------------------------------------------------------------------+ | ||
28 | 31 | ||
29 | =============== | 32 | =============== |
30 | OPTIONS Request | 33 | OPTIONS Request |
@@ -41,7 +44,7 @@ OPTIONS Request | |||
41 | +--------------------+---------------------------------------------------------+ | 44 | +--------------------+---------------------------------------------------------+ |
42 | |**Data Params** |none | | 45 | |**Data Params** |none | |
43 | +--------------------+---------------------------------------------------------+ | 46 | +--------------------+---------------------------------------------------------+ |
44 | |**Success Response**|Access-Control-Allow-Methods: GET | | 47 | |**Success Response**| | |
45 | +--------------------+---------------------------------------------------------+ | 48 | +--------------------+---------------------------------------------------------+ |
46 | |**Error Response** |none | | 49 | |**Error Response** |none | |
47 | +--------------------+---------------------------------------------------------+ | 50 | +--------------------+---------------------------------------------------------+ |
diff --git a/source/identity.rst b/source/identity.rst index ee2b1e7..79120c3 100644 --- a/source/identity.rst +++ b/source/identity.rst | |||
@@ -3,9 +3,9 @@ GNUnet Identity API Service | |||
3 | 3 | ||
4 | Variables in single quotes ``'...'`` can or must be changed according to your specific case. | 4 | Variables in single quotes ``'...'`` can or must be changed according to your specific case. |
5 | 5 | ||
6 | ``pubkey`` or ``public_key`` is the public key of an identity. | 6 | ``public_key`` is the public key of an identity. |
7 | 7 | ||
8 | ``name`` is the name of an identity. | 8 | ``name`` is the name of an identity. ``newname`` is the new name of an identity. |
9 | 9 | ||
10 | ``subsystem`` is a subsystem of GNUnet. | 10 | ``subsystem`` is a subsystem of GNUnet. |
11 | 11 | ||
@@ -98,7 +98,7 @@ POST Request | |||
98 | +--------------------+----------------------------------------------------+ | 98 | +--------------------+----------------------------------------------------+ |
99 | |**URL Params** |none | | 99 | |**URL Params** |none | |
100 | +--------------------+----------------------------------------------------+ | 100 | +--------------------+----------------------------------------------------+ |
101 | |**Data Params** |{"name":'*name*'} | | 101 | |**Data Params** | {"name":'*name*'} | |
102 | +--------------------+----------------------------------------------------+ | 102 | +--------------------+----------------------------------------------------+ |
103 | |**Success Response**|Response Code: :literal:`201` (Created) | | 103 | |**Success Response**|Response Code: :literal:`201` (Created) | |
104 | +--------------------+----------------------------------------------------+ | 104 | +--------------------+----------------------------------------------------+ |
@@ -119,7 +119,7 @@ PUT Request | |||
119 | +--------------------+----------------------------------------------------+ | 119 | +--------------------+----------------------------------------------------+ |
120 | |**URL Params** |none | | 120 | |**URL Params** |none | |
121 | +--------------------+----------------------------------------------------+ | 121 | +--------------------+----------------------------------------------------+ |
122 | |**Data Params** | {"newname":'*name*', "pubkey": '*public_key*'} | | 122 | |**Data Params** | {"newname":'*newname*', "pubkey": '*public_key*'} | |
123 | +--------------------+----------------------------------------------------+ | 123 | +--------------------+----------------------------------------------------+ |
124 | |**Success Response**|Response Code: :literal:`204` (No Content) | | 124 | |**Success Response**|Response Code: :literal:`204` (No Content) | |
125 | +--------------------+----------------------------------------------------+ | 125 | +--------------------+----------------------------------------------------+ |
@@ -133,6 +133,50 @@ PUT Request | |||
133 | | | 133 | | |
134 | 134 | ||
135 | +--------------------+----------------------------------------------------+ | 135 | +--------------------+----------------------------------------------------+ |
136 | |**Title** |Changes name of identity | | ||
137 | +--------------------+----------------------------------------------------+ | ||
138 | |**URL** |:literal:`/identity` | | ||
139 | +--------------------+----------------------------------------------------+ | ||
140 | |**Method** |**PUT** | | ||
141 | +--------------------+----------------------------------------------------+ | ||
142 | |**URL Params** |none | | ||
143 | +--------------------+----------------------------------------------------+ | ||
144 | |**Data Params** | {"newname":'*newname*', "name": '*name*'} | | ||
145 | +--------------------+----------------------------------------------------+ | ||
146 | |**Success Response**|Response Code: :literal:`204` (No Content) | | ||
147 | +--------------------+----------------------------------------------------+ | ||
148 | |**Error Response** | | {"error":"*error_desc*"} | | ||
149 | | | | *or* | | ||
150 | | | | Response Code: :literal:`404` (Not Found) | | ||
151 | | | | *or* | | ||
152 | | | | Response Code: :literal:`409` (Conflict) | | ||
153 | +--------------------+----------------------------------------------------+ | ||
154 | |||
155 | | | ||
156 | |||
157 | +--------------------+------------------------------------------------------+ | ||
158 | |**Title** |Sets identity as default for a subsystem | | ||
159 | +--------------------+------------------------------------------------------+ | ||
160 | |**URL** |:literal:`/identity` | | ||
161 | +--------------------+------------------------------------------------------+ | ||
162 | |**Method** |**PUT** | | ||
163 | +--------------------+------------------------------------------------------+ | ||
164 | |**URL Params** |none | | ||
165 | +--------------------+------------------------------------------------------+ | ||
166 | |**Data Params** | {"subsystem":'*subsystem*', "pubkey": '*public_key*'}| | ||
167 | +--------------------+------------------------------------------------------+ | ||
168 | |**Success Response**|Response Code: :literal:`204` (No Content) | | ||
169 | +--------------------+------------------------------------------------------+ | ||
170 | |**Error Response** | | {"error":"*error_desc*"} | | ||
171 | | | | *or* | | ||
172 | | | | Response Code: :literal:`404` (Not Found) | | ||
173 | | | | *or* | | ||
174 | | | | Response Code: :literal:`409` (Conflict) | | ||
175 | +--------------------+------------------------------------------------------+ | ||
176 | |||
177 | | | ||
178 | |||
179 | +--------------------+----------------------------------------------------+ | ||
136 | |**Title** |Sets identity as default for a subsystem | | 180 | |**Title** |Sets identity as default for a subsystem | |
137 | +--------------------+----------------------------------------------------+ | 181 | +--------------------+----------------------------------------------------+ |
138 | |**URL** |:literal:`/identity` | | 182 | |**URL** |:literal:`/identity` | |
@@ -141,7 +185,7 @@ PUT Request | |||
141 | +--------------------+----------------------------------------------------+ | 185 | +--------------------+----------------------------------------------------+ |
142 | |**URL Params** |none | | 186 | |**URL Params** |none | |
143 | +--------------------+----------------------------------------------------+ | 187 | +--------------------+----------------------------------------------------+ |
144 | |**Data Params** | {"subsystem":'*name*', "pubkey": '*public_key*'} | | 188 | |**Data Params** | {"subsystem":'*subsystem*', "name": '*name*'} | |
145 | +--------------------+----------------------------------------------------+ | 189 | +--------------------+----------------------------------------------------+ |
146 | |**Success Response**|Response Code: :literal:`204` (No Content) | | 190 | |**Success Response**|Response Code: :literal:`204` (No Content) | |
147 | +--------------------+----------------------------------------------------+ | 191 | +--------------------+----------------------------------------------------+ |
@@ -174,6 +218,26 @@ DELETE Request | |||
174 | | | | Response Code: :literal:`404` (Not Found) | | 218 | | | | Response Code: :literal:`404` (Not Found) | |
175 | +--------------------+----------------------------------------------------+ | 219 | +--------------------+----------------------------------------------------+ |
176 | 220 | ||
221 | | | ||
222 | |||
223 | +--------------------+----------------------------------------------------+ | ||
224 | |**Title** |Deletes specific identity | | ||
225 | +--------------------+----------------------------------------------------+ | ||
226 | |**URL** |:literal:`/identity?name='name'` | | ||
227 | +--------------------+----------------------------------------------------+ | ||
228 | |**Method** |**DELETE** | | ||
229 | +--------------------+----------------------------------------------------+ | ||
230 | |**URL Params** |none | | ||
231 | +--------------------+----------------------------------------------------+ | ||
232 | |**Data Params** |none | | ||
233 | +--------------------+----------------------------------------------------+ | ||
234 | |**Success Response**|Response Code: :literal:`204` (No Content) | | ||
235 | +--------------------+----------------------------------------------------+ | ||
236 | |**Error Response** | | {"error":"*error_desc*"} | | ||
237 | | | | *or* | | ||
238 | | | | Response Code: :literal:`404` (Not Found) | | ||
239 | +--------------------+----------------------------------------------------+ | ||
240 | |||
177 | 241 | ||
178 | OPTIONS Request | 242 | OPTIONS Request |
179 | --------------- | 243 | --------------- |
@@ -189,7 +253,7 @@ OPTIONS Request | |||
189 | +--------------------+---------------------------------------------------------+ | 253 | +--------------------+---------------------------------------------------------+ |
190 | |**Data Params** |none | | 254 | |**Data Params** |none | |
191 | +--------------------+---------------------------------------------------------+ | 255 | +--------------------+---------------------------------------------------------+ |
192 | |**Success Response**|Access-Control-Allow-Methods: GET,POST,PUT,DELETE,OPTIONS| | 256 | |**Success Response**| | |
193 | +--------------------+---------------------------------------------------------+ | 257 | +--------------------+---------------------------------------------------------+ |
194 | |**Error Response** |none | | 258 | |**Error Response** |none | |
195 | +--------------------+---------------------------------------------------------+ | 259 | +--------------------+---------------------------------------------------------+ |
diff --git a/source/namestore.rst b/source/namestore.rst index 6adb4a2..35eb104 100644 --- a/source/namestore.rst +++ b/source/namestore.rst | |||
@@ -5,7 +5,7 @@ Variables in single quotes ``'...'`` can or must be changed according to your sp | |||
5 | 5 | ||
6 | Namestore communicates with GNS records. | 6 | Namestore communicates with GNS records. |
7 | 7 | ||
8 | ``type`` is the type of the record, e.g. "PKEY" for private key. | 8 | ``type`` is the type of the record, e.g. "PKEY" for private key. Possible types are listed in :ref:`ref-type`. |
9 | 9 | ||
10 | ``value`` is the value of the specific type of the record, e.g. the private key of an identity. | 10 | ``value`` is the value of the specific type of the record, e.g. the private key of an identity. |
11 | 11 | ||