Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cansecurity

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cansecurity - npm Package Compare versions

Comparing version 0.6.2 to 0.6.3

2

lib/declarative.js

@@ -114,3 +114,3 @@ /*jslint node:true, nomen:true */

try {
isCondition = vm.runInNewContext(entry.condition,{req:req,user:user});
isCondition = vm.runInNewContext(entry.condition,{req:req,request:req,user:user,_:_});
} catch (e) {

@@ -117,0 +117,0 @@ isCondition = false;

{
"name": "cansecurity",
"description": "cansecurity is your all-in-one security library for user authentication, authorization and management in node expressjs apps",
"version": "0.6.2",
"version": "0.6.3",
"url": "http://github.com/deitch/cansecurity",

@@ -6,0 +6,0 @@ "author": "Avi Deitcher <avi@deitcher.net>",

@@ -618,5 +618,8 @@ # cansecurity

1. `req`: the actual express `req` object, normally found on each route whose signature is `function(req,res,next)`.
2. `user`: the user object if you used cansecurity authentication. This is the equivalent of calling `cansec.getUser(req)`.
1. `req`: the actual express `req` object, normally found on each route whose signature is `function(req,res,next)`.
2. `request`: an alias for `req`
3. `user`: the user object if you used cansecurity authentication. This is the equivalent of calling `cansec.getUser(req)`.
4. `_`: the underscore/lodash utility functions. cansecurity actually uses [lodash](http://lodash.com)
#### What It Returns

@@ -623,0 +626,0 @@ The authorizer has one of three possible results:

@@ -20,4 +20,8 @@ {

["GET","/secure/user/:user","deny","req.param('user') === '1'"]
["GET","/secure/user/:user","deny","req.param('user') === '1'"],
["GET","/secure/dash","deny","_.contains([1,2,3],1)"],
["GET","/secure/request","deny","request.url !== null"]
]
}

@@ -43,2 +43,12 @@ /*jslint node:true, nomen:true */

});
describe('dash in condition', function(){
it('should accept condition with dash', function(done){
r.get('/secure/dash').expect(200,done);
});
});
describe('request as alias to req', function(){
it('should accept condition with "request" in it', function(done){
r.get('/secure/request').expect(200,done);
});
});
describe('deny vs allow', function(){

@@ -45,0 +55,0 @@ it('should always deny denyAll', function(done){

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc