1.8.0-alpha6 • Published 6 years ago
@tanker/server-httpd v1.8.0-alpha6
Tanker HTTP Server
HTTP server to interact with Tanker Server as a microservice.
Cli API
tanker-server-httpd [options]
General options:
-c, --config <path> Path to a config file containg Server and/or Tanker options
-h, --help Display usage information
--version Display the version of tanker-server-httpd
When a config file is given with -c/--config, all options below override values from the config file.
Server options:
--bearer-token <bearerToken> The HTTP Bearer token to protect access to the HTTP endpoints
--server-port <serverPort> The port on which the HTTP server is listening connections
--writable-path <writablePath> The folder in which to persist the server data (defaults to current directory)
Tanker options:
--server-id <serverId> The Tanker server identifier
--server-token <serverToken> The Tanker server token for that user
--trustchain-id <trustchainId> The Tanker trustchain id
HTTP API specification
Type | Route | Description |
---|---|---|
POST | /v1/encrypt | Take data and return it encrypted |
POST | /v1/decrypt | Take encrypted data and return clear data |
POST | /v1/share | Share resources to new users and groups |
GET | /healthz | Ping |
Errors
If an error occurred, the response will contain:
- An appropriate 4xx, or 5xx HTTP status code,
- A
Content-Type: application/json
header, A JSON body in the following format:
{ code: str, message: str }
Error codes are described below:
Code HTTP Status Code Message invalid_auth_token 401 Unauthorized You did not provide the correct token in the Authorization HTTP header invalid_content_type 400 Bad Request You did not provide the Content-Type Content-Type
HTTP headerinvalid_body 400 Bad Request You did not provide the number of bytes specified by the Content-Length HTTP header missing_recipients 400 Bad Request You did not provide the shareWith
field in the HTTP bodymissing_resources 400 Bad Request You did not provide the resourcesIds
field in the HTTP bodyinvalid_encrypted_data 400 Bad Request The provided encrypted data is invalid internal_server_error 500 Internal Server Error We encountered an internal error. Please try again. resource_key_not_found 404 Not Found The ressource key to decrypt the body is not available recipient_not_found 404 Not Found One of the recipients you tried to share with does not exist resource_not_found 404 Not Found One of the resources you tried to share does not exist
Further Documentation
More detailed documentation about the HTTP API is available at https://tanker.io/docs/latest/.