Add "manage runner" scope
What does this MR do and why?
This MR adds a manage_runner
token scope, to enable the following runner management endpoints to be accessed with a single token. Currently, we have either the create_runner
scope (which is too limited for something like the Terraform provider, which can create/update/delete a resource), or the api
scope, which is too broad.
The expected/tested behaviors are as follows:
endpoint |
|
|
|
|
---|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The following endpoints are not allowed by the new scope:
endpoint |
|
|
|
|
---|---|---|---|---|
|
|
|
|
|
|
|
|
|
Closes #460721 (closed)
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
-
Set up a new PAT in http://gdk.test:3000/-/user_settings/personal_access_tokens with the new
manage_runner
scope, and the desired user role. -
Access one of the REST endpoints in the first table above, for example:
curl -X DELETE --url 'http://gdk.test:3000/api/v4/projects/3/runners/9682' --header private-token:\ $GL_PROJECT_MANAGE_RUNNER_MAINTAINER_TOKEN
You should receive the expected response from the table, and according to the documentation.