Make Rack::Attack::Request more reslient to upstream changes
The following discussion from !79738 (merged) should be addressed:
-
@toupeira started a discussion: (+1 comment)
thought (non-blocking): BTW this module is included in
Rack::Attackat https://gitlab.com/gitlab-org/gitlab/blob/e77b3686ccd7af6951f0ef690bf2f0f053dee483/lib/gitlab/rack_attack.rb#L12, so we need to be careful not to override any existing Rack methods. It doesn't look like there's amatches?method though, so this should be fine.🤞 Maybe we can refactor this in the future so all the methods are available through its own object, and we only inject a getter (something like
Rack::Attack#gitlab_request_details, but shorter).
The suggestion here is to ensure that we avoid collisions with method names in the upstream Rack::Attack::Request class which we do not control.