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.
var api = new APISDK([
// An API definition list here
'POST /articles',
'GET /articles/:id',
'PUT /articles/:id',
'DELETE /articles/:id'
], {
'host': '/api',
// 'promise' and 'http' MUST be provided
'promise': Promise,
'http': function(params) { console.log(params); }
});
var id = 123;
// { "method": "get", "url": "/api/articles/123", "data": { "token": 789 } }
api.articles(id).get({ token: 789 });
// Dynamic parameter is supported
var inc = 0;
var nextArticle = api.articles(function() { return inc++; });
// { method: "GET", url: "/api/articles/0", data: undefined }
nextArticle.get();
// { method: "GET", url: "/api/articles/1", data: undefined }
nextArticle.get();
// Asynchronous parameter is supportd
var asyncParam = new Promise(function(resolve){ setTimeout(resolve, 1000, 123); });
// The request will be launched after the promise resolved
api.articles(asyncParam).get();
/**
* GET /users/:user_id/
* GET /users/:user_id/orders
* POST /users/:user_id/orders
* GET /users/:user_id/orders/:order_id
* POST /users/:user_id/orders/:order_id/payment
* POST /users/:user_id/orders/:order_id/rating
* POST /users/:user_id/orders/:order_id/cancel
* POST /users/:user_id/orders/:order_id/refunding
**/
var currentUserId = 123;
// Create a 'user' object for current user
var user = api.users(currentUserId);
// Get current user profile
user.get();
// Create an 'order' object
var order = user.orders(123);
// Get order information
order.get();
// Post a payment request for this order
order.payment.post();
// Post a rating for this order
order.rating.post();
// Post a order canceling request for this order
order.cancel.post();
// Post refunding request for this order
order.refunding.post();
bower install apisdk
<script src="/bower_components/apisdk/apisdk.js"></script>
FAQs
APISDK with ES6Module
We found that apisdk 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
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.