Sha256: f27d2f372edd5815204da26353f30496887732954fedbbd9802feb5ef18bb878

Contents?: true

Size: 557 Bytes

Versions: 1

Compression:

Stored size: 557 Bytes

Contents

module Pluginscan
  # Responsible for calling out to an API to see if any advisories
  # have been published about this plugin
  class VulnerabilityScanner
    class Error < StandardError; end

    def initialize(advisories_api = WPVulnDB::API.new, response_handler = WPVulnDB::APIResponseHandler.new)
      @advisories_api = advisories_api
      @response_handler = response_handler
    end

    def scan(plugin_slug)
      response = @advisories_api.get_plugin_advisories(plugin_slug)
      @response_handler.call(response, plugin_slug)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pluginscan-0.9.0 lib/pluginscan/reports/vulnerability_report/vulnerability_scanner.rb