🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

@tanker/server-httpd

Package Overview
Dependencies
Maintainers
5
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tanker/server-httpd

HTTP server to interact with Tanker Server as a microservice.

latest
npmnpm
Version
1.8.0-alpha6
Version published
Maintainers
5
Created
Source

Tanker HTTP Server

HTTP server to interact with Tanker Server as a microservice.

Cli API

tanker-server-httpd [options]

All the options can override the one from the config file.

General options:

  • -c,--config=configFile path to a configuration file
  • --version the version of the server
  • -h,--help usage

Options related to Tanker

  • --server-id The Tanker server identifier
  • --server-token The Tanker serverToken for that user
  • --trustchain-id The Tanker trustchain id

Options related to HTTP

  • --bearer-token=bearerToken The HTTP Bearer token to protect access to the HTTP endpoints

HTTP API specification

TypeRouteDescription
POST/v1/encryptTake data and return it encrypted
POST/v1/decryptTake encrypted data and return clear data
POST/v1/shareShare resources to new users and groups
GET/healthzPing

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:

    CodeHTTP Status CodeMessage
    invalid_auth_token401 UnauthorizedYou did not provide the correct token in the Authorization HTTP header
    invalid_content_type400 Bad RequestYou did not provide the Content-Type Content-Type HTTP header
    invalid_body400 Bad RequestYou did not provide the number of bytes specified by the Content-Length HTTP header
    missing_recipients400 Bad RequestYou did not provide the shareWith field in the HTTP body
    missing_resources400 Bad RequestYou did not provide the resourcesIds field in the HTTP body
    invalid_encrypted_data400 Bad RequestThe provided encrypted data is invalid
    internal_server_error500 Internal Server ErrorWe encountered an internal error. Please try again.
    resource_key_not_found404 Not FoundThe ressource key to decrypt the body is not available
    recipient_not_found404 Not FoundOne of the recipients you tried to share with does not exist
    resource_not_found404 Not FoundOne 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/.

FAQs

Package last updated on 29 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts