owasp_zap 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/owasp_zap/alert.rb +3 -2
- data/lib/owasp_zap/error.rb +4 -0
- data/lib/owasp_zap/version.rb +1 -1
- data/lib/owasp_zap.rb +1 -0
- data/spec/alert_spec.rb +23 -0
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12b7b8a9a5e467df211b540b1e37397c2010a3cc
|
4
|
+
data.tar.gz: 59631214ffc42c20e952f1bc4e0fdf0aa0dda8ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bdd1bcfd595e647f0c78edd838052be844fe10b29f4b4f01d00f4e042f4ff814f87378282bce761b9841fe983b1a2147279d9bf089257722bd0ffb5fae762660
|
7
|
+
data.tar.gz: a1c5bee92a9674f37c2867127fb64aaa37d4d5266ced72e3dea4400bc9444d548f1540915dca9ffeb9da42b0e43abdf650a0ab527aaec005247b336685deeebc
|
data/lib/owasp_zap/alert.rb
CHANGED
@@ -8,10 +8,11 @@ module OwaspZap
|
|
8
8
|
|
9
9
|
#
|
10
10
|
# the API has an option to give an offset (start) and the amount of alerts (count) as parameter
|
11
|
-
def view
|
11
|
+
def view(format = "JSON")
|
12
|
+
raise OwaspZap::WrongFormatException,"Output format not accepted" unless ["JSON","HTML","XML"].include?(format)
|
12
13
|
#http://localhost:8080/JSON/core/view/alerts/?zapapiformat=JSON&baseurl=http%3A%2F%2F192.168.1.113&start=&count=
|
13
14
|
url = Addressable::URI.parse "#{@base}/core/view/alerts/"
|
14
|
-
url.query_values = {:zapapiformat=>
|
15
|
+
url.query_values = {:zapapiformat=>format,:baseurl=>@target}
|
15
16
|
RestClient::get url.normalize.to_str
|
16
17
|
end
|
17
18
|
end
|
data/lib/owasp_zap/version.rb
CHANGED
data/lib/owasp_zap.rb
CHANGED
data/spec/alert_spec.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
describe OwaspZap::Alert do
|
4
|
+
before do
|
5
|
+
@alert = OwaspZap::Alert.new
|
6
|
+
end
|
7
|
+
it "should not be_nil" do
|
8
|
+
refute @alert.nil?
|
9
|
+
end
|
10
|
+
it "should respond_to view" do
|
11
|
+
assert_respond_to @alert, :view
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should try WrongFormatException" do
|
15
|
+
assert_raises(OwaspZap::WrongFormatException) { @alert.view("FOO") }
|
16
|
+
end
|
17
|
+
|
18
|
+
it "view accept HTML, JSON and XML as param" do
|
19
|
+
["JSON","HTML","XML"].each do |f|
|
20
|
+
assert_raises(WebMock::NetConnectNotAllowedError) { @alert.view(format=f) }
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: owasp_zap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Pereira
|
@@ -125,10 +125,12 @@ files:
|
|
125
125
|
- lib/owasp_zap/alert.rb
|
126
126
|
- lib/owasp_zap/attack.rb
|
127
127
|
- lib/owasp_zap/auth.rb
|
128
|
+
- lib/owasp_zap/error.rb
|
128
129
|
- lib/owasp_zap/spider.rb
|
129
130
|
- lib/owasp_zap/string_extension.rb
|
130
131
|
- lib/owasp_zap/version.rb
|
131
132
|
- owasp_zap.gemspec
|
133
|
+
- spec/alert_spec.rb
|
132
134
|
- spec/auth_spec.rb
|
133
135
|
- spec/helper.rb
|
134
136
|
- spec/zap_spec.rb
|
@@ -157,6 +159,7 @@ signing_key:
|
|
157
159
|
specification_version: 4
|
158
160
|
summary: ruby wrapper for the zed application proxy
|
159
161
|
test_files:
|
162
|
+
- spec/alert_spec.rb
|
160
163
|
- spec/auth_spec.rb
|
161
164
|
- spec/helper.rb
|
162
165
|
- spec/zap_spec.rb
|