Expose token_expires_at in runner details API

What does this MR do and why?

Expose the token_expires_at field in the GET /runners/:id (retrieve runner details) API response.

The field was already stored on the ci_runners table and returned by:

  • POST /user/runners (create runner)
  • POST /runners/:id/reset_authentication_token (reset token)

However, it was missing from GET /runners/:id, making it impossible for API consumers to inspect the token expiry of an existing runner without resetting the token.

The fix adds a single expose call to API::Entities::Ci::RunnerDetails, which is the entity used by the details endpoint.

Closes #627823 (closed)

References

Screenshots or screen recordings

Not applicable - API-only change.

Before After
GET /runners/:id response does not include token_expires_at GET /runners/:id response includes token_expires_at (null when not set)

How to set up and validate locally

  1. Create a runner with a token expiry via the Users API.
  2. Note the runner id from the response.
  3. Retrieve the runner's details: GET /api/v4/runners/:id
  4. Confirm token_expires_at is present in the response.

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 Duo Developer

Merge request reports

Loading
Loading