owasp_zap 0.0.91 → 0.0.92
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/version.rb +1 -1
- data/lib/owasp_zap.rb +11 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1b779895d80df8a635b7fbde0d401da38f4fca9
|
4
|
+
data.tar.gz: ede4cfa204fe46f112ccd476e327799d31ab0714
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88c8e352c89f35240f6c3031f622b268848f34d4d41f58bca42df309365d90404d168b8fb2463b07cc5389453e8d66a46e1a80fb4b9fa7c108586aba206056f9
|
7
|
+
data.tar.gz: 4626dad253d58793c4d193c793a346ca7786b48474b7d86831a5d8bbfd80faa3b0768b1bedf0b9f66c7347a9e9e968c797fb861029110f4804f4ce992348d965
|
data/lib/owasp_zap/version.rb
CHANGED
data/lib/owasp_zap.rb
CHANGED
@@ -2,6 +2,7 @@ require "json"
|
|
2
2
|
require "rest_client"
|
3
3
|
require "addressable/uri"
|
4
4
|
require "cgi"
|
5
|
+
require "logger"
|
5
6
|
|
6
7
|
require_relative "owasp_zap/version"
|
7
8
|
require_relative "owasp_zap/error"
|
@@ -15,7 +16,7 @@ module OwaspZap
|
|
15
16
|
class ZapException < Exception;end
|
16
17
|
|
17
18
|
class Zap
|
18
|
-
attr_accessor :target,:base
|
19
|
+
attr_accessor :target,:base, :zap_bin
|
19
20
|
|
20
21
|
def initialize(params = {})
|
21
22
|
#TODO
|
@@ -23,6 +24,7 @@ module OwaspZap
|
|
23
24
|
@base = params[:base] || "http://127.0.0.1:8080"
|
24
25
|
@target = params[:target]
|
25
26
|
@zap_bin = params [:zap] || "#{ENV['HOME']}/ZAP/zap.sh"
|
27
|
+
@output = params[:output] || $stdout #default we log everything to the stdout
|
26
28
|
end
|
27
29
|
|
28
30
|
def status_for(component)
|
@@ -68,8 +70,8 @@ module OwaspZap
|
|
68
70
|
Zap::Auth.new(:base=>@base)
|
69
71
|
end
|
70
72
|
|
71
|
-
#TODO
|
72
|
-
#DOCUMENT the step necessary: install ZAP under $home/ZAP or should be passed to new as :zap parameter
|
73
|
+
# TODO
|
74
|
+
# DOCUMENT the step necessary: install ZAP under $home/ZAP or should be passed to new as :zap parameter
|
73
75
|
def start(params = {})
|
74
76
|
cmd_line = if params.key? :daemon
|
75
77
|
"#{@zap_bin} -daemon"
|
@@ -77,6 +79,12 @@ module OwaspZap
|
|
77
79
|
@zap_bin
|
78
80
|
end
|
79
81
|
fork do
|
82
|
+
# if you passed :output=>"file.txt" to the constructor, then it will send the forked process output
|
83
|
+
# to this file (that means, ZAP stdout)
|
84
|
+
unless @output == $stdout
|
85
|
+
STDOUT.reopen(File.open(@output, 'w+'))
|
86
|
+
STDOUT.sync = true
|
87
|
+
end
|
80
88
|
exec cmd_line
|
81
89
|
end
|
82
90
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.92
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Pereira
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|