Skip to content

Enable filtering agent tokens by status

Tiger Watson requested to merge agent-token-status-filter into master

What does this MR do and why?

Adds a status argument to the Agent tokens resolver, to allow retrieving only active (or revoked, if necessary) tokens.

Screenshots or screen recordings

GraphQL request:

{
  project(fullPath: "path/to/agent-config") {    
    clusterAgent(name:"my-agent") {
      name
      tokens(status: REVOKED) {
        nodes {
          name
          status
        }
      }
    }
  }
}

Response:

{
  "data": {
    "project": {
      "clusterAgent": {
        "name": "my-agent",
        "tokens": {
          "nodes": [
            {
              "name": "my-token",
              "status": "REVOKED"
            }
          ]
        }
      }
    }
  }
}

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Robert May

Merge request reports