Security News
UK Officials Consider Banning Ransomware Payments from Public Entities
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
restify-basic-acl
Advanced tools
Utilize basic role-based HTTP method ACL as a Restify middleware.
Enable basic role-based ACL on an HTTP-method basis. Great for small applications that manage one or two resources, such as micro-services.
After installing restify-basic-acl
with npm i --save restify-basic-acl
,
add it as a Restify plugin:
let restify = require('restify');
let basicAcl = require('restify-basic-acl');
let roles = {
user: [
'get',
],
admin: [
'get',
'post',
'put',
'delete',
],
};
let server = restify.createServer();
server
.use(basicAcl.basicAclPlugin({
// the header that the authenticated user's info is passed (JSON is auto-decoded)
// it is then stored in req.user in any future middleware
userHeader: 'X-User',
// the header that the authenticated user's roles are passed (comma-separated)
// they are then stored in req.roles in any future middleware
rolesHeader: 'X-User-Roles',
// pass in your permission data here, that one of the user's roles should match
roles: roles,
// optionally specify exact routes that should bypass ACL entirely
unprotectedRoutes: [
'/health',
],
}, restify))
.listen(3000);
FAQs
Utilize basic role-based HTTP method ACL as a Restify middleware.
The npm package restify-basic-acl receives a total of 0 weekly downloads. As such, restify-basic-acl popularity was classified as not popular.
We found that restify-basic-acl 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
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.