
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.
A circuit-breaker implementation for node.js with exponential backoff.
Disyuntor is the Spanish word used for circuit-breaker.
The purpose of this pattern is to detect errors and prevent cascading failures across multiple systems.
Disyuntor wraps an async (errback) function and returns a new function with the same signature.
During normal behavior of the system the circuit remains in its closed
state. This means that every call to the wrapper is forwarded to the protected function.
Once the protected function returns more than maxFailures
, the breaker trips and every call made during the cooldown
interval will immdiately return an error preventing resource depletion. This is known as the open
state.
Once the system has settled it will allow one call to go to the protected function. If the call succeds the breaker will be reset to its closed
state otherwise it will continue open
. This state is known as half open
A call is considered to have failed if the callback is not called before the timeout
or if it is called with the first (error) parameter.
npm i disyuntor
const disyuntor = require('disyuntor');
const dnsSafeLookup = disyuntor(dns.lookup, {
//Timeout for the protected function.
timeout: '2s',
//The number of consecutive failures before switching to open mode
//and stop calling the underlying service.
maxFailures: 5,
//The minimum time the circuit remains open before doing another attempt.
cooldown: '15s',
//The maximum amount of time the circuit remains open before doing a new attempt.
maxCooldown: '60s',
//This is used in error messages.
name: 'dns.lookup',
//optionally log errors
monitor: (details) => logger.panic({ err: details.err, args: details.args }, 'Error on dns.lookup')
});
Timeouts can be expressed either by strings like '15s' or by milliseconds.
Defaults values are:
timeout
: 2smaxFailures
: 5cooldown
: 15smaxCooldown
: 3 * cooldownCopyright (c) 2015 Auth0, Inc. support@auth0.com (http://auth0.com)
FAQs
A circuit-breaker implementation with exponential backoff.
The npm package disyuntor receives a total of 298 weekly downloads. As such, disyuntor popularity was classified as not popular.
We found that disyuntor demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 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.