nexpose 0.8.15 → 0.8.16

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: 45b0f1a12a6a13987fa0b840be93b92b8c40e451
4
- data.tar.gz: 54540622743549039ad34336f7cf9d24c4d25286
3
+ metadata.gz: 1cb45443d83455f41bad616d55864c36548c1bbf
4
+ data.tar.gz: f42d2cbdc6f3e30cabe2f18c7716ff0542aab120
5
5
  SHA512:
6
- metadata.gz: 6bb14936c5f39251cf2e0ca3d188e6636de15c3cd76fbabdb0c3f2b01db94cac2e567cf9f40e1d4e0313351bc9f8096ab97eb797702f1692988bc52f449deffd
7
- data.tar.gz: 1dc2290b9d6194e097f9fb9755892c9419529aef60ca36b4052d5232cb4175713df8f1ee39695b92d03fb78e5faa7a22762afeb0f5768f53b04b9981f856de99
6
+ metadata.gz: d78a1ed3b71c43bb3bf67425a9e0e43620efa44f8ba4f634679acc0093cf1d7a21b29c24981a128e4d2590c69f0618f78e8c495d41eb86201d320d119431dcfe
7
+ data.tar.gz: fd40da514a564539e5916fe367d4e55c92f34e849a9ca895a056da4ab42947e1220ae752dd492f9940fb82a2846b9e76048be0b52313d0e63243bda3bcf672a4
data/lib/nexpose/ajax.rb CHANGED
@@ -160,7 +160,7 @@ module Nexpose
160
160
  raise Nexpose::PermissionError.new(response)
161
161
  else
162
162
  req_type = request.class.name.split('::').last.upcase
163
- raise Nexpose::APIError.new(response, "#{req_type} request to #{request.path} failed. #{request.body}")
163
+ raise Nexpose::APIError.new(response, "#{req_type} request to #{request.path} failed. #{request.body}", response.code)
164
164
  end
165
165
  end
166
166
 
@@ -109,6 +109,21 @@ module Nexpose
109
109
  end
110
110
  end
111
111
 
112
+ # Retrieve a list of assets which are incomplete in a given scan. If called
113
+ # during a scan, this method returns currently incomplete assets which may
114
+ # be in progress.
115
+ #
116
+ # @param [Fixnum] scan_id Unique identifier of a scan.
117
+ # @return [Array[IncompleteAsset]] List of incomplete assets.
118
+ #
119
+ def incomplete_assets(scan_id)
120
+ uri = "/data/asset/scan/#{scan_id}/incomplete-assets"
121
+ AJAX.preserving_preference(self, 'scan-incomplete-assets') do
122
+ data = DataTable._get_json_table(self, uri, {}, 500, nil, false)
123
+ data.map(&IncompleteAsset.method(:parse_json))
124
+ end
125
+ end
126
+
112
127
  def delete_device(device_id)
113
128
  r = execute(make_xml('DeviceDeleteRequest', { 'device-id' => device_id }))
114
129
  r.success
@@ -188,4 +203,9 @@ module Nexpose
188
203
  end
189
204
  end
190
205
  end
206
+
207
+ # Summary object of an incomplete asset for a scan.
208
+ #
209
+ class IncompleteAsset < CompletedAsset
210
+ end
191
211
  end
data/lib/nexpose/error.rb CHANGED
@@ -1,10 +1,12 @@
1
1
  module Nexpose
2
2
  class APIError < ::RuntimeError
3
3
  attr_accessor :req, :reason
4
+ attr_reader :code
4
5
 
5
- def initialize(req, reason = '')
6
+ def initialize(req, reason = '', code = 400)
6
7
  @req = req
7
8
  @reason = reason
9
+ @code = code
8
10
  end
9
11
 
10
12
  def to_s
@@ -1,4 +1,4 @@
1
1
  module Nexpose
2
2
  # The latest version of the Nexpose gem
3
- VERSION = '0.8.15'
3
+ VERSION = '0.8.16'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nexpose
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.15
4
+ version: 0.8.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - HD Moore
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2014-11-12 00:00:00.000000000 Z
14
+ date: 2014-12-10 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rex
@@ -143,8 +143,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
143
  version: '0'
144
144
  requirements: []
145
145
  rubyforge_project:
146
- rubygems_version: 2.2.2
146
+ rubygems_version: 2.4.3
147
147
  signing_key:
148
148
  specification_version: 4
149
149
  summary: Ruby API for Rapid7 Nexpose
150
150
  test_files: []
151
+ has_rdoc: