
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
node-run-middleware
Advanced tools
NodeJS module to execute your Express endpoints (middlewares) from your code. This module will let you laucnch manually all your middleware. It is simulate a client calling to your rest API's. It is not using a network connections
This fork aims to support parallel calls of req.runMiddleware
that originate from the same original_request
.
Description from original fork: NodeJS module to execute your Express endpoints (middlewares) from your code. This module will let you laucnch manually all your middleware. It is simulate a client calling to your rest API's. It is not using a network connection (Your server do not even needs to listen to a port)
#NodeJS run-middleware
Many times, your server, and your client, needs to execute the same functions. For example here is an endpoint to get user details:
app.get('/get-user/:id',function(req,res){
mysql.query('select * from users where id=?',[req.params.id],function(err,rows){
res.send({user:rows[0]})
})
})
Now your want to get the user details from your code. What should you do?
app.runMiddleware('/get-user/20',function(code,body,headers){
console.log('User Details:',body)
})
npm i -S run-middleware
var express=require('express')
var app=express();
require('run-middleware')(app)
run-middleware
tag.You can passing query string, body, cookies, and change the method.
app.runMiddleware('/handler',{
method:'post',
query:{token:'tk-12345'},
body:{"action":"list","path":"/"}
},function(code,data){
console.log(code,data)
process.exit()
})
When you can runMiddleware from another middleware, you can autopass all the parameters of the current middleware, by using the express request
object.
app.get('/middleware1',function(req,res){
// We use res.runMiddleware instead of app.runMiddleware. All the cookies & other data (like socket.io session) will be pass to the second middle ware
res.runMidleware(...)
})
If the middleware you execute will redirect, you will be notified about it, by reading the code
and the headers.location
app.runMiddleware('/this-middleware-will-response-as-redirect',function(code,body,headers){
if(code==301 || code=302) {// Redirect HTTP codes
console.log('Redirect to:',headers.location)
}
})
See example.js file for more info
ISC License Copyright (c) 2016, Aminadav Glickshtein
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
FAQs
NodeJS module to execute your Express endpoints (middlewares) from your code. This module will let you laucnch manually all your middleware. It is simulate a client calling to your rest API's. It is not using a network connections
The npm package node-run-middleware receives a total of 7 weekly downloads. As such, node-run-middleware popularity was classified as not popular.
We found that node-run-middleware 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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.