securitytrails 0.1.0 → 0.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
  SHA256:
3
- metadata.gz: 261c6c00d23d6df4749ada457317fadaeb83fc1bbea5aba1fc1e028f1ec6ea03
4
- data.tar.gz: 44f57b73d27c6eba24cf25494d210ffd1245223abc1575a33b13f11a0bfd2f5b
3
+ metadata.gz: 8c78dce6d2a5f9f147f573a36a86d2cec52e2248b414233a1a59d6f9ab90ece5
4
+ data.tar.gz: dc09510aa36bf18d4c5bf16988af4faa5cc7b6e025c5b0108fe21a371077c959
5
5
  SHA512:
6
- metadata.gz: 5134e81d04585fcba97b0453e10cfeaa31d10443ae97878b8e1f6ef0e19db77c7b7527bc11938c3fd6747648a2e14e43a8ae383bedb6ee318cf4610684224af5
7
- data.tar.gz: 7b9e4405bc2d2412db7d66dcfb07680df402ebd52f4223ddbb279224b027f311c5ab018e45e732cf1c8a707aa478a47bdd2279dc94d60a9e18795d51217ca7d2
6
+ metadata.gz: 935e6ae2b707285d1d7109dabda2c3d17d313b696e98e76026a05dea1713867ba7be8a7d4734f5a3a8560aef96803c055edf63a4135d2081b9bc7e3660c401a0
7
+ data.tar.gz: 38044581872fab115d9612079fd4cdfb60bbfc9493ecab24d66030e1b96c17402d05c30b3fdd41dcc4cddf4f63417baa1b975e0ac057d73f43cd62cec21c84dd
data/.gitignore CHANGED
@@ -48,3 +48,5 @@ Gemfile.lock
48
48
 
49
49
  # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
50
50
  .rvmrc
51
+
52
+ .rspec_status
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "json"
3
4
  require "net/https"
4
5
 
5
6
  module SecurityTrails
@@ -4,6 +4,8 @@ module SecurityTrails
4
4
  module Clients
5
5
  class History < Client
6
6
  def get_dns_history(hostname, type, page = 1)
7
+ raise ArgumentError, "The API currently supports a, aaaa, mx, ns, soa and txt records." unless valid_type?(type)
8
+
7
9
  get("/history/#{hostname}/dns/#{type.downcase}", page: page) { |json| json }
8
10
  end
9
11
 
@@ -26,6 +28,12 @@ module SecurityTrails
26
28
  def get_whois_history(hostname)
27
29
  get("/history/#{hostname}/whois/") { |json| json }
28
30
  end
31
+
32
+ private
33
+
34
+ def valid_type?(type)
35
+ ["a", "aaaa", "mx", "ns", "soa", "txt"].include? type.downcase
36
+ end
29
37
  end
30
38
  end
31
39
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SecurityTrails
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
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.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manabu Niseki
@@ -117,7 +117,6 @@ extra_rdoc_files: []
117
117
  files:
118
118
  - ".gitignore"
119
119
  - ".rspec"
120
- - ".rspec_status"
121
120
  - ".travis.yml"
122
121
  - Gemfile
123
122
  - LICENSE
@@ -1,16 +0,0 @@
1
- example_id | status | run_time |
2
- ------------------------------------- | ------ | --------------- |
3
- ./spec/clients/domain_spec.rb[1:1:1] | passed | 0.00564 seconds |
4
- ./spec/clients/domain_spec.rb[1:2:1] | passed | 0.00746 seconds |
5
- ./spec/clients/domain_spec.rb[1:3:1] | passed | 0.00589 seconds |
6
- ./spec/clients/domain_spec.rb[1:4:1] | passed | 0.00717 seconds |
7
- ./spec/clients/domain_spec.rb[1:5:1] | passed | 0.00577 seconds |
8
- ./spec/clients/domains_spec.rb[1:1:1] | passed | 0.00811 seconds |
9
- ./spec/clients/domains_spec.rb[1:2:1] | passed | 0.00705 seconds |
10
- ./spec/clients/history_spec.rb[1:1:1] | passed | 0.00653 seconds |
11
- ./spec/clients/history_spec.rb[1:2:1] | passed | 0.04772 seconds |
12
- ./spec/clients/history_spec.rb[1:3:1] | passed | 0.00545 seconds |
13
- ./spec/clients/ips_spec.rb[1:1:1] | passed | 0.00531 seconds |
14
- ./spec/clients/ips_spec.rb[1:2:1] | passed | 0.00507 seconds |
15
- ./spec/clients/ips_spec.rb[1:3:1] | passed | 0.00484 seconds |
16
- ./spec/securitytrails_spec.rb[1:1] | passed | 0.00085 seconds |