
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
volos-quota-common
Advanced tools
This module adds support for "quotas" to any API.
A quota is a traffic-management construct that is often used in building APIs and presenting them to developers. It is common in the API world to offer a service that is available to each individual application for a limited number of requests per hour, day, or week.
For instance, the developers of an API may wish to identify each application that uses the API using an "API key" and offer different levels of service based on the application. For instance, some applications might be allowed to make only 100 API calls per hour, while others might have a much higher limit.
This module may be used to do that. Using it, you create a "quota," and each quota has the following attributes:
Once a quota has been created, you "apply" the quota, which involves setting some additional attributes:
This module does not do anything on its own -- it depends on an implementation which stores the quota in a particular place. Currently the options are:
var apiKey = // Some string that comes from the incoming API call
var qm = require('volos-quota-apigee');
var quota = qm.createQuota({ timeUnit: 'day', interval: 1 });
// Allow 100 requests per day for each application, based on API key
quota.apply({ key: apiKey, allow: 100 });
Apply the quota and invoke "callback" with a result. Options can have the following parameters:
The result of this call is delivered by calling "callback." If there was an error, then the first parameter will be an Error object. Otherwise, the first parameter will be "undefined" and the second will be an object that contains the following fields:
Applies quota and returns (403) error on exceeded.
Automatically sets the following headers on the response:
Options (optional) may contain:
Applies quota on a per-caller address basis and returns (403) error on exceeded.
Options (optional) may contain:
Returns middleware that may be used in a Connect server.
server.get('/',
quota.connectMiddleware().apply(),
...
Returns middleware that may be used in a Express server.
server.get('/',
quota.expressMiddleware().apply(),
...
Returns middleware that may be used in an Argo server.
server.get('/', function(handle) {
handle('request', function(env, next) {
oauth.argoMiddleware().apply(env, function() {
...
FAQs
Common library for Quota enforcement in the Volos system.
We found that volos-quota-common demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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 researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.