Skip to content

New REST api endpoint to fetch CI_JOB_TOKEN access settings

What does this MR do and why?

This MR works towards the first task of the issue (feature) #351740 (closed) .

🛠 with at Siemens

Screenshots or screen recordings

Here is the reponse when requesting the new api endpoint, see http://127.0.0.1:3000/api/v4/projects/7/job_token_scope

{
	"inbound_enabled": true,
	"outbound_enabled": false
}

How to set up and validate locally

  1. Create a personal access token with the respective rights
  2. Ensure the user of the personal access token is at least maintainer of the project
  3. Execute the following curl command
curl --request GET \
  --url http://127.0.0.1:3000/api/v4/projects/7/job_token_scope?private_token=<personal_access_token_of_project_maintainer>

TODO

  • Ensure correct permissions for request, i.e. maintainer or higher, see #351740 (closed)
  • Add test
  • Check if there are other properties that should be exposed in the response
  • Check if the right error codes are returned
  • Check for correct configuration in openapi.yml
  • Check if the personal access token need to have admin_mode
  • Add tests to new entity

MR acceptance checklist

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

Related to #351740 (closed)

Edited by Gerardo Navarro

Merge request reports