
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
nodecloud-brakes
Advanced tools
import BrakeClient from 'nodecloud-brakes';
import rp from 'request-promise';
const SERVICE_NAME = 'user-service';
const brake = new BrakeClient(SERVICE_NAME);
//set health check.
brake.healthCheck(() => {
return rp({
method: 'get',
url: `/health`,
headers: {
'Content-Type': 'application/json'
}
});
});
brake.on('circuitOpen', () => {
logger.warn(`The service: ${SERVICE_NAME}'s circuit is opened.`);
});
brake.on('circuitClosed', () => {
logger.info(`The service: ${SERVICE_NAME}'s circuit is closed.`);
});
brake.fallback(err => {
throw new Error('Cannot invoke downstream service. please try again soon.', err);
});
export function getUser(userId) {
const request = {
method: 'get',
url: `/v1/users/:userId`,
params: {userId: userId},
headers: {
'Content-Type': 'application/json'
}
};
return brake.circuit({send: rp}).send(request);
}
You can use brake client to invoke resource api. The example is
import * as userClient from './UserClient';
userClient.getUser(1).then(user => {
console.log(user);
})
The service name.
The options param is the same as brakes. We extend it, and support request handlers
Set a callback, when the circuit is open, the callback will be used for checking the service's health status, if the status is ok, the circuit will close.
See brakes for detail.
Return the circuit's status.
FAQs
An client with circuit.
The npm package nodecloud-brakes receives a total of 10 weekly downloads. As such, nodecloud-brakes popularity was classified as not popular.
We found that nodecloud-brakes 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.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.