Loading
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
- Issue: #627823 (closed)
- Retrieve runner's details API: https://docs.gitlab.com/api/runners/#retrieve-runners-details
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
- Create a runner with a token expiry via the Users API.
- Note the runner
idfrom the response. - Retrieve the runner's details:
GET /api/v4/runners/:id - Confirm
token_expires_atis 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