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

ratelimit: do not default to ipstrategy too early #6713

Merged
merged 5 commits into from Apr 29, 2020

Conversation

mpl
Copy link
Collaborator

@mpl mpl commented Apr 21, 2020

What does this PR do?

This PR removes ipstrategy being systematically set as the default source
criterion, which was causing any other source criterion provided in the config
to be ignored.

We already take care of setting ipstrategy as the default in the rate limiter
constructor anyway.

Motivation

Fixes #6687

More

  • Added/updated tests
  • [ ] Added/updated documentation

Additional Notes

@mpl
Copy link
Collaborator Author

mpl commented Apr 21, 2020

adding no merge because current test does not actually prevent regression for now.

@mpl
Copy link
Collaborator Author

mpl commented Apr 21, 2020

adding no merge because current test does not actually prevent regression for now.

after consideration, I don't think the regression should be prevented in the unit tests of the ratelimiter package, since SetDefaults is applied out of this package.

However, I'm wondering if we should enforce that the fields of SourceCriterion are all mutually exclusive (they already actually are), and in which case we could add a test reflecting that property.

Copy link
Member

@ldez ldez left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@mmatur mmatur left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@juliens juliens left a comment

Choose a reason for hiding this comment

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

LGTM

@traefiker traefiker merged commit 4da63c9 into traefik:v2.2 Apr 29, 2020
@traefiker traefiker added this to Done in v2 via automation Apr 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
v2
Done
Development

Successfully merging this pull request may close these issues.

None yet

5 participants