Deploy Keys API
Release notes
We have added a new endpoint to the Deploy keys API to retrieve a list of project deploy keys for a specific user.
Problem to solve
Make deploy_keys endpoint serve all available deploy keys for all users or list all deploy keys a user has access to (also the available but not enabled keys).
Intended users
Developers, Maintainer, ...
Further details
If a user wants to automate the enabling of deploy keys for a bunch of projects, he has to either be an administrator or call an administrator to get the id of the particular key he needs. If the user has an api endpoint on which he can find all the keys accessible by himself, he could fullfill his task without further inconvenience.
If a maintainer/owner wants to automate the enabling of deploy keys for a bunch of projects, they have to be either an administrator or call an administrator to get the id of the particular key they need (because list-project-deploy-keys API lists only those keys which are enabled on the given project). If the maintainer/owner have an api endpoint on which they can find all the keys accessible by them, they could full-fill their task without further inconvenience.
Proposal
Show all deploy keys on the rest api endpoint https://gitlab.example.org/api/v4/deploy_keys which are available for a user (not just administrators)Show all deploy keys which are available to a user on the project api endpoint https://gitlab.example.org/api/v4/projects/:id/deploy_keys, currently only the enabled keys are shown.
Modified proposal as discussed in #28766 (comment 964795009)
Need an User API:
- Whose authentication works only for Maintainers/Owners of projects.
- It lists:
- All Public deploy keys +
- All enabled project deploy keys from projects that the user is already a maintainer/owner.
Refactored Implementation plan:
- API endpoint
GET api/v4/user/deploy_keys
should be implemented for the needs mentioned in the refactored proposal.
Iteration Plan
-
Introduce -
GET api/v4/:user_id/project_deploy_keys
(scheduled for %15.1) which covers from the proposalAll enabled project deploy keys from projects that the user is already a maintainer/owner.
Based on further requirement finalisation as discussed in #28766 (comment 965567740) we have iteration plan to cover the below use case
-
GET api/v4/user/deploy_keys
or equivalent which lists both
- All Public deploy keys +
- All enabled project deploy keys from projects that the user is already a maintainer/owner.