aboutsummaryrefslogtreecommitdiff
path: root/lockchain-http/README.md
blob: 1dc9d0b3420b346be639c1b9a67f6a201d89133e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# 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.

```json
{
    "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.