[Security] make secret required for DefaultLoginRateLimiter #52724
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This tickets results from the discussion here: #52469 (review) and @nicolas-grekas requested a PR for it.
The
secret
parameter has been added in #51434 with a default value of''
and a deprecation message that it is required / may not be empty. Which is fine and doesn't hurt backwards compatibility.The later ticket #52469 changes the deprecation into an exception, as it is undesirable that no secret is used (in any scenario). This leads to the unintended side effect that there is a BC breakage when a developer manually creates a
DefaultLoginRateLimiter
as it is now actually required to provide a (non empty) value due to the check and exception.Allowing the service / class to be used without providing the secret parameter, in a backwards compatible manner, but then still breaking the backwards compatibility by throwing due to the default value is confusing. So making the
secret
required makes more sense from a developer perspective as it is clear in that the parameter must be provided.