diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/documentation/chapters/developer.texi | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/doc/documentation/chapters/developer.texi b/doc/documentation/chapters/developer.texi index c7d7ddaac..e95355302 100644 --- a/doc/documentation/chapters/developer.texi +++ b/doc/documentation/chapters/developer.texi | |||
@@ -75,6 +75,7 @@ new chapters, sections or insightful comments. | |||
75 | * REVOCATION Subsystem:: | 75 | * REVOCATION Subsystem:: |
76 | * File-sharing (FS) Subsystem:: | 76 | * File-sharing (FS) Subsystem:: |
77 | * REGEX Subsystem:: | 77 | * REGEX Subsystem:: |
78 | * REST Subsystem:: | ||
78 | @end menu | 79 | @end menu |
79 | 80 | ||
80 | @node Developer Introduction | 81 | @node Developer Introduction |
@@ -8365,3 +8366,56 @@ create_strings.py <input path> <outfile> | |||
8365 | @noindent | 8366 | @noindent |
8366 | to create a search strings file from the previously created | 8367 | to create a search strings file from the previously created |
8367 | regular expressions. | 8368 | regular expressions. |
8369 | |||
8370 | @cindex REST subsystem | ||
8371 | @node REST Subsystem | ||
8372 | @section REST Subsystem | ||
8373 | |||
8374 | @c %**end of header | ||
8375 | |||
8376 | Using the REST subsystem, you can expose REST-based APIs or services. | ||
8377 | The REST service is designed as a pluggable architecture. | ||
8378 | To create a new REST endpoint, simply add a library in the form | ||
8379 | ``plugin_rest_*''. | ||
8380 | The REST service will automatically load all REST plugins on startup. | ||
8381 | |||
8382 | @strong{Configuration} | ||
8383 | |||
8384 | The rest service can be configured in various ways. | ||
8385 | The reference config file can be found in | ||
8386 | @file{src/rest/rest.conf}: | ||
8387 | @example | ||
8388 | [rest] | ||
8389 | REST_PORT=7776 | ||
8390 | REST_ALLOW_HEADERS=Authorization,Accept,Content-Type | ||
8391 | REST_ALLOW_ORIGIN=* | ||
8392 | REST_ALLOW_CREDENTIALS=true | ||
8393 | @end example | ||
8394 | |||
8395 | The port as well as Cross-origin resource sharing (CORS) headers that | ||
8396 | are supposed to be advertised by the rest service are configurable. | ||
8397 | |||
8398 | @menu | ||
8399 | * Namespace considerations:: | ||
8400 | * Endpoint documentation:: | ||
8401 | @end menu | ||
8402 | |||
8403 | @node Namespace considerations | ||
8404 | @subsection Namespace considerations | ||
8405 | |||
8406 | The gnunet-rest-service will load all plugins that are installed. | ||
8407 | As such it is important that the endpoint namespaces do not clash. | ||
8408 | For example, plugin X might expose the endpoint ``/xxx'' while plugin Y exposes | ||
8409 | endpoint ``/xxx/yyy''. | ||
8410 | This is a problem if plugins X is also supposed to handle a call to | ||
8411 | ``/xxx/yyy''. | ||
8412 | Currently, the REST service will not complain or warn about such clashes so | ||
8413 | please make sure that endpoints are unambiguous. | ||
8414 | |||
8415 | @node Endpoint documentation | ||
8416 | @subsection Endpoint documentation | ||
8417 | |||
8418 | This is WIP. Endpoints should be documented appropriately. | ||
8419 | Perferably using annotations. | ||
8420 | |||
8421 | |||