owasp_zap 0.0.91 → 0.0.92

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c541ec393a716435c374a50c2a9900b8b2f4e3e1
4
- data.tar.gz: cd3223f7cb8c8d8469cb86f0dee218c07aaf25cd
3
+ metadata.gz: c1b779895d80df8a635b7fbde0d401da38f4fca9
4
+ data.tar.gz: ede4cfa204fe46f112ccd476e327799d31ab0714
5
5
  SHA512:
6
- metadata.gz: f92c649d9707bcea142030259ca99d7f2114b4771f62f36bcfd3f6737dcd5ad37b681434b21293656c46f4633d4f9728a7291818910476e5ef6d58a9b2b4c9ca
7
- data.tar.gz: e2eddb6c6a51afa45eedc4a6c059cc4b4d1fea7446e8fd305ef6a756ef5a86432e1bb9fcdd92ddd4b044c47cc650fb99a70629227a7ef8512ddfcb8a4e62d83e
6
+ metadata.gz: 88c8e352c89f35240f6c3031f622b268848f34d4d41f58bca42df309365d90404d168b8fb2463b07cc5389453e8d66a46e1a80fb4b9fa7c108586aba206056f9
7
+ data.tar.gz: 4626dad253d58793c4d193c793a346ca7786b48474b7d86831a5d8bbfd80faa3b0768b1bedf0b9f66c7347a9e9e968c797fb861029110f4804f4ce992348d965
@@ -1,3 +1,3 @@
1
1
  module OwaspZap
2
- VERSION = "0.0.91"
2
+ VERSION = "0.0.92"
3
3
  end
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.91
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-06-23 00:00:00.000000000 Z
11
+ date: 2014-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler