Update access for /runners/all API endpoint
What does this MR do and why?
- Changed endpoint
/runners/allaccess. - Previously, it was allowed only with
can_admin_all_resources?=>adminaccess - To resolve this issue, changed the auth check to
can_read_all_resources?=>AuditorAccess in EE. - Adapted the same in
spec/requests/api/ci/runners_spec.rb - Updated Openapi doc yaml.
References
Review access to /runners/all API endpoint (#464640 - closed)
How to set up and validate locally
- Ensure the GDK has an Ultimate license.
- Create a user (or change an existing user) with auditor access level.
- Impersonate that user, and create a Personal Access Token (http://gdk.test:3000/-/user_settings/personal_access_tokens) with
read_apiscope. - Run
curl --header "PRIVATE-TOKEN: $PAT_TOKEN" --url "http://gdk.test:3000/api/v4/runners/all" - In
master, you should see{"message":"403 Forbidden"}. In this branch, the request is successful and returns a list of runners.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Pedro Pombeiro