Consists of a single, one-shot request, GET /restful/route/all.json, for
the time being. A "newsince" request can be added later.
Add a Markdown tech doc that specifies the new Route REST API and update
the MDP tech doc a little.
Add the 'routerestful' test script, which uses some test utility
fuctions that have been factored out of the 'routing' test script into
the new testdefs_routing.sh.
Add the new 'allrestful' test script.
- make "debug.h" a private header so that the DEBUG() macro does not
interfere with Xcode Debug builds, which set DEBUG=1
- move all #include "debug.h" from headers into .c files
- move 'struct idebug' into a new public header "idebug.h" so that
"log.h" can be public
- move HTTPD port number defs from "httpd.h" to "constants.h", so that
"httpd.h" can be private and "conf.h" can be public
- add missing nested includes so each header compiles stand-alone
without error
- #include "sodium.h" instead of <sodium.h>
- #include "sqlite3.h" instead of <sqlite3.h>
- add header guard to "fifo.h"
- fix header guard in "sync_keys.h"
Update the Java API to be consistent with recent changes to the Rhizome
REST API was that regularised the MIME types used in Content-Type
headers.
Add some missing CONTENT_TYPE_ constants to "httpd.h", and ensure they
are consistent with the Java getMimeType() methods in subclasses of
AbstractId.
Add the --stderr option to all executeJavaOk statements in the
'rhizomejava' test script, to reveal the exception message in the case
of failure.
The REST Rhizome import request now requires the 'id' and 'version'
query parameters to either both be supplied or neither, and fails if
they do not match the manifest that is supplied in the request body.
Added a test case for this.
Added a test case to ensure that if the 'id' and 'version' query
parameters cause a hit (already in store) then the response is sent
immediately without reading the request body.
Improve the documentation for the REST Rhizome import request.
Undo a change from late 2015 that allowed the format=text+binarysig
parameter of the rhizome/manifest MIME content-type to be optional -- it
is easy to provide that parameter via libcurl, and the lbard code has
just been updated to provide it.
Make Content-Type handling consistent throughout the Serval DNA code by
using 'struct mime_content_type' to represent both parsed (request) and
sent (response) Content-Type fields, replacing ad-hoc in-line string
literals.
Fix some TODOs by adding the "serval/sid", "rhizome/bid" and
"rhizome/bundlesecret" MIME types, which remain optional for the time
being to preserve REST API compatibility with clients that do not set
the Content-Type of their 'bundle-author', 'bundle-id' and
'bundle-secret' parameters.
- Introduce the new 'struct rhizome_bundle_result' that contains a
rhizome_bundle_status enum value and an optional, nul-terminated
string that provides an explanation of the cause of the status; add
functions to construct, query, and free the struct
- Replace 'enum rhizome_add_result' with 'struct rhizome_bundle_result',
removing an unnecessary level of enum interpretation
- Make rhizome_fill_manifest() return 'struct rhizome_bundle_result' and
add logic to check that the supplied author SID is correct (previous
behaviour was: if an incorrect author SID was supplied but the correct
author could be found in the keyring, then the incorrect one was
silently ignored)
- Simplify the response code in rhizome_restful.cc to take advantage of
the new 'struct rhizome_bundle_result'; in particular, the mapping
from 'enum rhizome_bundle_status' codes to HTTP status codes is now
expressed in a single switch statement
- Fix some minor failures in test scripts revealed by the changes
List all the HTTP status codes in the REST API tech doc.
Only use 403 Forbidden for requests originating from a disallowed
origin (ie, not localhost).
- Return 400 for missing, unknown, duplicate and out-of-order form
parts in POST requests.
- Return 415 Unsupported Media Type for unsupported form part
Content-Disposition and Content-Type (including unsupported
charset).
- Return 414 Request-URI Too Long for any buffer exhaustion while
parsing request.
- Return 419 Authentication Timeout for missing crypto secret.
During GET /restful/meshms/SID1/SID2/newsince/messagelist.json, if a new
message was received before the request reached the end of its message
iterator and paused, then the new message did not make it into the
output.
Distinguish between fatal and user-supplied-input errors, return
error descriptive text in a strbuf to allow dynamic content, apply
user-supplied field assgnments/deletions _after_ copying existing
manifest fields, use exit status 4 (invalid manifest) when applying
journal append to a non-journal or vice versa
/restful/meshms/newsince/SID1/SID2/newsince/TOKEN/messagelist.json now
always lists an ACK as soon as it is received, instead of waiting for a
message to arrive as well.
Add RHIZOME_BUNDLE_STATUS_READONLY enum value
Tighten up switch statements on bundle and payload status enums (no
default labels)
Rename some recently added enum entries
Return bundle status and payload status in HTTP responses
Add test for failing to decrypt a foreign encrypted bundle payload,
fix bug that caused an assertion failure
Add tests for fetching a non-existent manifest and fetching bundles
whose payload blob is not in the store
/restful/meshms/SID/SID/sendmessage now enforces Content-Disposition:
form-data (was ignoring), and enforces Content-Type: text/plain;
charset=utf-8 (was ignoring)
New negative test cases to ensure that these are treated strictly