A secure microservices node framework: Caesar.js!

A secure microservices node framework is around.

Current Version:

V. 0.7.1

Main Features of Caesar.js secure microservices node framework:

The main features explained:

  • Pattern-matching. Each service is defined by a pattern rather than an url. The client will work out the actual url of the specific service to call as long as the pattern supplied matches one defined at server level. As a result there is no url to remember or configure.
  • Mutual data encryption. Data is encrypted between client and server.
  • Mutual certificate authentication. Caesar.js implements out of the box https secure transport connection between server and client.
  • Extensible. Caesar.js features a new plugin API, so you can add extra features to the server by adding new middleware and routes.
  • Based on community widely used software: express & request. The server & client components of Caesar.js are based on commonly used npm packages like express and request.
  • Tiny. Caesar.js has a tiny API and only focuses on secure message transport/communication between server and client.

Please check out the documentation section.

Caesar.js is now available as a npm package!

Install it:

npm install caesarjs --save

Caesar.js a secure microservices framework for node

Try it:

'use strict';
const server = require('caesarjs').server;
const client = require('caesarjs').client;
const encryptorKey = '33a24560-a43b-44cc-b2bc-9cc0de14a093';
new server(3000, {encryptorKey}).add(
{role: 'calculator', operation: 'sum'},
(req, res) => {
let n1 = req.data.n1;
let n2 = req.data.n2;
let sum = (n1 + n2);
res.caesarJson({sum});
})
.add(
{role: 'calculator', operation: 'subtraction'},
(req, res) => {
let n1 = req.data.n1;
let n2 = req.data.n2;
let subtraction = (n1 - n2);
res.caesarJson({subtraction});
})
.listen();
let cclient = null;
new client('localhost', 3000, {encryptorKey})
.init()
.then( (client) => {
cclient = client;
return cclient.call({role: 'calculator', operation: 'sum'}, {n1: 10, n2: 10});
}).then( (resp) => {
console.log('SUM', resp);
return cclient.call({role: 'calculator', operation: 'subtraction'}, {n1: 100, n2: 10});
}).then( (resp) => {
console.log('SUBTRACTION', resp);
}).catch( (err) => console.log(err) );
setInterval(function () {
cclient
.call({role: 'calculator', operation: 'division'}, {n1: Math.random() * (1000 - 100) + 100, n2: 10});
}, 1000);