Skip to content

Add tokens to agents graphql endpoint

What does this MR do?

Adds a GraphQL endpoint to fetch a single cluster agent by name, which can include any associated agent tokens.

Documentation will be added/reviewed in bulk as part of #241493 (closed), as there are a handful of merge requests in progress in this area.

Query changes

Query with name added (no records in production yet, but uses unique index on project_id and name):

SELECT
  "cluster_agents".*
FROM
  "cluster_agents"
WHERE
  "cluster_agents"."project_id" = 278964
  AND "cluster_agents"."name" = 'example'
 Index Scan using index_cluster_agents_on_project_id_and_name on public.cluster_agents  (cost=0.15..3.17 rows=1 width=64) (actual time=0.047..0.047 rows=0 loops=1)  
   Index Cond: ((cluster_agents.project_id = 278964) AND (cluster_agents.name = 'example'::text))  
   Buffers: shared hit=4  

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • [-] 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

gitlab-org/cluster-integration/gitlab-agent#6 (closed)

Edited by Tiger Watson

Merge request reports

Loading