Add gPAT support for semantic code search REST API endpoint
Summary
- Adds
route_setting :authorization, permissions: :read_code, boundary_type: :projectto the semantic code search REST endpoint - Creates
config/authz/permissions/code/read.ymlpermission definition file - Creates
config/authz/permission_groups/assignable_permissions/repository/code/read.ymlassignable permission YAML - Removes
read_codefromdefinitions_todo.txtand removes the route fromauthorization_todo.txt - Regenerates gPAT allowed endpoints documentation
- Adds
it_behaves_like 'authorizing granular token permissions', :read_codespec coverage
Closes https://gitlab.com/gitlab-org/gitlab/-/work_items/595033
How to test
Unit tests:
bundle exec rspec ee/spec/requests/ee/api/search/semantic_code_search_spec.rbPermissions validation:
bundle exec rake gitlab:permissions:validate