virustotal_api 0.5.2 → 0.5.6
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/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- data/.github/pull_request_template.md +11 -0
- data/.github/workflows/ruby.yml +42 -3
- data/CHANGELOG.md +19 -0
- data/README.md +15 -3
- data/lib/virustotal_api/analysis.rb +0 -8
- data/lib/virustotal_api/base.rb +18 -6
- data/lib/virustotal_api/domain.rb +0 -6
- data/lib/virustotal_api/file.rb +20 -9
- data/lib/virustotal_api/group.rb +0 -8
- data/lib/virustotal_api/ip.rb +0 -6
- data/lib/virustotal_api/url.rb +0 -8
- data/lib/virustotal_api/user.rb +0 -8
- data/lib/virustotal_api/version.rb +1 -1
- data/test/analysis_test.rb +4 -1
- data/test/base_test.rb +16 -0
- data/test/domain_test.rb +3 -8
- data/test/file_test.rb +31 -29
- data/test/fixtures/domain_bad_request.yml +52 -0
- data/test/fixtures/file_upload.yml +1 -1
- data/test/fixtures/large_file_upload.yml +99 -0
- data/test/fixtures/url_encoding_find.yml +651 -0
- data/test/group_test.rb +2 -7
- data/test/ip_test.rb +2 -0
- data/test/url_test.rb +7 -25
- data/test/user_test.rb +2 -7
- metadata +11 -3
- data/.github/ISSUE_TEMPLATE.md +0 -15
data/test/ip_test.rb
CHANGED
@@ -19,6 +19,8 @@ class VirustotalAPIIPReportTest < Minitest::Test
|
|
19
19
|
# Make sure that the JSON was parsed
|
20
20
|
assert vtip_report.is_a?(VirustotalAPI::IP)
|
21
21
|
assert vtip_report.report.is_a?(Hash)
|
22
|
+
assert vtip_report.id.is_a?(String)
|
23
|
+
assert vtip_report.report_url.is_a?(String)
|
22
24
|
end
|
23
25
|
end
|
24
26
|
end
|
data/test/url_test.rb
CHANGED
@@ -18,24 +18,11 @@ class VirustotalAPIURLReportTest < Minitest::Test
|
|
18
18
|
vturl_report = VirustotalAPI::URL.find(@url, @api_key)
|
19
19
|
|
20
20
|
# Make sure that the JSON was parsed
|
21
|
+
assert vturl_report.exists?
|
21
22
|
assert vturl_report.is_a?(VirustotalAPI::URL)
|
22
23
|
assert vturl_report.report.is_a?(Hash)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
def test_find
|
27
|
-
VCR.use_cassette('url_find') do
|
28
|
-
vturl_report = VirustotalAPI::URL.find(@url, @api_key)
|
29
|
-
|
30
|
-
assert vturl_report.report_url.is_a?(String)
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
def test_scan_url
|
35
|
-
VCR.use_cassette('url_find') do
|
36
|
-
vturl_report = VirustotalAPI::URL.find(@url, @api_key)
|
37
|
-
|
38
24
|
assert vturl_report.id.is_a?(String)
|
25
|
+
assert vturl_report.report_url.is_a?(String)
|
39
26
|
end
|
40
27
|
end
|
41
28
|
|
@@ -43,23 +30,18 @@ class VirustotalAPIURLReportTest < Minitest::Test
|
|
43
30
|
VCR.use_cassette('unscanned_url_find') do
|
44
31
|
vturl_report = VirustotalAPI::URL.find(@unscanned_url, @api_key)
|
45
32
|
|
33
|
+
assert !vturl_report.exists?
|
46
34
|
assert_empty vturl_report.report
|
47
35
|
end
|
48
36
|
end
|
49
37
|
|
50
38
|
def test_analyse
|
51
39
|
VCR.use_cassette('url_analyse') do
|
52
|
-
|
53
|
-
|
54
|
-
assert vturl_scan.report.is_a?(Hash)
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
def test_analyse_id
|
59
|
-
VCR.use_cassette('url_analyse') do
|
60
|
-
vturl_scan = VirustotalAPI::URL.analyse(@url, @api_key)
|
40
|
+
vturl_analyse = VirustotalAPI::URL.analyse(@url, @api_key)
|
61
41
|
|
62
|
-
assert
|
42
|
+
assert vturl_analyse.exists?
|
43
|
+
assert vturl_analyse.report.is_a?(Hash)
|
44
|
+
assert vturl_analyse.id.is_a?(String)
|
63
45
|
end
|
64
46
|
end
|
65
47
|
end
|
data/test/user_test.rb
CHANGED
@@ -16,15 +16,10 @@ class VirustotalAPIUserReportTest < Minitest::Test
|
|
16
16
|
vtuser_report = VirustotalAPI::User.find(@api_key, @api_key)
|
17
17
|
|
18
18
|
# Make sure that the JSON was parsed
|
19
|
+
assert vtuser_report.exists?
|
19
20
|
assert vtuser_report.is_a?(VirustotalAPI::User)
|
20
21
|
assert vtuser_report.report.is_a?(Hash)
|
21
|
-
|
22
|
-
end
|
23
|
-
|
24
|
-
def test_find
|
25
|
-
VCR.use_cassette('user_find') do
|
26
|
-
vtuser_report = VirustotalAPI::User.find(@api_key, @api_key)
|
27
|
-
|
22
|
+
assert vtuser_report.id.is_a?(String)
|
28
23
|
assert vtuser_report.report_url.is_a?(String)
|
29
24
|
end
|
30
25
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: virustotal_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pwelch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -183,7 +183,9 @@ extra_rdoc_files: []
|
|
183
183
|
files:
|
184
184
|
- ".github/CODE_OF_CONDUCT.md"
|
185
185
|
- ".github/CONTRIBUTING.md"
|
186
|
-
- ".github/ISSUE_TEMPLATE.md"
|
186
|
+
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
187
|
+
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
188
|
+
- ".github/pull_request_template.md"
|
187
189
|
- ".github/workflows/ruby.yml"
|
188
190
|
- ".gitignore"
|
189
191
|
- ".rubocop.yml"
|
@@ -211,6 +213,7 @@ files:
|
|
211
213
|
- test/file_test.rb
|
212
214
|
- test/fixtures/analysis.yml
|
213
215
|
- test/fixtures/domain.yml
|
216
|
+
- test/fixtures/domain_bad_request.yml
|
214
217
|
- test/fixtures/file_analyse.yml
|
215
218
|
- test/fixtures/file_find.yml
|
216
219
|
- test/fixtures/file_not_found.yml
|
@@ -219,9 +222,11 @@ files:
|
|
219
222
|
- test/fixtures/file_upload.yml
|
220
223
|
- test/fixtures/group_find.yml
|
221
224
|
- test/fixtures/ip.yml
|
225
|
+
- test/fixtures/large_file_upload.yml
|
222
226
|
- test/fixtures/null_file
|
223
227
|
- test/fixtures/unscanned_url_find.yml
|
224
228
|
- test/fixtures/url_analyse.yml
|
229
|
+
- test/fixtures/url_encoding_find.yml
|
225
230
|
- test/fixtures/url_find.yml
|
226
231
|
- test/fixtures/user_find.yml
|
227
232
|
- test/group_test.rb
|
@@ -263,6 +268,7 @@ test_files:
|
|
263
268
|
- test/file_test.rb
|
264
269
|
- test/fixtures/analysis.yml
|
265
270
|
- test/fixtures/domain.yml
|
271
|
+
- test/fixtures/domain_bad_request.yml
|
266
272
|
- test/fixtures/file_analyse.yml
|
267
273
|
- test/fixtures/file_find.yml
|
268
274
|
- test/fixtures/file_not_found.yml
|
@@ -271,9 +277,11 @@ test_files:
|
|
271
277
|
- test/fixtures/file_upload.yml
|
272
278
|
- test/fixtures/group_find.yml
|
273
279
|
- test/fixtures/ip.yml
|
280
|
+
- test/fixtures/large_file_upload.yml
|
274
281
|
- test/fixtures/null_file
|
275
282
|
- test/fixtures/unscanned_url_find.yml
|
276
283
|
- test/fixtures/url_analyse.yml
|
284
|
+
- test/fixtures/url_encoding_find.yml
|
277
285
|
- test/fixtures/url_find.yml
|
278
286
|
- test/fixtures/user_find.yml
|
279
287
|
- test/group_test.rb
|