diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-09 03:08:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-09 03:08:14 +0300 |
commit | ed4df05ce917d6cf175aeb508b0485ae5f281a0a (patch) | |
tree | 9313abd8fd41a78eb2bf1ffd0f95f10b69cd25cb /lib/api | |
parent | 1bdb3fe3821fc3d222361d8b2e2ec2fea2915372 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/deploy_tokens.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/api/deploy_tokens.rb b/lib/api/deploy_tokens.rb index 3224157ca05..e10a12b6c46 100644 --- a/lib/api/deploy_tokens.rb +++ b/lib/api/deploy_tokens.rb @@ -34,5 +34,22 @@ module API present paginate(user_project.deploy_tokens), with: Entities::DeployToken end end + + params do + requires :id, type: Integer, desc: 'The ID of a group' + end + resource :groups, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do + desc 'Delete a group deploy token' do + detail 'This feature was introduced in GitLab 12.9' + end + delete ':id/deploy_tokens/:token_id' do + authorize!(:destroy_deploy_token, user_group) + + deploy_token = user_group.group_deploy_tokens + .find_by_deploy_token_id!(params[:token_id]) + + destroy_conditionally!(deploy_token) + end + end end end |