Skip to content

[RateLimiter] Adding config reference for policy and lock_factory #14746

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[RateLimiter] Adding config reference for policy and lock_factory
  • Loading branch information
Nyholm authored and javiereguiluz committed Dec 28, 2020
commit c39447ab9ddd33dcd0a68b43eb65f70d23188f17
2 changes: 2 additions & 0 deletions rate_limiter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Symfony uses these rate limiters in built-in features like "login throttling",
which limits how many failed login attempts a user can make in a given period of
time, but you can use them for your own features too.

.. _rate-limiter-policies:

Rate Limiting Policies
----------------------

Expand Down
36 changes: 36 additions & 0 deletions reference/configuration/framework.rst
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,13 @@ Configuration

* :ref:`enabled <reference-property-info-enabled>`

* `rate_limiter`_:

* :ref:`name <reference-rate-limiter-name>`

* `lock_factory`_
* `policy`_

* `request`_:

* `formats`_
Expand Down Expand Up @@ -1220,6 +1227,35 @@ dsn

The DSN where to store the profiling information.

rate_limiter
~~~~~~~~~~~~

.. _reference-rate-limiter-name:

name
....

**type**: ``prototype``

Name of the rate limiter you want to create.

lock_factory
""""""""""""

**type**: ``string`` **default:** ``lock.factory``

The service that is used to create a lock. The service has to implement the
:class:`Symfony\\Component\\Lock\\LockFactoryInterface`.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In 5.2 it should be LockFactory

But (hopefully) this is correct in 5.3: symfony/symfony#39634

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We did this change while merging. Cheers!


policy
""""""

**type**: ``string`` **required**

The name of the rate limiting algorithm to use. Example names are ``fixed_window``,
``sliding_window`` and ``no_limit``. See :ref:`Rate Limiter Policies <rate-limiter-policies>`)
for more information.

request
~~~~~~~

Expand Down