Sha256: 28d4c70cbd687e84f7539a72fb2daa9b99dac71b195332f5e0eb42f5c6780480

Contents?: true

Size: 793 Bytes

Versions: 5

Compression:

Stored size: 793 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}/core/view/alerts/"
            url.query_values = {:zapapiformat=>format,:baseurl=>@target}
            RestClient::get url.normalize.to_str
        end
    end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
owasp_zap-0.0.84 lib/owasp_zap/alert.rb
owasp_zap-0.0.83 lib/owasp_zap/alert.rb
owasp_zap-0.0.82 lib/owasp_zap/alert.rb
owasp_zap-0.0.81 lib/owasp_zap/alert.rb
owasp_zap-0.0.8 lib/owasp_zap/alert.rb