
Research
/Security News
10 npm Typosquatted Packages Deploy Multi-Stage Credential Harvester
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.
sinon-har-server
Advanced tools
Auto mocks your server from a recorded .har file. Don't let your mocks lie to you!
Auto mocks your server from a recorded .har file. Don't let your mocks lie to you!
This module works in Node.js as well as in the browser with either AMD or with a <script> tag which defines sinonHarServer as a global.
Usage:
var server;
beforeEach(function () {
return fetch('api-traffic.har').then(function (response) {
return response.json();
}).then(function (harFile) {
server = sinon.fakeServer.create();
server.autoRespond = true;
server.autoRespondAfter = 1;
return sinonHarServer.load(server, harFile);
});
});
afterEach(function () {
server.restore();
});
This is especially useful for capturing all test traffic from your back-end test suite, for doing auto mocking in your front-end test suite. See this project for an example: https://github.com/larsthorup/http-auto-mock-demo
Blog post about this technique: http://www.zealake.com/2015/01/05/unit-test-your-service-integration-layer/
The .har file can be conveniently produced by https://github.com/larsthorup/node-request-har-capture
FAQs
Auto mocks your server from a recorded .har file. Don't let your mocks lie to you!
We found that sinon-har-server 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 researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.