debian-mirror-gitlab/app/graphql/mutations/security/ci_configuration/configure_sast.rb

25 lines
805 B
Ruby
Raw Normal View History

2021-03-11 19:13:27 +05:30
# frozen_string_literal: true
module Mutations
module Security
module CiConfiguration
2021-09-30 23:02:18 +05:30
class ConfigureSast < BaseSecurityAnalyzer
2021-03-11 19:13:27 +05:30
graphql_name 'ConfigureSast'
2021-06-08 01:23:25 +05:30
description <<~DESC
Configure SAST for a project by enabling SAST in a new or modified
`.gitlab-ci.yml` file in a new branch. The new branch and a URL to
create a Merge Request are a part of the response.
DESC
2021-03-11 19:13:27 +05:30
argument :configuration, ::Types::CiConfiguration::Sast::InputType,
required: true,
description: 'SAST CI configuration for the project.'
2021-09-30 23:02:18 +05:30
def configure_analyzer(project, **args)
::Security::CiConfiguration::SastCreateService.new(project, current_user, args[:configuration]).execute
2021-03-11 19:13:27 +05:30
end
end
end
end
end