Sha256: 68b3c3ce78231971f2e2194f28349b3ac193aebab2afcbb34897b05f9c25e70d

Contents?: true

Size: 803 Bytes

Versions: 7

Compression:

Stored size: 803 Bytes

Contents

module OwaspZap
    class Alert
        def initialize(params = {})
            #handle params
            @base = params[:base]
            @target = params[:target]
        end

        #
        # the API has an option to give an offset (start) and the amount of alerts (count) as parameter
        def view(format = "JSON")
            raise OwaspZap::WrongFormatException,"Output format not accepted" unless ["JSON","HTML","XML"].include?(format)
            #http://localhost:8080/JSON/core/view/alerts/?zapapiformat=JSON&baseurl=http%3A%2F%2F192.168.1.113&start=&count=
            url = Addressable::URI.parse "#{@base}/#{format}/core/view/alerts/"
            url.query_values = {:zapapiformat=>format,:baseurl=>@target}
            RestClient::get url.normalize.to_str
        end
    end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
owasp_zap-0.1.0 lib/owasp_zap/alert.rb
owasp_zap-0.0.95 lib/owasp_zap/alert.rb
owasp_zap-0.0.94 lib/owasp_zap/alert.rb
owasp_zap-0.0.93 lib/owasp_zap/alert.rb
owasp_zap-0.0.92 lib/owasp_zap/alert.rb
owasp_zap-0.0.91 lib/owasp_zap/alert.rb
owasp_zap-0.0.9 lib/owasp_zap/alert.rb