Skip to content

Conversion Guide: 0.9.x to 1.0.0

Noah Birnel edited this page Apr 17, 2015 · 13 revisions

This is a break-down of the breaking API changes between versions 0.9.x and 1.0. It should aid in converting existing scripts which you may have written. I've tried to organize these by which ones are most likely to affect existing code. This document does not extensively cover wholly new features introduced in the 1.0 version of the gem.

Removal of methods

The parse(xml) and to_xml methods were removed from the following classes:

  • Site
  • SyslogAlert
  • SNMPAlert
  • SMTPAlert

Moved classes to Nexpose::WebCredentials module.

We moved the following classes to the Nexpose::WebCredentials module:

  • Header
  • Headers
  • Field
  • HTMLForm
  • HTMLForms

Site

The field scan_template was renamed to scan_template_id.

The field engine was renamed to engine_id.

The field assets was renamed to included_addresses.

The field exclude was renamed to excluded_addresses.

The field credentials was renamed to site_credentials.

The field criteria was renamed to search_criteria.

The field discovery_connection_id was renamed to discovery_config.

The field is_dynamic was removed. Users no longer needs to explicitly declare a site to be dynamic. Users can still determine whether site is dynamic by using the is_dynamic? method.

The method save_dynamic_criteria() was removed. Users can save search criteria using the save() method.

The method load_dynamic_attributes() was removed. Users can load search criteria using the load() method.

The method _append_shared_creds_to_xml(connection, xml) was removed. Users can set shared scan credentials using the shared_credentials field.

Schedule

The field template was renamed to scan_template_id.

Added the scan template as an optional parameter to the constructor.

The method start now returns a Time rather than a String.

SiteCredential

The parameter list for method self.for_service() was altered to include the required field name. The parameter list was also reordered from:

SiteCredential::for_service(service, user, password, realm, host, port)

to:

SiteCredential::for_service(name, id, desc, host, port, service)

The field blob was removed.

Alert

Removed the Alert class. The Alert class is no longer needed to create syslog, snmp, or smtp alerts.

SyslogAlert

Moving fields from Alert class to classes SyslogAlert.

Constructor parameters were altered to include all required fields. Optional fields were given default values.

SNMPAlert

Moving fields from Alert class to classes SNMPAlert.

Constructor parameters were altered to include all required fields. Optional fields were given default values.

SMTPAlert

Moving fields from Alert class to classes SMTPAlert.

Constructor parameters were altered to include all required fields. Optional fields were given default values.

The field limit_text was renamed to verbose.