Skip to content

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sbernhard committed Apr 8, 2024
1 parent c841fd7 commit 9e9d035
Show file tree
Hide file tree
Showing 5 changed files with 5,231 additions and 3 deletions.
5 changes: 3 additions & 2 deletions app/services/foreman_cve_scanner/cve_report_scanner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,9 @@ def generate_trivy_entry(entry)

# rubocop:disable Metrics/AbcSize
def generate_unified_vuls
j = @raw_data['scan']
raise ::Foreman::Exception, _('Invalid CVE scanner report') unless @raw_data.key?('scan')

j = @raw_data['scan']
vuls = {}
if j.key?('matches') # Grype
j['matches'].each do |vul|
Expand All @@ -119,7 +120,7 @@ def generate_unified_vuls
end
else
Rails.logger.error 'Unsupported cve scanner report format'
raise ::Foreman::Exception, _('Invalid report')
raise ::Foreman::Exception, _('Unsupported cve scanner report format')
end

vuls
Expand Down
Loading

0 comments on commit 9e9d035

Please sign in to comment.