Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-20 06:08:57 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-20 06:08:57 +0300
commit852f4a85dd199751e4652748461163de85ecda53 (patch)
treeb4160aa19c23582b5ab5ac02f9860b5498007c43 /lib
parent82cd20acf9f4cceecf222abe718a9e23cef55687 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r--lib/api/api.rb1
-rw-r--r--lib/api/deploy_tokens.rb20
-rw-r--r--lib/api/entities/deploy_token.rb9
3 files changed, 30 insertions, 0 deletions
diff --git a/lib/api/api.rb b/lib/api/api.rb
index 9a1e0e3f8e9..b6c6ad10d30 100644
--- a/lib/api/api.rb
+++ b/lib/api/api.rb
@@ -121,6 +121,7 @@ module API
mount ::API::Commits
mount ::API::CommitStatuses
mount ::API::DeployKeys
+ mount ::API::DeployTokens
mount ::API::Deployments
mount ::API::Environments
mount ::API::ErrorTracking
diff --git a/lib/api/deploy_tokens.rb b/lib/api/deploy_tokens.rb
new file mode 100644
index 00000000000..bf82c63260d
--- /dev/null
+++ b/lib/api/deploy_tokens.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+module API
+ class DeployTokens < Grape::API
+ include PaginationParams
+
+ before { authenticated_as_admin! }
+
+ desc 'Return all deploy tokens' do
+ detail 'This feature was introduced in GitLab 12.9.'
+ success Entities::DeployToken
+ end
+ params do
+ use :pagination
+ end
+ get 'deploy_tokens' do
+ present paginate(DeployToken.all), with: Entities::DeployToken
+ end
+ end
+end
diff --git a/lib/api/entities/deploy_token.rb b/lib/api/entities/deploy_token.rb
new file mode 100644
index 00000000000..cac6846a845
--- /dev/null
+++ b/lib/api/entities/deploy_token.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+module API
+ module Entities
+ class DeployToken < Grape::Entity
+ expose :id, :name, :username, :expires_at, :token, :scopes
+ end
+ end
+end