Corrective action: Improve rate limited endpoint shared RSpec examples to enforce testing with multiple scopes
!204751 (merged) caused an S1 incident because it didn't test rate limiting with multiple scopes. The existing rate limited endpoint shared RSpec examples only exercise a single scope, making it difficult to catch these types of problems. We should improve the examples to allow for adding a second scope that is used to more thoroughly verify the intended behavior.
Implementation plan
- Change the
rate limited endpointshared example to default touse_second_scope: true - Go through each use of
rate limited endpointshared examples that were not specifyinguse_second_scopeand default to opt-out ofuse_second_scope - Remove the now default
use_second_scope: truefrom tests that specify it - Ensure that a user-friendly message is output if the test context doesn't specify a
request_with_second_scopemethod - Go through existing tests and adapt them to test with a second scope (removing the need for
use_second_scope: false)
Edited by 🤖 GitLab Bot 🤖