PHPackages                             jalismrs/gentle-force - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. jalismrs/gentle-force

AbandonedArchivedLibrary[Security](/categories/security)

jalismrs/gentle-force
=====================

Library for limiting both brute-force attempts and ordinary requests, using leaky/token bucket algorithm, based on Redis

0.4.0(5y ago)0123MITPHPPHP ^5.5 | ^7.0 | ^8.0

Since May 10Pushed 5y agoCompare

[ Source](https://github.com/jalismrs/gentle-force)[ Packagist](https://packagist.org/packages/jalismrs/gentle-force)[ RSS](/packages/jalismrs-gentle-force/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (6)Versions (7)Used By (0)

Gentle-force: brute-force, error and request rate limiting
==========================================================

[](#gentle-force-brute-force-error-and-request-rate-limiting)

This is a library for rate-limiting both brute-force attempts (like invalid credentials) and ordinary requests.

Features
--------

[](#features)

- can be used to limit brute-force attempts;
- can be used for request rate limiting;
- uses leaky / token bucket algorithm. This means that user does not have to wait for next hour or day - additional attempts are possible as time goes by. This also means that requests does not come in big batches when every hour starts;
- handles race-conditions. This is important for brute-force limiting. For example, if 1000 requests are issued at the same time to check same user's password, only configured number of attempts will be possible;
- can have several limits configured for single use-case (for example maximum of 100 requests per minute and 200 per hour);
- does not make assumptions about where and what it's used for - it can be used with user identifiers, API tokens, IP addresses or any other data to group usages.

Installation
------------

[](#installation)

```
composer require maba/gentle-force

```

Usage
-----

[](#usage)

```
