New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

plume

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

plume

Simple, extensible RPC server over HTTP

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

Plume - Remote Procedure Call (RPC) server

  • HTTP; JSON in, JSON out; POST to /
  • Deploy behind ~NGINX (SSL termination, reverse proxying)
  • Add your own RPCs
  • User management with token-based auth (passwords stored with bcrypt)
    • Issue 'signup' or 'login' RPC to acquire an ephemeral 'token'
    • Pass 'token' to subsequent RPCs
    • If any RPC fails with HTTP status code 401, acquire a new token via the 'login' RPC and retry the original RPC

Signup RPC

-> { "rpc": "signup",
     "args": { "username": string,
               "password": string } }

<- { "token": string }

Login RPC

-> { "rpc": "login",
     "args": { "username": string,
               "password": string } }

<- { "token": string }

Any other RPC

-> { "rpc": string,
     "token": string,
     "args": object }

<- object

Errors

<- { "error": string }

Environment

Runs anywhere Node.js runs

Installation

npm install plume

Usage

var plume = require('plume')

plume.addRPC('echo', function (args, user, response) {
  response.sendJSON({ result: args }, 200)
})

plume.addRPC('fail', function (args, user, response) {
  response.sendError('I am an error message', 400)
})

plume.start()

Advanced Usage

plume.start({
  port: 8080,
  hostname: '127.0.0.1',
  maxRequestBodySizeBytes: 10 * 1024 * 1024,
  minUsernameLength: 3,
  maxUsernameLength: 32,
  minPasswordLength: 3,
  maxPasswordLength: 128,
  tokenTimeoutMinutes: 15,
  usersPath: __dirname + '/data/users.json',
})

Author

Brian Hammond brian@fictorial.com

License

MIT

Keywords

plume

FAQs

Package last updated on 09 Apr 2014

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