#api-version #http-interface #vault #record #encryption #play #lockchain

nightly lockchain-http

Generic HTTP interface crate for the lockchain ecosystem. Can serve both encrypted and cleartext records

7 releases (4 breaking)

Uses old Rust 2015

0.4.0 Jul 12, 2018
0.3.0 Jun 13, 2018
0.2.1 Jun 9, 2018
0.1.1 Jun 7, 2018
0.0.0 May 8, 2018

#971 in Authentication

MIT/X11 OR Apache-2.0

65KB
1K SLoC

lockchain-http

A plug and play http interface layer for various lockchain components.

API Reference

This document will move.

All JSON payloads also include an error field that is set in case of errors, if no other data is set.

{
    "error": ["Prose error description", 5 /* error code*/ ],
    "data": {
        /* Whatever the data is – depending on endpoint */
    }
}

GET /api

Get information about this API endpoint. Information is received in JSON format and include the following fields.

  • verison: The API version
  • providers: An array with type providers. This includes the Vault and Body implementation specifics.
  • hostname: Optional value which specifies the server name
  • supported: A list of supported client/ API combinations, writtin in tuple form. These are auto-generated by the API provider

GET /{api version}/vault

Get a list of vaults known to this system, possibly only returning a single value

  • vaults: List of vault names that are available to work with
  • count: The number of vaults available

PUT /{api version}/vault

Create a new vault. Payloads

  • name: The name of the vault
  • location: The location of a vault, left to the implementation specifics

POST /{api version}/vault/{id}

Update metadata about a vault that already exists. Will return an error if it doesn't

DELETE /{api version}/vault/{id}

Delete a vault; a second transaction is required to confirm, after all users were logged-out

GET /{api version}/vault/{vault id}/records/{record id}

Get a specific record from a vault. Only available if authenticated

PUT /{api version}/vault/{vault id}/records

Add a new record to a vault. Only available if authenticated

POST /{api version}/vault/{vault id}/records/{record id}

Update data inside an existing record. Only available if authenticated

DELETE /{api version}/vault/{vault id}/records/{record id}

Delete a record. Only available if authenticated

GET /{api version}/users

Get a list of available users

PUT /{api version}/users

Create a new user

DELETE /{api version}/users/{id}

Delete a user. Only available if authenticated as THAT user.

In the future, admin users (and priviledge hirarchies might be added)

PUT /{api version}/authenticate

Authenticate as a specific user

  • username: The user to authenticate as
  • password: The user passphrase to use for authentication (different from the encryption passphrase)

PUT /{api version}/de-authenticate

Called to end an active session.

Dependencies

~30MB
~547K SLoC