Protected tags API: support `deploy_key_id`
What does this MR do and why?
Contributes to #402238 (closed)
Problem
Users can set a deploy key for protected tags via UI. But this functionality is missing for REST API.
Solution
Permit to accept deploy_key_id
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
How to set up and validate locally
- Create a deploy key (see guide).
- Enable a deploy key for the project with write permissions
- Discover a deploy key id via API (example:
http://gdk.test:3000/api/v4/projects/<project_id>/deploy_keys
) - Create a protected branch with a deploy key
curl --request POST --header "PRIVATE-TOKEN: <private-token>" "http://gdk.test:3000/api/v4/projects/<project_id>/protected_tags?name=main&allowed_to_create%5B%5D%5Bdeploy_key_id%5D=<deploy_key_id>"
- You should see a new protected tag record with a deploy key
Edited by Vasilii Iakliushin