Skip to content
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

Allow U&P rate limiter's config to be overridden for specific routes #12375

Merged

Conversation

WalkingPizza
Copy link
Contributor

What does it do?

It overrides the default U&P rate limiter settings when a config is specified for the middleware at a specific route.

Why is it needed?

Currently, there is no way to change the rate limiting criteria for U&P routes on a per-route basis. You either keep the defaults or change those defaults for all routes, but you can't set specific requirements just for certain routes – eg. those that send emails.

How to test it?

Try overriding the rate limiter's config either through a direct extension of the U&P plugin or through the register function.

Copy link
Member

@derrickmehaffy derrickmehaffy left a comment

Choose a reason for hiding this comment

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

LGTM

@alexandrebodin alexandrebodin added pr: enhancement This PR adds or updates some part of the codebase or features source: plugin:users-permissions Source is plugin/users-permissions package labels Mar 8, 2022
@alexandrebodin alexandrebodin added this to the 4.1.3 milestone Mar 8, 2022
@codecov
Copy link

codecov bot commented Mar 8, 2022

Codecov Report

Merging #12375 (bf87b56) into master (7b4d0e0) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #12375   +/-   ##
=======================================
  Coverage   47.59%   47.59%           
=======================================
  Files         228      228           
  Lines        8527     8527           
  Branches     1904     1904           
=======================================
  Hits         4058     4058           
  Misses       3674     3674           
  Partials      795      795           
Flag Coverage Δ
front ?
unit 47.59% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7b4d0e0...bf87b56. Read the comment docs.

@derrickmehaffy derrickmehaffy merged commit 0ccf5f4 into strapi:master Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: enhancement This PR adds or updates some part of the codebase or features source: plugin:users-permissions Source is plugin/users-permissions package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants