ruby-deepviz 1.1.1 → 2.0.0
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/deepviz/intel.rb +27 -79
- data/lib/deepviz/result.rb +0 -0
- data/lib/deepviz/sandbox.rb +0 -0
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 315585d0473d6645a28885fe73792f08ef8b6761
|
4
|
+
data.tar.gz: 28abe1ebaa5fe667e3244ed65f2b65216450ff27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd125a0812e4c121986638250f058f3cb09643ca3f9dba303e6150f7bd852c1247ad906995bea146bd0d4a364429509ca7ff8705fe1a23ca2ad6c00204614625
|
7
|
+
data.tar.gz: 1e908fb70c7830624b0d7af1e10425b06ffe7187fda6c98c65bae3525613094c11cb8d90f2328225a8e66ba6c9dd1343ac5a12283cfb97c90c5c0b9845f554fd
|
data/lib/deepviz/intel.rb
CHANGED
@@ -8,116 +8,65 @@ class Intel
|
|
8
8
|
URL_INTEL_DOMAIN = 'https://api.deepviz.com/intel/network/domain'
|
9
9
|
URL_INTEL_SEARCH_ADVANCED = 'https://api.deepviz.com/intel/search/advanced'
|
10
10
|
|
11
|
-
def ip_info(api_key,
|
11
|
+
def ip_info(api_key, ip, filters=nil)
|
12
12
|
if api_key == nil or api_key == ''
|
13
13
|
return Result.new(status=INPUT_ERROR, msg='API key cannot be null or empty String')
|
14
14
|
end
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
:history => false,
|
19
|
-
:time_delta => nil,
|
20
|
-
}
|
21
|
-
|
22
|
-
options = defaults.merge(options)
|
23
|
-
|
24
|
-
if (!options['ip'].kind_of?(Array) and (options['time_delta'] == nil or options['time_delta'] == '')) or (options['ip'].kind_of?(Array) and options['time_delta'] != nil and options['time_delta'] != '')
|
25
|
-
msg = 'Parameters missing or invalid. You must specify either a list of IPs or time delta'
|
16
|
+
if ip.nil? or ip == ''
|
17
|
+
msg = 'Parameters missing or invalid. You must specify an IP.'
|
26
18
|
return Result.new(status=INPUT_ERROR, msg=msg)
|
27
19
|
end
|
28
20
|
|
29
|
-
if
|
30
|
-
|
31
|
-
|
32
|
-
_history = 'false'
|
21
|
+
if filters != nil and !filters.kind_of?(Array)
|
22
|
+
msg = 'You must provide one or more output filters in a list'
|
23
|
+
return Result.new(status=INPUT_ERROR, msg=msg)
|
33
24
|
end
|
34
25
|
|
35
|
-
if
|
36
|
-
msg = 'You must provide one or more IPs in a list'
|
37
|
-
return Result.new(status=INPUT_ERROR, msg=msg)
|
38
|
-
else
|
26
|
+
if filters != nil
|
39
27
|
body = {
|
40
|
-
:
|
41
|
-
:history => _history,
|
28
|
+
:output_filters => filters,
|
42
29
|
:api_key => api_key,
|
30
|
+
:ip => ip,
|
43
31
|
}
|
44
|
-
|
45
|
-
|
46
|
-
if options['time_delta'] != nil and options['time_delta'] != ''
|
32
|
+
else
|
47
33
|
body = {
|
48
|
-
:time_delta => options['time_delta'],
|
49
|
-
:history => _history,
|
50
34
|
:api_key => api_key,
|
35
|
+
:ip => ip,
|
51
36
|
}
|
52
37
|
end
|
53
38
|
|
54
39
|
return do_post(body, URL_INTEL_IP)
|
55
40
|
end
|
56
41
|
|
57
|
-
|
58
|
-
|
42
|
+
|
43
|
+
def domain_info(api_key, domain, filters = nil)
|
44
|
+
if api_key.nil? or api_key == ''
|
59
45
|
return Result.new(status=INPUT_ERROR, msg='API key cannot be null or empty String')
|
60
46
|
end
|
61
47
|
|
62
|
-
defaults = {
|
63
|
-
:domain => nil,
|
64
|
-
:filters => nil,
|
65
|
-
:history => false,
|
66
|
-
:time_delta => nil,
|
67
|
-
}
|
68
|
-
|
69
|
-
options = defaults.merge(options)
|
70
48
|
|
71
|
-
if
|
72
|
-
msg = 'Parameters missing or invalid. You must specify
|
49
|
+
if domain.nil? or domain == ''
|
50
|
+
msg = 'Parameters missing or invalid. You must specify an domain.'
|
73
51
|
return Result.new(status=INPUT_ERROR, msg=msg)
|
74
52
|
end
|
75
53
|
|
76
|
-
if
|
77
|
-
_history = 'true'
|
78
|
-
else
|
79
|
-
_history = 'false'
|
80
|
-
end
|
81
|
-
|
82
|
-
if options['filters'] != nil and !options['filters'].kind_of?(Array)
|
54
|
+
if filters != nil and !filters.kind_of?(Array)
|
83
55
|
msg = 'You must provide one or more output filters in a list'
|
84
56
|
return Result.new(status=INPUT_ERROR, msg=msg)
|
85
57
|
end
|
86
58
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
if options['filters'] != nil
|
91
|
-
body = {
|
92
|
-
:output_filters => options['filters'],
|
93
|
-
:domain => options['domain'],
|
94
|
-
:history => _history,
|
95
|
-
:api_key => api_key,
|
96
|
-
}
|
97
|
-
else
|
98
|
-
body = {
|
99
|
-
:domain => options['domain'],
|
100
|
-
:history => _history,
|
101
|
-
:api_key => api_key,
|
102
|
-
}
|
103
|
-
end
|
104
|
-
end
|
105
|
-
|
106
|
-
if options['time_delta'] != nil and options['time_delta'] != ''
|
107
|
-
if options['filters'] != nil
|
108
|
-
body = {
|
109
|
-
:time_delta => options['time_delta'],
|
110
|
-
:output_filters => options['filters'],
|
111
|
-
:history => _history,
|
59
|
+
if filters != nil
|
60
|
+
body = {
|
61
|
+
:output_filters => filters,
|
112
62
|
:api_key => api_key,
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
:history => _history,
|
63
|
+
:domain => domain,
|
64
|
+
}
|
65
|
+
else
|
66
|
+
body = {
|
118
67
|
:api_key => api_key,
|
119
|
-
|
120
|
-
|
68
|
+
:domain => domain,
|
69
|
+
}
|
121
70
|
end
|
122
71
|
|
123
72
|
return do_post(body, URL_INTEL_DOMAIN)
|
@@ -299,5 +248,4 @@ class Intel
|
|
299
248
|
end
|
300
249
|
|
301
250
|
private :do_post
|
302
|
-
end
|
303
|
-
|
251
|
+
end
|
data/lib/deepviz/result.rb
CHANGED
File without changes
|
data/lib/deepviz/sandbox.rb
CHANGED
File without changes
|
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:
|
4
|
+
version: 2.0.0
|
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-
|
11
|
+
date: 2016-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: '1.13'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: '1.13'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '11.3'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '11.3'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: unirest
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
81
81
|
version: '0'
|
82
82
|
requirements: []
|
83
83
|
rubyforge_project:
|
84
|
-
rubygems_version: 2.
|
84
|
+
rubygems_version: 2.5.1
|
85
85
|
signing_key:
|
86
86
|
specification_version: 4
|
87
87
|
summary: ruby-deepviz is a Ruby wrapper for deepviz.com REST APIs
|