Skip to content

API: Add endpoint to reset runner authentication token

What does this MR do?

This MR adds an API endpoint to reset runner authentication tokens.

Issue: #30942 (closed)

How to setup and validate locally (strongly suggested)

  1. Create a runner

  2. Reset the token:

    $ curl --header 'PRIVATE-TOKEN: xxxxx' -X POST 'https://gitlab.example.com/api/v4/runners/1/reset_authentication_token'
    { "token": "12345" }
  3. Verify the new token:

    $ curl --form 'token=12345' 'https://gitlab.example.com/api/v4/runners/verify'

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

This MR tests that the authentication token is reset (or not reset if the user doesn't have runner update permissions.)

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Kyle Edwards

Merge request reports