Commit 38c86c73 authored by can eldem's avatar can eldem

Parse scan object

parent 9e4d74e9
......@@ -65,6 +65,7 @@ module Gitlab
severity: parse_severity_level(data['severity']&.downcase),
confidence: parse_confidence_level(data['confidence']&.downcase),
scanner: scanner,
scan: create_scan(data['scan']),
identifiers: identifiers,
raw_metadata: data.to_json,
metadata_version: version))
......
......@@ -18,12 +18,13 @@ module Gitlab
attr_reader :raw_metadata
attr_reader :report_type
attr_reader :scanner
attr_reader :scan
attr_reader :severity
attr_reader :uuid
delegate :file_path, :start_line, :end_line, to: :location
def initialize(compare_key:, identifiers:, location:, metadata_version:, name:, raw_metadata:, report_type:, scanner:, uuid:, confidence: nil, severity: nil) # rubocop:disable Metrics/ParameterLists
def initialize(compare_key:, identifiers:, location:, metadata_version:, name:, raw_metadata:, report_type:, scanner:, scan:, uuid:, confidence: nil, severity: nil) # rubocop:disable Metrics/ParameterLists
@compare_key = compare_key
@confidence = confidence
@identifiers = identifiers
......@@ -33,6 +34,7 @@ module Gitlab
@raw_metadata = raw_metadata
@report_type = report_type
@scanner = scanner
@scan = scan
@severity = severity
@uuid = uuid
......
# frozen_string_literal: true
module Gitlab
module Ci
module Reports
module Security
class Scan
attr_accessor :type, :status, :start_time, :end_time
def initialize(params = {})
@type= params.dig('type')
@status = params.dig('success')
@start_time = params.dig('start_time')
@end_time = params.dig('end_time')
end
end
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment