wst
WSTrust middleware
Last updated 6 years ago by runk .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install wst 
SYNC missed versions from official npm registry.

node-wst

Dumb easy WS-Trust expressjs/connect middleware

Installation

npm i wst

Usage

var wst = require('wst');
var opts = {
  ttl: 86400,
  secret: 's3cr3t' // long secret string
};
function authorize(credentials, cb) {
  if (credentials.username == 'bob' && credentials.password == 'secret')
    return cb(null, {userId: 1});
  cb(null, null);
}

// app = express();
app.post('/auth/token', wst.auth(opts, authorize));
app.post('/make/me/happy', wst.check(opts), function(req, res, next) {
  res.send('success');
});

Current Tags

  • 0.2.1                                ...           latest (6 years ago)

7 Versions

  • 0.2.1                                ...           6 years ago
  • 0.2.0                                ...           6 years ago
  • 0.1.3                                ...           6 years ago
  • 0.1.2                                ...           6 years ago
  • 0.1.1                                ...           6 years ago
  • 0.1.0                                ...           6 years ago
  • 0.0.1                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 2
Last Day 1
Last Week 1
Last Month 4
Dependencies (2)
Dev Dependencies (1)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |