![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
express-flood
Advanced tools
Package for managing API - filter requests for avoid spammers and robots
express-flood is a package for who want to build APIs. Often if we do many requests to a website we get the error 429, and this is a protection for avoid spammers, robots, and other bad stuff.
You can specify as many protected URLs as you want, it is very flexible and allow you to have high sicurity. It's based on IP address, and timestamps.
npm i express-flood
const express = require('express');
const expressFlood = require('express-flood')([
{ path: '/test', max: 3, timeout: 60000, deny: 'Cannot do that!' },
{ path: '/flood', max: 5, timeout: 10000, deny: 'Cannot do that (2)!' }
]);
app.use(...expressFlood);
const app = express();
app.listen(3000, _ => console.log('Server started'));
This sample will create a protection on path '/test', where a user can make up to 3 requests in 1 minutes; if someone try to go beyond, will se the message 'Cannot do that!'. An also another protection on path '/flood'
It is the path of url to protect, it could be also '/api/something/:test'
Max requests that a user can do within 'timeout' time
When the protection allow user to make a new cycle of requests (in milliseconds)
Accepted types of this parameter: 'string', 'object', 'function' If someone try to go beyond protection limits, he will se the message you passed if it a string or object, or if it is a function, it will be called with 2 arguments (request and response) for manging user request.
By default, it is set to true.
Let's say a user is reloading the page continuously If it is set to true: - The user can only make 'max' requests, after which the system will completely block the others until it stops making them for 'timeout' milliseconds If it is set to false: - The user can make 'max' requests and after 'timeout' milliseconds the server will be able to accept others, ignoring those that are blocked (NOT RECOMMENDED)
FAQs
Package for managing API - filter requests for avoid spammers and robots
The npm package express-flood receives a total of 0 weekly downloads. As such, express-flood popularity was classified as not popular.
We found that express-flood 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
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.