cloggo / tangd

A full implementation of tang server running on node.js
MIT License
3 stars 7 forks source link

credit: Nathanial McCallum et Al.

npm

A full implementation of tang server running on node.js

Why develop a new tang server implementation?

REST Service APIs

Method Path Operation
GET /adv Fetch public keys
GET /adv/{kid} Fetch public keys using specified signing key
POST /rec/{kid} Perform recovery using specified exchange key
POST /keys/rotate Generate new keys (reserved for whitelisted ip addresses)

Build from source

lein cljsbuild prod once

Installation from npmjs.org

npm install tangd

Running

# command line switches:
#   --port, -p          server port number
#   --data, -d          database file path
#   --ip-whitelist, -l  whitelisted ip to access security sensitive API

node node_modules/tangd/index.js --data /var/db/tangd/key.sqlite3 --port 8080 --ip-whitelist "10.6.0.4 10.8.0.9"

# must also initiate a key rotation to create new keys

Docker container

docker run -p 80:8080 -e IP_WHITELIST="10.6.0.4 10.8.0.9" -v /secret/data:/var/db/tangd cloggo/tangd:latest

# must also initiate a key rotation to create new keys 

Keys rotation

curl -X POST http://localhost/keys/rotate -d "{}"