Add Rails endpoint to get agent info for agentw
MR: Add internal API endpoint for agentw info (!203349 - merged) • Chad Woolley • 18.4
Description
Context: gitlab-org/cluster-integration/gitlab-agent!2590 (comment 2569242045)
Each type of agent has a unique type of token. For example - agentk has a Clusters::AgentToken. New agents bring introduced will have similar unique types of token. For example - agentw has a RemoteDevelopment::WorkspaceToken.
When a GitLab Agent(e.g. agentk or agentw) starts, it authenticates itself and fetches its information using its token. This information provided in the response will vary depending on the type of the token.
We want to introduce a endpoint in Rails which can be called from GitLab Agent codebase to fetch its agent_info .
For agentw, the response will be
{
workspace_id: ...,
}
Acceptance criteria
-
A new internal endpoint at internal/agents/agentw/agent_infowhich returns the data as described above. -
This endpoint will be protected by the workspace_token that will be sent by the agentw. -
Add unit tests and request spec.
Implementation plan
- Add endpoint as described above
Edited by Vishal Tak