node-red-contrib-securedhttp
Advanced tools
Comparing version 1.0.4 to 1.0.5
{ | ||
"name": "node-red-contrib-securedhttp", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Node-RED node to create secured http endpoint", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
@@ -39,5 +39,8 @@ node-red-contrib-securedhttp | ||
-- Secured field set to true to enable security. False to disable. | ||
-- Secured field is set to true to enable security. False to disable. | ||
-- User will need to have privilege to access this endpoint even the token is valid. | ||
-- User will need to have privilege to access this endpoint even if the | ||
token is valid if this field is set to non-empty string. Multiple | ||
privileges can be specified with comma delimiters but user will need to | ||
have one of thoese specified privilege to access this endpoint. | ||
@@ -44,0 +47,0 @@ |
@@ -189,2 +189,5 @@ /** | ||
// kchen - modification 7/5/2017 | ||
this.userDetails = {}; | ||
var node = this; | ||
@@ -201,7 +204,7 @@ | ||
if (node.method.match(/^(post|delete|put|options|patch)$/)) { | ||
node.send({_msgid:msgid,req:req,res:createResponseWrapper(node,res),payload:req.body}); | ||
node.send({_msgid:msgid,req:req,res:createResponseWrapper(node,res),payload:req.body,"userDetails":node.userDetails}); | ||
} else if (node.method == "get") { | ||
node.send({_msgid:msgid,req:req,res:createResponseWrapper(node,res),payload:req.query}); | ||
node.send({_msgid:msgid,req:req,res:createResponseWrapper(node,res),payload:req.query,"userDetails":node.userDetails}); | ||
} else { | ||
node.send({_msgid:msgid,req:req,res:createResponseWrapper(node,res)}); | ||
node.send({_msgid:msgid,req:req,res:createResponseWrapper(node,res),"userDetails":node.userDetails}); | ||
} | ||
@@ -273,2 +276,4 @@ }; | ||
} | ||
// kchen - modification 7/5/2017 | ||
node.userDetails.name = node.userDetails.email = decoded.userAuthentication.name; | ||
if (hasRight) | ||
@@ -275,0 +280,0 @@ next(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28815
380
50