An access control module to accompany township-auth.
npm i --save township-access
const townshipAccess = require('township-access')
const level = require('level')
const db = level('db')
const access = townshipAccess(db)
const key = 'pizza'
const scopes = ['site:read', 'site:edit']
access.create(key, scopes, function (err, account) {
access.verify(key, ['site:edit'], function (err, verified) {
console.log(verified)
})
})
- township-auth - manage authentication credentials
- township-token - create & decode JWT tokens with township auth/access data