Runner details API does not return token_expires_at field
Summary
The Create a runner linked to a user API accepts and stores a token_expires_at parameter when creating a runner authentication token. However, the Retrieve runner's details API (GET /api/v4/runners/:id) does not include token_expires_at in its response, making it impossible for API consumers to inspect the token expiry of an existing runner.
Steps to reproduce
- Create a runner with a token expiry via the Users API:
POST /api/v4/user/runners { "runner_type": "project_type", "project_id": <project_id>, "token_expires_at": "2025-01-01T00:00:00Z" } - Note the
token_expires_atvalue in the response. - Retrieve the runner's details:
GET /api/v4/runners/:id - Observe that
token_expires_atis absent from the response.
Current behavior
GET /api/v4/runners/:id does not include token_expires_at in its response payload, even when the runner was created with a token expiry date.
Expected behavior
GET /api/v4/runners/:id should include token_expires_at in its response payload, consistent with the field being accepted on creation and already surfaced by the reset authentication token endpoint (POST /api/v4/runners/:id/reset_authentication_token).
Relevant links
- Create a runner linked to a user (accepts
token_expires_at): https://docs.gitlab.com/api/users/#create-a-runner-linked-to-a-user - Retrieve runner's details (missing
token_expires_at): https://docs.gitlab.com/api/runners/#retrieve-runners-details
Environment
- Deployment type: GitLab.com and Self-Managed
- Affects: REST API
Edited by 🤖 GitLab Bot 🤖