Skip to content

Commit

Permalink
NEX-56926: remove .xml extension on dyntable endpoints (#339)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcreighton-r7 authored Mar 28, 2024
1 parent 564301f commit 40bd037
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/nexpose/data_table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def _get_json_table(console, address, parameters = {}, page_size = 500, records
# @return [Array[Hash]] array of hashes representing the requested table.
#
# Example usage:
# DataTable._get_dyn_table(@console, '/data/asset/os/dyntable.xml?tableID=OSSynopsisTable')
# DataTable._get_dyn_table(@console, '/data/asset/os/dyntable?tableID=OSSynopsisTable')
#
def _get_dyn_table(console, address, payload = nil)
if payload
Expand Down
2 changes: 1 addition & 1 deletion lib/nexpose/scan.rb
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ def paused_scans(site_id = nil, limit = nil)
data.map(&ActiveScan.method(:parse_json))
end
else
uri = '/data/site/scans/dyntable.xml?printDocType=0&tableID=siteScansTable&activeOnly=true'
uri = '/data/site/scans/dyntable?printDocType=0&tableID=siteScansTable&activeOnly=true'
data = DataTable._get_dyn_table(self, uri).select { |scan| (scan['Status'].include? 'Paused') }
data.map(&ActiveScan.method(:parse_dyntable))
end
Expand Down
8 changes: 4 additions & 4 deletions lib/nexpose/vuln.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def list_vulns(full = false)
# @return [Array[String]] Array of currently valid check categories.
#
def list_vuln_categories
data = DataTable._get_dyn_table(self, '/data/vulnerability/categories/dyntable.xml?tableID=VulnCategorySynopsis')
data = DataTable._get_dyn_table(self, '/data/vulnerability/categories/dyntable?tableID=VulnCategorySynopsis')
data.map { |c| c['Category'] }
end

Expand All @@ -46,7 +46,7 @@ def list_vuln_categories
# @return [Array[String]] Array of currently valid check types.
#
def vuln_types
data = DataTable._get_dyn_table(self, '/data/vulnerability/checktypes/dyntable.xml?tableID=VulnCheckCategorySynopsis')
data = DataTable._get_dyn_table(self, '/data/vulnerability/checktypes/dyntable?tableID=VulnCheckCategorySynopsis')
data.map { |c| c['Category'] }
end
alias list_vuln_types vuln_types
Expand Down Expand Up @@ -74,7 +74,7 @@ def vuln_details(vuln_id)
# @return [Array[VulnCheck]] List of matching Vulnerability Checks.
#
def find_vuln_check(search_term, partial_words = true, all_words = true)
uri = "/data/vulnerability/vulnerabilities/dyntable.xml?tableID=VulnCheckSynopsis&phrase=#{URI.encode(search_term)}&allWords=#{all_words}"
uri = "/data/vulnerability/vulnerabilities/dyntable?tableID=VulnCheckSynopsis&phrase=#{URI.encode(search_term)}&allWords=#{all_words}"
data = DataTable._get_dyn_table(self, uri)
data.map do |vuln|
XML::VulnCheck.new(vuln)
Expand All @@ -91,7 +91,7 @@ def find_vuln_check(search_term, partial_words = true, all_words = true)
# Nexpose between the provided dates.
#
def find_vulns_by_date(from, to = nil)
uri = "/data/vulnerability/synopsis/dyntable.xml?addedMin=#{from}"
uri = "/data/vulnerability/synopsis/dyntable?addedMin=#{from}"
uri += "&addedMax=#{to}" if to
DataTable._get_dyn_table(self, uri).map { |v| VulnSynopsis.new(v) }
end
Expand Down

0 comments on commit 40bd037

Please sign in to comment.