Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEX-56926: remove .xml extension on dyntable endpoints used by cucumbers #339

Merged
merged 1 commit into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading