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

Change ratelimit mitigation_expression to counting_expression #808

Merged

Conversation

zakcutner
Copy link
Contributor

@zakcutner zakcutner commented Feb 15, 2022

Description

This reflects a change in the public API, summarised in the following
table:

counting expression mitigation expression
before expression ratelimit.mitigation_expression
after ratelimit.counting_expression expression

In both cases, setting ratelimit.counting_expression or
ratelimit.mitigation_expression to the empty string (or not setting it
at all) signifies that it should take the same value as expression.

Types of changes

What sort of change does your code introduce/modify?

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • This change is using publicly documented (api.cloudflare.com or developers.cloudflare.com) and stable APIs.

@cloudflare cloudflare deleted a comment from dramosnavarro2 Feb 16, 2022
@zakcutner zakcutner marked this pull request as ready for review February 17, 2022 12:39
@@ -255,10 +255,7 @@ type RulesetRuleRateLimit struct {
RequestsPerPeriod int `json:"requests_per_period,omitempty"`
Period int `json:"period,omitempty"`
MitigationTimeout int `json:"mitigation_timeout,omitempty"`

// Should always be sent as "" will trigger the service to use the Ruleset
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is an optional field so should not be sent unless it is used

This reflects a change in the public API, summarised in the following
table:

|        | counting expression             | mitigation expression             |
|--------|---------------------------------|-----------------------------------|
| before | `expression`                    | `ratelimit.mitigation_expression` |
| after  | `ratelimit.counting_expression` | `expression`                      |

In both cases, setting `ratelimit.counting_expression` or
`ratelimit.mitigation_expression` to the empty string (or not setting it
at all) signifies that it should take the same value as `expression`.
@jacobbednarz jacobbednarz merged commit c92a2be into cloudflare:master Feb 20, 2022
jacobbednarz added a commit to cloudflare/terraform-provider-cloudflare that referenced this pull request Feb 20, 2022
…ing_expression`

Internally, the `mitigation_expression` field has moved to
`counting_expression` to better match its use. This updates the schema
to reflect those changes and migrate state files to match.

Depends on cloudflare/cloudflare-go#808
jacobbednarz added a commit to cloudflare/terraform-provider-cloudflare that referenced this pull request Feb 20, 2022
…ing_expression`

Internally, the `mitigation_expression` field has moved to
`counting_expression` to better match its use. This updates the schema
to reflect those changes and migrate state files to match.

Depends on cloudflare/cloudflare-go#808
jacobbednarz added a commit to cloudflare/terraform-provider-cloudflare that referenced this pull request Feb 22, 2022
…ing_expression`

Internally, the `mitigation_expression` field has moved to
`counting_expression` to better match its use. This updates the schema
to reflect those changes and migrate state files to match.

Depends on cloudflare/cloudflare-go#808
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants