Verified Commit 7cc26c4e authored by Aral Balkan's avatar Aral Balkan
Browse files

Separate each service in the API into its own page

parent 75c2732b
...@@ -31,62 +31,8 @@ const encryptedPrivateSigningKey = await socket.send('get', 'owner', 'encrypted- ...@@ -31,62 +31,8 @@ const encryptedPrivateSigningKey = await socket.send('get', 'owner', 'encrypted-
curl -H "Accept: application/json" http://localhost:3030/owner/encrypted-private-signing-key curl -H "Accept: application/json" http://localhost:3030/owner/encrypted-private-signing-key
``` ```
In the documentation below, call types are listed in Feathers/WebSocket, REST verb order. In the API documentation, call types are listed in Feathers/WebSocket, REST verb order.
## Owner ## Services
The Owner API deals with registering the site owner and getting and setting details of the owner for authentication and site customisation. {{% children %}}
\ No newline at end of file
### create, POST
Registers the owner of the site. This route may only be successfully called once. Future attempts to register an owner once an owner has already been registered will result in `403: Forbidden` errors.
Expects the owner’s keys object:
```json
"derivedKeySalt": "string",
"encryptedPrivateSigningKeyNonce": "string",
"encryptedPrivateSigningKey": "string",
"publicSigningKey": "string"
```
On success, returns `201: Created` and the owner’s key object that it was passed.
### find, GET
On success, returns `200: OK` and the owner’s keys object.
### get, GET /key-type
Returns necessary information for the requested key type.
Valid key types are:
#### encrypted-private-signing-key
On success, returns `200: OK` and the following JSON object:
```json
"derivedKeySalt": "string",
"encryptedPrivateSigningKeyNonce": "string",
"encryptedPrivateSigningKey": "string",
```
This object has all information necessary to:
1. Create a derived key from the owner’s password (secret) using Argon2.
2. Decrypt the ed25519 encrypted private signing key using the derived key.
(This steps are prerequisites on the client for using public-key authentication to authenticate the owner.)
#### public-signing-key
On success, returns `200: OK` and a JSON object with the owner’s ed25519 public signing key:
```json
"publicSigningKey": "string"
```
#### Errors
* `404: Not Found`: requested key type does not exist or key not set yet (see the error message accompanying the error to see which)
\ No newline at end of file
---
title: 'Owner'
weight: 10
---
The Owner API deals with registering the site owner and getting and setting details of the owner for authentication and site customisation.
## create, POST
Registers the owner of the site. This route may only be successfully called once. Future attempts to register an owner once an owner has already been registered will result in `403: Forbidden` errors.
Expects the owner’s keys object:
```json
"derivedKeySalt": "string",
"encryptedPrivateSigningKeyNonce": "string",
"encryptedPrivateSigningKey": "string",
"publicSigningKey": "string"
```
On success, returns `201: Created` and the owner’s key object that it was passed.
## find, GET
On success, returns `200: OK` and the owner’s keys object.
## get, GET /key-type
Returns necessary information for the requested key type.
Valid key types are:
### encrypted-private-signing-key
On success, returns `200: OK` and the following JSON object:
```json
"derivedKeySalt": "string",
"encryptedPrivateSigningKeyNonce": "string",
"encryptedPrivateSigningKey": "string",
```
This object has all information necessary to:
1. Create a derived key from the owner’s password (secret) using Argon2.
2. Decrypt the ed25519 encrypted private signing key using the derived key.
(This steps are prerequisites on the client for using public-key authentication to authenticate the owner.)
### public-signing-key
On success, returns `200: OK` and a JSON object with the owner’s ed25519 public signing key:
```json
"publicSigningKey": "string"
```
### Errors
* `404: Not Found`: requested key type does not exist or key not set yet (see the error message accompanying the error to see which)
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment