jasstor
Simple file storage for credentials (Node.js module).
Features
- Stores credentials (user, hashed password) and role name into JSON file
- Handles verification of given username and password
- Reads role for given user
- Passwords are hashed with bcrypt
Installation
npm install jasstor
Getting Started
var Jasstor = require('jasstor');
var jasstor = new Jasstor('credentials.txt');
jasstor.saveCredentials('user', 'password', 'role', function(err){
if (err) {
}
});
jasstor.verify('user', 'password', function(err, role){
if (role){
} else {
}
});
jasstor.getRole('user', function (err, role) {
if (role){
} else {
}
});
Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Gulp.
Build
npm install
npm test
License
Copyright (c) 2014 Lubos Krnac. Licensed under the MIT license.