summaryrefslogtreecommitdiff
path: root/lib/api/project_job_token_scope.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-04-24 12:08:36 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-04-24 12:08:36 +0000
commit4720346c2e10e1ff62a20b39dfc9866eb88858e6 (patch)
tree1b277cb86d928b3372a714d21b5e068c5b9d66f1 /lib/api/project_job_token_scope.rb
parent028c7bdc315c3770f2ccc86f1100d90a5f702cad (diff)
downloadgitlab-ce-4720346c2e10e1ff62a20b39dfc9866eb88858e6.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/api/project_job_token_scope.rb')
-rw-r--r--lib/api/project_job_token_scope.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/api/project_job_token_scope.rb b/lib/api/project_job_token_scope.rb
new file mode 100644
index 00000000000..7fd288491ef
--- /dev/null
+++ b/lib/api/project_job_token_scope.rb
@@ -0,0 +1,27 @@
+# frozen_string_literal: true
+
+module API
+ class ProjectJobTokenScope < ::API::Base
+ before { authenticate! }
+
+ feature_category :secrets_management
+ urgency :low
+
+ resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do
+ desc 'Fetch CI_JOB_TOKEN access settings.' do
+ failure [
+ { code: 401, message: 'Unauthorized' },
+ { code: 403, message: 'Forbidden' },
+ { code: 404, message: 'Not found' }
+ ]
+ success code: 200, model: Entities::ProjectJobTokenScope
+ tags %w[projects_job_token_scope]
+ end
+ get ':id/job_token_scope' do
+ authorize_admin_project
+
+ present user_project, with: Entities::ProjectJobTokenScope
+ end
+ end
+ end
+end