Skip to content

Latest commit

 

History

History
105 lines (60 loc) · 1.79 KB

README.md

File metadata and controls

105 lines (60 loc) · 1.79 KB

Keyholder Server

Backend server for the Keyholder project

Requirements

Installation

git clone https://github.com/sunsay/keyholder-server.git
cd keyholder-server
npm install

Run

npm start

Options

  • JWT_SECRET - String used to sign jwt tokens / REQUIRED

  • PORT [3000] - Keyholder Server port

  • SSL_PORT [3443] - Keyholder Server port (SSL)

  • SSL_PRIVATE_KEY [null] - SSL Private Key

  • SSL_CERTIFICATE [null] - SSL Certificate

  • REDIS_HOST [localhost] - Redis server host

  • REDIS_PORT [6379] - Redis server port

Description

Simple key-value server for storing encrypted data

Endpoints

Requests should have application/x-www-form-urlencoded content type.

POST /sign_up

Register new account

Parameters

  • login
  • secret
  • data (Optional)

Response

{
    "token": "<JWT_TOKEN>",
    "data": "<DATA>" or null
}

POST /sign_in

Log in to the system

Parameters

  • login
  • secret

Response

{
    "token": "<JWT_TOKEN>",
    "data": "<DATA>" or null
}

GET /storage

Get storage for the logged in user.

You should add Authorization header with token which was received on sign up or sign in step to the request.

Authorization: Bearer <JWT_TOKEN>

Response

<DATA>

PUT /storage

Update storage data for the logged in user.

You should add Authorization header with token which was received on sign up or sign in step to the request.

Authorization: Bearer <JWT_TOKEN>

Parameters

  • data

forthebadge forthebadge