Skip to content

Add environment tier to allowed agents API response

What does this MR do and why?

Adds deployment tier to the list of fields returned by the /allowed_agents API.

This will allow agent operators to specify permissions for dynamic environments, providing the environments have the same deployment tier.

Screenshots or screen recordings

Before:

└─[$]➜ curl --header "Authorization: Bearer <job token>" http://127.0.0.1:3000/api/v4/job/allowed_agents
{"allowed_agents":[],"job":{"id":21},"pipeline":{"id":20},"project":{"id":17,"groups":[{"id":76},{"id":75}]},"user":{"id":1,"username":"root","roles_in_project":["guest","reporter","developer","maintainer","owner"]},"environment":{"slug":"production"}}

After:

└─[$]➜ curl --header "Authorization: Bearer <job token>" http://127.0.0.1:3000/api/v4/job/allowed_agents
{"allowed_agents":[],"job":{"id":21},"pipeline":{"id":20},"project":{"id":17,"groups":[{"id":76},{"id":75}]},"user":{"id":1,"username":"root","roles_in_project":["guest","reporter","developer","maintainer","owner"]},"environment":{"tier":"production","slug":"production"}}

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.

#357934 (closed)

Edited by Tiger Watson

Merge request reports