Commit Graph

15 Commits

Author SHA1 Message Date
Andrew Bettison
bc7f7aeaaf Refactor all REST API tests
Rename 'testdefs_json.sh' to 'testdefs_rest.sh'; add setup functions and
rest_request() function, and roll out through existing test scripts.
2018-03-27 17:29:21 +10:30
Andrew Bettison
98ec1c9608 Redesign the Keyring REST API (fixes #132)
The new API follows REST rules by using the proper request verbs:
POST, PUT, PATCH and DELETE, instead of just GET.

The legacy GET-only API is still supported for backward compatibility,
but not longer tested or documented.

Add a new query-single-identity operation.

Implement the lock-single-identity operation, which until now had been
documented but not yet implemented.  Whenever a single identity is
locked (released), any other unlocked identities with the same PIN are
flagged to indicate that the PIN is not "fully" unlocked, so that the
next time the PIN is entered, the slot decryption is re-tried for
non-loaded identities, and the locked identity will be unlocked again.

Update the 'keyring' and 'keyringrestful' test scripts:
- refactored to reduce curl command-line clutter in test cases
- now tests the redesigned request verbs and paths
- added a test for GET /restful/keyring/SID
- added a test for PUT /restful/keyring/SID/lock
2018-03-19 18:06:23 +10:30
Jeremy Lakeman
88d70fc386 Don't assert if a query parameter is empty 2017-03-22 13:04:58 +10:30
Andrew Bettison
a8e394d299 Add "keyring remove" command
Adds a CLI and RESTful API operation for "keyring remove", with simple
test cases.  Added the corresponding Java API operation.  Updated the
API documentation.

API change: for consistency with RESTful API design, the GET
/restful/keyring/add operation now returns "201 Created" not "200 OK" if
successful.
2016-11-07 13:07:49 +10:30
Andrew Bettison
298b83f97b Fix a failing keyringrestful test
The recent randomising of keyring slots broke an assumption
about the order of the 'keyring list' output.  Now the test's
assertions do not assume any order.
2016-09-21 12:16:50 +09:30
Jeremy Lakeman
b6256ea89a Add identity_t type & rename signing key api to identity. 2016-08-16 12:22:13 +09:30
Andrew Bettison
714ea63190 Change JSON response of GET HTTP /restful/keyring/...
Return "sid", "did" and "name" fields inside their own "identity"
object
2015-08-31 19:16:30 +09:30
Andrew Bettison
8ba612ffa1 HTTP GET /restful/keyring/set[?pin=PIN][&did=DID][&name=Name] 2015-08-24 22:54:45 +09:30
Andrew Bettison
8834a81575 Refactor HTTP GET /restful/keyring/add 2015-08-24 22:44:24 +09:30
Andrew Bettison
380a72113c pin= query param for HTTP GET /restful/keyring/identities.json 2015-08-24 22:41:53 +09:30
Andrew Bettison
b7ba297e31 Add TODO comments to randomise keyring slot allocation 2015-08-24 22:41:53 +09:30
Andrew Bettison
73ced0f93a pin= query param for HTTP GET /restful/keyring/add 2015-08-24 22:41:53 +09:30
Andrew Bettison
586c6b3060 Add HTTP GET /restful/keyring/add 2015-08-10 18:13:57 +09:30
Andrew Bettison
45c6b9ecfa Refactor: set $CR and $HT in testdefs.sh
Fix some bugs in test scripts that used $CR without setting it
2015-06-02 02:23:06 +09:30
Tobias Wooldridge
e79e74feb9 Exposes a list of configured identities through the REST API at /keyring/identities.json 2014-10-31 15:19:59 +10:30