ruby-deepviz 1.0.2 → 1.1.1

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: 148be5362fbc0a4f9c269bcb5b34722d50210aaa
4
- data.tar.gz: 6a63b4356641b77b83ac4fd629e82f234f86e0b7
3
+ metadata.gz: a44b01fa727f0399b883d01335d5dc16f1fba6fe
4
+ data.tar.gz: da7bbe5af9c42701c3482bf555c63aa590960d35
5
5
  SHA512:
6
- metadata.gz: 160f640cf1abc93a2a415fe4fdff4cda77e29d0a97d15567c3fd08754193eadeea438edf811d97026d0793783d048c92f78e9842f0ddbd4120ca9aeb6eb1ed5b
7
- data.tar.gz: 6f2fe54b1292801a477c5fe3676cb9263b9f9fc798432b9ae7964ec8da68cf49bc22aff6090b6e143db086f53c7f2ae2101ca30b35b3105465eb053aae22ebae
6
+ metadata.gz: 00bc1d775013fb84b31dfc056c7a7102193cde2da6caf33ab639db5a42e26708e48e4059da31f87925a0aadc6e2f196d6a7211c76921a0c2ecdba236afe416e3
7
+ data.tar.gz: c3d5ef4da194adab29d1774c5e5cd830d8be91b3c9d357ed73ecba8f8c180e2f3bc24bded69a003eeb1fb79df4d50ac34a06ff6e1011906b4dacf48041cfdcd7
@@ -3,6 +3,7 @@ require 'deepviz/result'
3
3
  class Intel
4
4
 
5
5
  URL_INTEL_SEARCH = 'https://api.deepviz.com/intel/search'
6
+ URL_INTEL_DOWNLOAD_REPORT = 'https://api.deepviz.com/intel/report'
6
7
  URL_INTEL_IP = 'https://api.deepviz.com/intel/network/ip'
7
8
  URL_INTEL_DOMAIN = 'https://api.deepviz.com/intel/network/domain'
8
9
  URL_INTEL_SEARCH_ADVANCED = 'https://api.deepviz.com/intel/search/advanced'
@@ -270,5 +271,33 @@ class Intel
270
271
  end
271
272
  end
272
273
 
274
+ def sample_result(api_key, md5)
275
+ return sample_info(api_key, md5, ['classification'])
276
+ end
277
+
278
+
279
+ def sample_info(api_key, md5, filters)
280
+ if api_key == nil or api_key == ''
281
+ return Result.new(status=INPUT_ERROR, msg='API key cannot be null or empty String')
282
+ end
283
+
284
+ if md5 == nil or md5 == ''
285
+ return Result.new(status=INPUT_ERROR, msg='MD5 cannot be null or empty String')
286
+ end
287
+
288
+ if filters != nil
289
+ if 0 < filters.length > 10
290
+ return Result.new(status=INPUT_ERROR, msg='Parameter \'output_filters\' takes at least 1 value and at most 10 values (%s given)' % [filters.length])
291
+ end
292
+
293
+ body = {:api_key => api_key, :md5 => md5, :output_filters => filters}
294
+ else
295
+ return Result.new(status=INPUT_ERROR, msg='Output filters cannot be null or empty')
296
+ end
297
+
298
+ return do_post(body, URL_INTEL_DOWNLOAD_REPORT)
299
+ end
300
+
273
301
  private :do_post
274
- end
302
+ end
303
+
@@ -140,12 +140,7 @@ class Sandbox
140
140
  end
141
141
 
142
142
 
143
- def sample_result(api_key, md5)
144
- return sample_report(api_key, md5, ['classification'])
145
- end
146
-
147
-
148
- def sample_report(api_key, md5, filters=nil)
143
+ def sample_report(api_key, md5)
149
144
  if api_key == nil or api_key == ''
150
145
  return Result.new(status=INPUT_ERROR, msg='API key cannot be null or empty String')
151
146
  end
@@ -154,11 +149,7 @@ class Sandbox
154
149
  return Result.new(status=INPUT_ERROR, msg='MD5 cannot be null or empty String')
155
150
  end
156
151
 
157
- if filters != nil
158
- body = {:api_key => api_key, :md5 => md5, :output_filters => filters}
159
- else
160
- body = {:api_key => api_key, :md5 => md5}
161
- end
152
+ body = {:api_key => api_key, :md5 => md5}
162
153
 
163
154
  return do_post(body, URL_DOWNLOAD_REPORT)
164
155
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-deepviz
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saferbytes S.r.l.s.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-12 00:00:00.000000000 Z
11
+ date: 2016-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler