PHPackages                             avtonom/limit-number-calls-bundle - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. avtonom/limit-number-calls-bundle

ActiveSymfony-bundle[Authentication &amp; Authorization](/categories/authentication)

avtonom/limit-number-calls-bundle
=================================

Defender for Symfony 2, of the large number of requests. It protects against multiple processing one value. Guard, aims to protect against brute force and dictionary attacks.

v1.1.2(7y ago)3142MITPHPPHP &gt;=5.3.2

Since Nov 23Pushed 7y ago1 watchersCompare

[ Source](https://github.com/Avtonom/limit-number-calls-bundle)[ Packagist](https://packagist.org/packages/avtonom/limit-number-calls-bundle)[ Docs](https://github.com/Avtonom/limit-number-calls-bundle)[ RSS](/packages/avtonom-limit-number-calls-bundle/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (3)Versions (4)Used By (0)

Defender for Symfony 2, of the large number of requests
=======================================================

[](#defender-for-symfony-2-of-the-large-number-of-requests)

Defender for Symfony 2, of the large number of requests. It protects against multiple processing one value. Guard, aims to protect against brute force and dictionary attacks.

Page bundle:

Features
--------

[](#features)

- Multiple rules for blocking
- Combine rules into groups
- Has a Symfony Security Voter
- Ready set console commands (CLI) to view, add, and delete statistics and locks
- Easy to expand
- Uses a fast pRedis
- Supports up to a microsecond

Maybe in the future:

- Do the work with the console commands more convenient
- Expose the core of the application in a simple version which does not depend on the Symfony
- minor edits. I will be grateful for the help

#### List console commands (CLI)

[](#list-console-commands-cli)

- avtonom:limit-calls:add - add the execution of the request in the statistics (does not establish a lock. But check for blocking)
- avtonom:limit-calls:block - add value to the list of locks on value
- avtonom:limit-calls:clear - remove statistics for the values for
- avtonom:limit-calls:rules - Open the list current words for checking locks
- avtonom:limit-calls:status - View a list of blocked values and statistics list

**for details, add "-h" after the command name**

#### Parameters of the rule settings

[](#parameters-of-the-rule-settings)

- enabled: true - \[OPTIONAL\] rule off
- maximum\_number: 1 - maximum number of requests that value
- time\_period: 60000000 # microsecond ( 1s = 1000 000 microsecond ) - for a period to allow to carry out a specified number of actions
- blocking\_duration: 600 # second ( 1m = 60s ) - \[OPTIONAL\] blocking duration
- group: sms\_group or \[sms\_group, other\_group\] - \[OPTIONAL\] association in a list or group with several groups
- subject\_class: Avtonom\*\*\*\*\*\\ObjectInterface - Retreiving class or interface to run Symfony Security Voter
- subject\_method: getParameter or \[getParameter, phone\] or \[ \[getParameter, phone\], \[getParameter, ip\] \]- \[OPTIONAL\] The method or the method for obtaining attribute values of object

#### To Install

[](#to-install)

Run the following in your project root, assuming you have composer set up for your project

```
composer.phar require avtonom/limit-number-calls-bundle ~1.1
```

Switching `~1.1` for the most recent tag.

Add the bundle to app/AppKernel.php

```
$bundles(
    ...
        new Snc\RedisBundle\SncRedisBundle(),
        new Avtonom\LimitNumberCallsBundle\AvtonomLimitNumberCallsBundle(),
    ...
);
```

Configuration options (config.yaml):

```
snc_redis:
    clients:
        default:
            type: predis
            logging: true # OPTIONAL
            alias: snc_redis_lnc
            dsn: redis://localhost
            options: # OPTIONAL
                throw_errors: true # OPTIONAL

avtonom_limit_number_calls:
    voter_default: false # OPTIONAL. default true - include %avtonom_limit_number_calls.voter.class%
    rules: "%avtonom_limit_number_calls.rules%" # REQUIRED
```

Configuration options (parameters.yaml):

```
parameters:
    avtonom_limit_number_calls.rules:
        sms_1m_10_rule:
            time_period: 60000000 # microsecond ( 1m = 60s * 1000 000 microsecond )
            maximum_number: 10
            blocking_duration: 600 # second ( 1m = 60s )
            group: sms_group
            subject_class: *****\ObjectInterface
            subject_method: [getParameter, phone]
        sms_1m_rule:
            time_period: 60000000 # microsecond ( 1m = 60s * 1000 000 microsecond )
            maximum_number: 1
            blocking_duration: 600 # second ( 1m = 60s )
            group: sms_group
            subject_class: *****\ObjectInterface
            subject_method:
                - [getParameter, phone]
                - [getParameter, text]
        sms_30m_30_rule:
            time_period: 1800000000 # microsecond ( 30m = 1m * 30 = 30 * 60s * 1000 000 microsecond )
            maximum_number: 30
            blocking_duration: 86400 # second ( 1d = 86400 second = 25h * 60m * 60s )
            group: [sms_group, other]
            subject_class: *****\ObjectInterface
            subject_method: [getParameter, phone]
        sms_30m_rule:
            time_period: 1800000000 # microsecond ( 30m = 1m * 30 = 30 * 60s * 1000 000 microsecond )
            maximum_number: 3
            blocking_duration: 86400 # second ( 1d = 86400 second = 25h * 60m * 60s )
            group: [sms_group, other]
            subject_class: *****\ObjectInterface
            subject_method:
                - [getParameter, phone]
                - [getParameter, text]

        test_minimum:
            time_period: 1800
            maximum_number: 3
            subject_class: *****\Object
        test_minimum_disabled:
            enabled: true
            time_period: 1800
            maximum_number: 3
            subject_class: *****\Object

```

#### Use

[](#use)

Use the name of the rule or group of rules for checking the limit is exceeded:

```
# for Symfony > 3.0
if (!$this->get('security.authorization_checker')->isGranted('sms_group', $Object)) {
    throw new \Exception('Too Many Requests', 429);
}
# for Symfony < 3.0
if (!$this->get('security.context')->isGranted('sms_1m_rule', $Object)) {
    throw new \Exception('Too Many Requests', 429);
}
```

### Need Help?

[](#need-help)

1. Create an issue if you've found a bug,

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity60

Established project with proven stability

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~405 days

Total

3

Last Release

2647d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/851a2d4f8d02604c04bd2c4331a901e4fc92ed7ec1371cbceafb48c2495efc8c?d=identicon)[avtonomspb](/maintainers/avtonomspb)

---

Tags

bundlesecurityAuthenticationSymfony2redisbrute forcebruteforceattackdictionary attackccdncodeconsortiumdictionaryattack

### Embed Badge

![Health badge](/badges/avtonom-limit-number-calls-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/avtonom-limit-number-calls-bundle/health.svg)](https://phpackages.com/packages/avtonom-limit-number-calls-bundle)
```

###  Alternatives

[scheb/2fa

Two-factor authentication for Symfony applications (please use scheb/2fa-bundle to install)

578630.7k1](/packages/scheb-2fa)[gfreeau/get-jwt-bundle

This Symfony bundle provides a security listener to return a JWT

86591.6k3](/packages/gfreeau-get-jwt-bundle)[codeconsortium/ccdn-user-security-bundle

CCDN User Security Bundle

60100.7k](/packages/codeconsortium-ccdn-user-security-bundle)[jmikola/auto-login-bundle

Authenticate users in your Symfony app via a single query parameter (e.g. email and newsletter links).

84323.6k](/packages/jmikola-auto-login-bundle)[kayue/kayue-wordpress-bundle

Support for authenticating WordPress users in Symfony2.

10125.9k](/packages/kayue-kayue-wordpress-bundle)[kleegroup/franceconnect-bundle

Symfony 4, 5 &amp; 6 OpenID security extension FranceConnect

136.2k](/packages/kleegroup-franceconnect-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
