Module: VeracodeApiResults
Overview
Results module. Contains all methods necessary to download scan reports.
Instance Method Summary collapse
-
#get_most_recent_build_id(app_id) ⇒ Object
calls ‘getbuildlist’ and returns the last ‘build_id’ attribute associated with the passed app_id.
-
#get_prescan_results(app_id) ⇒ Object
calls ‘getprescanresults’.
-
#get_scan_report(build_id) ⇒ Object
calls ‘detailedreport’ for the passed ‘build_id’ attribute, returning the xml body of the response.
-
#get_scan_report_pdf(build_id) ⇒ Object
similar to above method, except returns a pdf response instead of xml.
Methods included from VeracodeApiBase
#get_repo_archive, #parse_new_app_id, #response_parse_app_id, #veracode_api_request
Instance Method Details
#get_most_recent_build_id(app_id) ⇒ Object
calls ‘getbuildlist’ and returns the last ‘build_id’ attribute associated with the passed app_id
98 99 100 101 |
# File 'lib/veracodecli/api.rb', line 98 def get_most_recent_build_id(app_id) build_list = veracode_api_request 'getbuildlist.do', app_id: app_id build_list.body.scan(/build_id="(.*?)"/).last[0] end |
#get_prescan_results(app_id) ⇒ Object
calls ‘getprescanresults’
104 105 106 107 108 109 |
# File 'lib/veracodecli/api.rb', line 104 def get_prescan_results(app_id) results = veracode_api_request 'getprescanresults.do', app_id: app_id puts "Fetched prescan results for #{app_id}" puts results.body results end |
#get_scan_report(build_id) ⇒ Object
calls ‘detailedreport’ for the passed ‘build_id’ attribute, returning the xml body of the response. Note that this api is version 3.0 not 4.0.
112 113 114 115 |
# File 'lib/veracodecli/api.rb', line 112 def get_scan_report(build_id) report = veracode_api_request 'detailedreport.do', api_version: '3.0', build_id: build_id report.body end |
#get_scan_report_pdf(build_id) ⇒ Object
similar to above method, except returns a pdf response instead of xml.
118 119 120 121 |
# File 'lib/veracodecli/api.rb', line 118 def get_scan_report_pdf(build_id) report = veracode_api_request 'detailedreportpdf.do', api_version: '3.0', build_id: build_id report.body end |