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
diff options
context:
space:
mode:
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