Skip to content

Commit

Permalink
Merge pull request #179 from rapid7/bug/178_filtered_asset_site_ids
Browse files Browse the repository at this point in the history
Update FilteredAsset to support site_id in Nexpose 5.13 and later
  • Loading branch information
sgreen-r7 committed Jul 7, 2015
2 parents 5db6228 + c63ff5f commit f391813
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/nexpose/filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,11 @@ class FilteredAsset
attr_reader :vuln_count
attr_reader :risk_score

# The first Site ID returned for this asset.
# Not recommended if Asset Linking feature is enabled.
attr_reader :site_id
# Array of Site IDs for the asset. Use when Asset Linking is enabled.
attr_reader :site_ids
attr_reader :last_scan

def initialize(json)
Expand All @@ -387,7 +391,8 @@ def initialize(json)
@malware_count = json['malwareCount'].to_i
@vuln_count = json['vulnCount'].to_i
@risk_score = json['riskScore'].to_f
@site_id = json['siteID']
@site_ids = json['sitePermissions'].map { |site| site['siteID'] }
@site_id = @site_ids.first
@last_scan = Time.at(json['lastScanDate'].to_i / 1000)
end
end
Expand Down

0 comments on commit f391813

Please sign in to comment.