securitytrails 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -2
- data/lib/securitytrails.rb +1 -0
- data/lib/securitytrails/client.rb +1 -1
- data/lib/securitytrails/response.rb +9 -0
- data/lib/securitytrails/version.rb +1 -1
- data/securitytrails.gemspec +2 -0
- metadata +16 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 283989ff3a2bf8ee9305be60810335216a2fa3211197093446a549feeea66f7e
|
4
|
+
data.tar.gz: 91db5d07036bcf5e1c0a43c41a7991ec1ba925db85c1c727d5c25f2d153e9129
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17e09e312bd2c1fa72ee72fbbd61852b48aa6809c538d1c4d148a0d16145887f91e0289337ec28386b15961285827b52154b7305d0811007f59d4b611591c07d
|
7
|
+
data.tar.gz: ad56eba45fb851f6a20fad5db9e54045bc73992f4f5437258f5624d510290d0818c9b9eb394ed7e757cefce6a3b2dd241b8005d9129c2e59fb9f248fdc8d5342
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# SecurityTrails
|
2
2
|
|
3
3
|
[![Build Status](https://travis-ci.org/ninoseki/securitytrails.svg?branch=master)](https://travis-ci.org/ninoseki/securitytrails)
|
4
|
-
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/
|
4
|
+
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/9637f5ed2b8943c28d9d61db778330fb)](https://www.codacy.com/app/ninoseki/securitytrails)
|
5
5
|
[![Coverage Status](https://coveralls.io/repos/github/ninoseki/securitytrails/badge.svg?branch=master)](https://coveralls.io/github/ninoseki/securitytrails?branch=master)
|
6
6
|
|
7
7
|
[SecurityTrails](https://securitytrails.com) API wrapper for Ruby.
|
@@ -66,9 +66,19 @@ api.ips.search("ptr_part = 'ns1'")
|
|
66
66
|
api.ips.stats("ptr_part = 'amazon.com'")
|
67
67
|
```
|
68
68
|
|
69
|
+
All the API response (JSON / Hash) is wrapped by [Hashie::Mash](https://github.com/intridea/hashie#mash).
|
70
|
+
|
71
|
+
It means you can access to a response through a property-like syntax.
|
72
|
+
|
73
|
+
```ruby
|
74
|
+
res = api.domain.get_by_hostname("github.com")
|
75
|
+
puts res.hostname # => "github.com"
|
76
|
+
puts res.current_dns.a.first_seen # => "2018-09-12"
|
77
|
+
```
|
78
|
+
|
69
79
|
## Contributing
|
70
80
|
|
71
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/securitytrails.
|
81
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/securitytrails.
|
72
82
|
|
73
83
|
## License
|
74
84
|
|
data/lib/securitytrails.rb
CHANGED
@@ -39,7 +39,7 @@ module SecurityTrails
|
|
39
39
|
Net::HTTP.start(HOST, 443, https_options) do |http|
|
40
40
|
response = http.request(req)
|
41
41
|
if response.code == '200'
|
42
|
-
yield JSON.parse(response.body)
|
42
|
+
yield Response.new(JSON.parse(response.body))
|
43
43
|
else
|
44
44
|
raise(Error, "unsupported response code returned: #{response.code}")
|
45
45
|
end
|
data/securitytrails.gemspec
CHANGED
@@ -24,6 +24,8 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
25
25
|
spec.require_paths = ["lib"]
|
26
26
|
|
27
|
+
spec.add_dependency "hashie", "~> 3.6"
|
28
|
+
|
27
29
|
spec.add_development_dependency "bundler", "~> 1.17"
|
28
30
|
spec.add_development_dependency "coveralls", "~> 0.8"
|
29
31
|
spec.add_development_dependency "dotenv", "~> 2.5"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: securitytrails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manabu Niseki
|
@@ -10,6 +10,20 @@ bindir: exe
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2018-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: hashie
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.6'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.6'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: bundler
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -132,6 +146,7 @@ files:
|
|
132
146
|
- lib/securitytrails/clients/domains.rb
|
133
147
|
- lib/securitytrails/clients/history.rb
|
134
148
|
- lib/securitytrails/clients/ips.rb
|
149
|
+
- lib/securitytrails/response.rb
|
135
150
|
- lib/securitytrails/version.rb
|
136
151
|
- securitytrails.gemspec
|
137
152
|
homepage: https://github.com/ninoseki/securitytrails
|