Security News
New Proposed CISA Mandate Would Require Critical Infrastructure to Report Ransom Payments Within 24 Hours
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
accountdown-basic
Advanced tools
username/password authentication for accountdown using salted hashes
Weekly downloads
Readme
username/password authentication for accountdown using salted hashes
var accountdown = require('accountdown');
var level = require('level');
var db = level('/tmp/users.db');
var users = accountdown(db, {
login: { basic: require('accountdown-basic') }
});
var user = process.argv[2];
var pass = process.argv[3];
var bio = process.argv[4];
var opts = {
login: { basic: { username: user, password: pass } },
value: { bio: bio }
};
users.create(user, opts, function (err) {
if (err) console.error(err);
});
var accountdown = require('accountdown');
var level = require('level');
var db = level('/tmp/users.db');
var users = accountdown(db, {
login: { basic: require('accountdown-basic') }
});
var creds = {
username: process.argv[2],
password: process.argv[3]
};
users.verify('basic', creds, function (err, ok) {
if (err) console.error(err)
else console.log('verified:', ok)
});
With these two programs, we can create an account and then verify the user/pass:
$ node example/create.js substack beepboop 'oh hello'
$ node example/verify.js substack beepboop
verified: true
$ node example/verify.js substack bleep
verified: false
Modules should be written to be useful on their own where possible. You can use this module without accountdown too:
var level = require('level');
var db = level('/tmp/users.db', {
keyEncoding: require('bytewise'),
valueEncoding: 'json'
});
var basic = require('../');
var batch = require('level-create-batch');
var b = basic(opts, [ 'login', 'basic' ]);
var user = process.argv[2];
var pass = process.argv[3];
var creds = { username: user, password: pass };
batch(db, b.create(user, creds));
var basic = require('accountdown-basic')
Return a basic auth instance b
given a database handle db
and an array
prefix prefix
.
Optionally set an opts.key
to use a different key as the identity than
username
.
Create a new login for the account identified by id
with creds
, an object
with username
and password
properties.
Return an array of rows that can be fed into level-create-batch.
Verify creds
, a username with username
and password
properties.
cb(err, success, id)
fires with any errors or a boolean success
and the
account identifier id
.
With npm do:
npm install accountdown-basic
MIT
FAQs
username/password authentication for accountdown using salted hashes
The npm package accountdown-basic receives a total of 13 weekly downloads. As such, accountdown-basic popularity was classified as not popular.
We found that accountdown-basic demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
Security News
Redis is no longer OSS, breaking its explicit commitment to remain under the BSD 3-Clause License forever. This has angered contributors who are now working to fork the software.
Product
Socket AI now enables 'AI detected potential malware' alerts by default, ensuring users benefit from AI-powered state-of-the-art malware detection without needing to opt-in.