class Nexpose::ExportCredential

DBExport credentials configuration object.

The user_id, password and realm attributes should ONLY be used if a security blob cannot be generated and the data is being transmitted/stored using external encryption (e.g., HTTPS).

Attributes

credential[RW]

Security blob for exporting to a database.

password[RW]
realm[RW]

DB specific, usually the database name.

user_id[RW]

Public Class Methods

new(credential) click to toggle source
# File lib/nexpose/report.rb, line 601
def initialize(credential)
  @credential = credential
end
parse(xml) click to toggle source
# File lib/nexpose/report.rb, line 615
def self.parse(xml)
  xml.elements.each('//credentials') do |creds|
    credential = ExportCredential.new(creds.text)
    # The following attributes may not exist.
    credential.user_id  = creds.attributes['userid']
    credential.password = creds.attributes['password']
    credential.realm    = creds.attributes['realm']
    return credential
  end
  nil
end

Public Instance Methods

to_xml() click to toggle source
# File lib/nexpose/report.rb, line 605
def to_xml
  xml = '<credentials'
  xml << %( userid="#{@user_id}") if @user_id
  xml << %( password="#{@password}") if @password
  xml << %( realm="#{@realm}") if @realm
  xml << '>'
  xml << @credential if @credential
  xml << '</credentials>'
end