summaryrefslogtreecommitdiff
path: root/lib/gitlab/ci/reports/sbom/component.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/ci/reports/sbom/component.rb')
-rw-r--r--lib/gitlab/ci/reports/sbom/component.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/gitlab/ci/reports/sbom/component.rb b/lib/gitlab/ci/reports/sbom/component.rb
index 5188304f4ed..08307580987 100644
--- a/lib/gitlab/ci/reports/sbom/component.rb
+++ b/lib/gitlab/ci/reports/sbom/component.rb
@@ -31,8 +31,10 @@ module Gitlab
end
def supported_purl_type?
+ # the purl type is not required as per the spec: https://cyclonedx.org/docs/1.4/json/#components_items_purl
return true unless purl
+ # however, if the purl type is provided, it _must be valid_
::Enums::Sbom.purl_types.include?(purl.type.to_sym)
end
end