Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
flatiron-cli-users
Advanced tools
Encapsulated commands for managing users in flatiron CLI apps
At its core flatiron-cli-users is a broadway-compatible plugin which can be used by any flatiron application:
var flatiron = require('flatiron'),
app = flatiron.app;
//
// Configure the Application to be a CLI app with
// a JSON configuration file `test-config.json`
//
app.name = 'app.js';
app.config.file({ file: 'test-config.json' });
app.use(flatiron.plugins.cli, {
usage: 'A simple CLI app using flatiron-cli-users'
});
//
// Expose CLI commands using `flatiron-cli-users`
//
app.use(require('flatiron-cli-users'));
if (!module.parent) {
//
// Start the application
//
app.start();
}
If you run the above script:
$ node app.js users create
The output will be:
help: To signup, first you will need to provide a username
prompt: username: foobar
help: Next, we will require your email address
prompt: email: email@test.com
help: Finally, we will need a password for this account
prompt: password:
prompt: confirm password:
info: You account is now being created
info: Account creation successful!
And the contents of test-config.json
will have the specified user information.
This flatiron
plugin expects an API endpoint to be present on the application through app.users
. You may implement this API endpoint however you wish. We would suggest using resourceful and director, but you are free to use express or other node.js frameworks.
app.users.auth(function (err, result))
Responds with a valid indicating if the current user is authenticated.
app.users.availabile(username, function (err, result))
Responds with a valid indicating if the desired username is available.
app.users.create(user, function (err, result))
Creates a user with the specified properties.
app.users.update(username, props, function (err, result))
Updates the user with username
with specified props
.
app.users.forgot(username, props, function (err, result))
Attempts to reset the password for the username
with the specified props
$ node examples/app.js help users
help: `app.js users *` commands allow you to work with new
help: or existing user accounts.
help:
help: app.js users available <username>
help: app.js users changepassword
help: app.js users confirm <username> <inviteCode>
help: app.js users create
help: app.js users forgot <username> <shake>
help: app.js users login
help: app.js users logout
help: app.js users whoami
help:
help: You will be prompted for additional user information
help: as required.
{
//
// Set of functions which will execute after named commands: create, login, logout, etc.
//
after: { login: function () { ... } },
//
// Set of functions which will execute before named commands: create, login, logout, etc.
//
before: { login: function () { ... } }
}
$ curl http://npmjs.org/install.sh | sh
$ [sudo] npm install flatiron-cli-users
Tests are written in vows and give complete coverage of all APIs and storage engines.
$ npm test
FAQs
Encapsulated commands for managing users in flatiron CLI apps
The npm package flatiron-cli-users receives a total of 7 weekly downloads. As such, flatiron-cli-users popularity was classified as not popular.
We found that flatiron-cli-users demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.