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/gitlab/ci/reports')
-rw-r--r--lib/gitlab/ci/reports/sbom/source.rb5
-rw-r--r--lib/gitlab/ci/reports/security/report.rb4
-rw-r--r--lib/gitlab/ci/reports/security/scanner.rb5
3 files changed, 9 insertions, 5 deletions
diff --git a/lib/gitlab/ci/reports/sbom/source.rb b/lib/gitlab/ci/reports/sbom/source.rb
index ea0fb8d4fbb..fbb8644c1b0 100644
--- a/lib/gitlab/ci/reports/sbom/source.rb
+++ b/lib/gitlab/ci/reports/sbom/source.rb
@@ -5,12 +5,11 @@ module Gitlab
module Reports
module Sbom
class Source
- attr_reader :source_type, :data, :fingerprint
+ attr_reader :source_type, :data
- def initialize(type:, data:, fingerprint:)
+ def initialize(type:, data:)
@source_type = type
@data = data
- @fingerprint = fingerprint
end
end
end
diff --git a/lib/gitlab/ci/reports/security/report.rb b/lib/gitlab/ci/reports/security/report.rb
index 70f2919d38d..54b21da5436 100644
--- a/lib/gitlab/ci/reports/security/report.rb
+++ b/lib/gitlab/ci/reports/security/report.rb
@@ -69,6 +69,10 @@ module Gitlab
replace_with!(::Security::MergeReportsService.new(self, other).execute)
end
+ def primary_identifiers
+ scanners.values.flat_map(&:primary_identifiers).compact
+ end
+
def primary_scanner
scanners.first&.second
end
diff --git a/lib/gitlab/ci/reports/security/scanner.rb b/lib/gitlab/ci/reports/security/scanner.rb
index 918df163ede..080ed3f834a 100644
--- a/lib/gitlab/ci/reports/security/scanner.rb
+++ b/lib/gitlab/ci/reports/security/scanner.rb
@@ -16,15 +16,16 @@ module Gitlab
"semgrep" => 2
}.freeze
- attr_accessor :external_id, :name, :vendor, :version
+ attr_accessor :external_id, :name, :vendor, :version, :primary_identifiers
alias_method :key, :external_id
- def initialize(external_id:, name:, vendor:, version:)
+ def initialize(external_id:, name:, vendor:, version:, primary_identifiers: nil)
@external_id = external_id
@name = name
@vendor = vendor
@version = version
+ @primary_identifiers = primary_identifiers
end
def to_hash