Skip to content

GitLab Next

    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Menu
    Projects Groups Snippets
  • Sign up now
  • Login
  • Sign in / Register
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 42,935
    • Issues 42,935
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,374
    • Merge requests 1,374
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

GitLab 15.0 is launching on May 22! This version brings many exciting improvements, but also removes deprecated features and introduces breaking changes that may impact your workflow. To see what is being deprecated and removed, please visit Breaking changes in 15.0 and Deprecations.

  • GitLab.org
  • GitLabGitLab
  • Issues
  • #324269
Closed
Open
Created Mar 12, 2021 by Mikhail Mazurskiy@ash2k🔴Developer

API to get allowed agents by CI_JOB_TOKEN

New api endpoint: /api/v4/job/allowed_agents

returns:

{
  "allowed_agents": [
    {
        "id": 5,  // agent id
        "config_project": {
          "id": 3,
        }
    },
    {
        "id": 3,
        "config_project": {
          "id": 3,
        }
    },
  ],
  "job": {
    "id": 9 // job id
  },
  "project": {
    "id": 123213 // project id
  },
  "pipeline": {
    "id": 2323 // pipeline id
  },
  "user": {
    "id": 1,
    "username": "root"
  }
}

Specifications from the epic:

  • allowed_agents will only include agents for the JOB_TOKEN project. Adding external agents requires additional permissions, which will be handled in follow-up issues.
  • Endpoint auth: The user running the CI job should have Developer rights on the project configuring the agent used.
  • This feature can be disabled -- I think this will be handled in the agentk config file so the API does not need to worry about this setting.
Edited Apr 01, 2021 by Mikhail Mazurskiy
Assignee
Assign to
Time tracking