Skip to content
Stefan-Cosmin Romanescu edited this page May 19, 2019 · 18 revisions

Table of Contents

Prerequisites

Install or update Node to version 10.15.3 or newer.

Install and start a CSBWizard Node

First of all, create a local clone of the PrivateSky Github project:

git clone https://github.com/PrivateSky/privatesky
Enter into checkout folder and run the following command:
cd privatesky
npm run install
The Node version is checked and if is all good the installation process begins by downloading the required dependencies. Once the installation process has finished successfully, run the script:
For Linux:
 ./bin/virtualMq.sh [--port=8080] [--folder="../tmp"] 
For Windows:
 bin\virtualMq.bat [--port=8080] [--folder="../tmp"]

The default port that will be used is 8080 and the folder is ../tmp . Once the command is executed and the virtualMq server is running, run the following command:
For Linux:

 ./bin/csbwizard.sh [--port=8080] [--folder="../tmp"] 
For Windows:
 bin\csbwizard.bat [--port=8080] [--folder="../tmp"]

The default port that will be used is 8081 and the folder is ../tmp .

CSBWizard API

CSBWizard exposes the following API:

Begin CSB

Creates a new transaction and returns it's ID to be used in subsequent requests.

  • URL
/beginCSB
  • Method
POST
  • URL Params
None
  • Data Params
None
  • Success Response
    • Code:200
    • Content-Type: text/plain
    • Content: #transactionId

Add backup

Accepts an URL to a VirtualMQ server where it will send a backup of the CSB when calling build CSB endpoint.

  • URL
/addBackup/:transactionId
  • Method
POST
  • URL Params
Required:
transactionId=[alphanumeric]
  • Data Params
Required:
Content-Type: text/plain
Content: Base URL to VirtualMQ (ex: http://localhost:8080 if default settings were used)
  • Success Response
    • Code: 200 OK
    • Content: None

Attach file

Attaches a reference with specified name to the resulting CSB from current transaction.

  • URL
/attachFile/:transactionId/:fileAlias
  • Method
POST
  • URL Params
Required:
transactionId=[alphanumeric]
fileAlias=[alphanumeric]
  • Data Params
Required:
Content-Type: application/octet-stream
Content: data stream
  • Success Response
    • Code: 200 OK
    • Content: None
  • Error Response
    • Code: 409 CONFLICT
    • Reason: A file with the same #fileAlias already exists

Build CSB

Sends the created CSB to the provided backups and returns the SEED used to encrypt it. Also, the SEED of the created CSB is sent to a remote channel for future retrieval.

  • URL
/buildCSB/:transactionId/
  • Method
POST
  • URL Params
Required:
transactionId=[alphanumeric]
  • Data Params
Required:
URL=[alphanumeric]
Channel=[alphanumeric]
  • Success Response
    • Code: 200 OK
    • Content-Type: text/plain
    • Content: #SEED

Demo web application

In order to show how the CSBWizard API is used, a web application can be accessed at http://localhost:8081/web/index.html

Clone this wiki locally