Gitlab::Search::AbuseDetection refactor ALLOWED_SCOPES
Background
Follow up from !155516 (merged)
Gitlab::Search::AbuseDetection has an ALLOWED_SCOPES constant used to determine if a scope is allowed. This is a duplicate list that makes it harder to add new scopes.
Proposal
The abusive scopes should use the existing locations for defining scopes to determine if they are allowed:
app/services/search/global_service.rb
app/services/search/project_service.rb
ee/app/services/ee/search/global_service.rb
ee/app/services/ee/search/group_service.rb
-
Create class methods to expose the
allowed_scopesto concatenate them all for abuse detection. -
Update Advanced search developer documentation to remove abuse detection update from instructions on how to add new scopes