Skip to content
Snippets Groups Projects

Move Security ConfigurationPresenter to FOSS

Merged Tetiana Chupryna requested to merge 342135-move-presenters into master
All threads resolved!
5 files
+ 157
42
Compare changes
  • Side-by-side
  • Inline
Files
5
@@ -67,11 +67,13 @@ def latest_pipeline_path
end
def scan(type, configured: false)
scan = ScanConfigurationPresenter.new(project, type: type, configured: configured)
{
type: type,
configured: configured,
configuration_path: configuration_path(type),
available: feature_available(type)
type: scan.type,
configured: scan.configured?,
configuration_path: scan.configuration_path,
available: scan.available?
}
end
@@ -82,28 +84,6 @@ def scan_types
def project_settings
project.security_setting
end
def configurable_scans
strong_memoize(:configurable_scans) do
{
dast: project_security_configuration_dast_path(project),
dast_profiles: project_security_configuration_dast_scans_path(project),
api_fuzzing: project_security_configuration_api_fuzzing_path(project),
corpus_management: (project_security_configuration_corpus_management_path(project) if ::Feature.enabled?(:corpus_management, project, default_enabled: :yaml) && scanner_enabled?(:coverage_fuzzing))
}
end
end
def configuration_path(type)
configurable_scans[type]
end
def feature_available(type)
# SAST and Secret Detection are always available, but this isn't
# reflected by our license model yet.
# TODO: https://gitlab.com/gitlab-org/gitlab/-/issues/333113
%w[sast secret_detection].include?(type) || project.licensed_feature_available?(type)
end
end
end
end
Loading