passivedns-client 2.1.8 → 2.1.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 68eeb76b624cb5975014a539228b3eb4dad48588611821ed7861302e0ffe1de5
4
- data.tar.gz: 2ecfa66e3b572ce903be77ea6c60f023098dcfedfc38c3b865841d8a2cf5a0ce
2
+ SHA1:
3
+ metadata.gz: 2b6b0dc4227f010b9fc53b01f2307f49b405db80
4
+ data.tar.gz: 1e3b0abb99ceddee325ee4245f9924500127089d
5
5
  SHA512:
6
- metadata.gz: 654af7875209a8ef73cbbbb9502f12d08c27a03985fd3aca0a686fb09fb3db4fefa83b0011fdc2370564f651570ecd303bfe6f53391186d07bc946b6c3f4acd2
7
- data.tar.gz: 5b9b8195c072651b8dcdc8dd2eb809fd3a5efda714aee5f03ed675ae5f81b014eb5dd5e84bd193f4acbc79b278afa2961eae7b41c6c40bc78cf788630ecc9cde
6
+ metadata.gz: d638e8dba5e9af5476c626dca055925c702bd41c3b836ba876d914d8d2e609a9ed042983da8987b0d1ae7af41316c1ad5d3a4f559f5db2bf694a96d2bae06547
7
+ data.tar.gz: 22b0c684739e932b646f2bd7a508f9e8a53c4c2ff8ba69c5623f36a51d7d4931f83d317dcc2fbab9df3b8944f84101c854596c32a6c07486adaaad445404c028
@@ -12,7 +12,9 @@ provider_path = File.dirname(__FILE__)+"/client/provider/*.rb"
12
12
  Dir.glob(provider_path).each do |provider|
13
13
  name = File.basename(provider, '.rb')
14
14
  require "passivedns/client/provider/#{name}.rb"
15
- $passivedns_providers << name
15
+ if name != 'bfk'
16
+ $passivedns_providers << name
17
+ end
16
18
  end
17
19
 
18
20
  require 'configparser'
@@ -58,7 +58,8 @@ module PassiveDNS # :nodoc:
58
58
  [ '--sqlite3', '-f', GetoptLong::REQUIRED_ARGUMENT ],
59
59
  [ '--recurse', '-r', GetoptLong::REQUIRED_ARGUMENT ],
60
60
  [ '--wait', '-w', GetoptLong::REQUIRED_ARGUMENT ],
61
- [ '--limit', '-l', GetoptLong::REQUIRED_ARGUMENT ]
61
+ [ '--limit', '-l', GetoptLong::REQUIRED_ARGUMENT ],
62
+ [ '--config', GetoptLong::REQUIRED_ARGUMENT ]
62
63
  )
63
64
 
64
65
  letter_map = get_letter_map
@@ -121,6 +122,8 @@ module PassiveDNS # :nodoc:
121
122
  options[:sqlitedb] = arg
122
123
  when '--limit'
123
124
  options[:limit] = arg.to_i
125
+ when '--config'
126
+ options[:configfile] = arg
124
127
  else
125
128
  options[:help] = true
126
129
  end
@@ -158,7 +161,7 @@ module PassiveDNS # :nodoc:
158
161
  def self.usage(letter_map)
159
162
  databases = letter_map.keys.sort.join("")
160
163
  help_text = ""
161
- help_text << "Usage: #{$0} [-d [#{databases}]] [-g|-v|-m|-c|-x|-y|-j|-t] [-os <sep>] [-f <file>] [-r#|-w#|-v] [-l <count>] <ip|domain|cidr>\n"
164
+ help_text << "Usage: #{$0} [-d [#{databases}]] [-g|-v|-m|-c|-x|-y|-j|-t] [-os <sep>] [-f <file>] [-r#|-w#|-v] [-l <count>] [--config <file>] <ip|domain|cidr>\n"
162
165
  help_text << "Passive DNS Providers\n"
163
166
  help_text << " -d#{databases} uses all of the available passive dns database\n"
164
167
  letter_map.keys.sort.each do |l|
@@ -264,7 +267,7 @@ module PassiveDNS # :nodoc:
264
267
  state = create_state(options[:sqlitedb])
265
268
  state.debug = options[:debug]
266
269
 
267
- pdnsclient = PassiveDNS::Client.new(options[:pdnsdbs])
270
+ pdnsclient = PassiveDNS::Client.new(options[:pdnsdbs], options[:configfile])
268
271
  pdnsclient.debug = options[:debug]
269
272
 
270
273
  if items.length > 0
@@ -37,6 +37,7 @@ module PassiveDNS #:nodoc: don't document this
37
37
  def initialize(options={})
38
38
  @debug = options[:debug] || false
39
39
  @base = options["URL"] || "http://www.bfk.de/bfk_dnslogger.html?query="
40
+ raise "Due to the EU GDPR policy, this service has been shut down until further notice."
40
41
  end
41
42
 
42
43
  # Takes a label (either a domain or an IP address) and returns
@@ -2,6 +2,6 @@ module PassiveDNS # :nodoc:
2
2
  # coodinates the lookups accross all configured PassiveDNS providers
3
3
  class Client
4
4
  # version of PassiveDNS::Client
5
- VERSION = "2.1.8"
5
+ VERSION = "2.1.9"
6
6
  end
7
7
  end
data/test/test_cli.rb CHANGED
@@ -20,7 +20,7 @@ class TestCLI < Minitest::Test
20
20
  helptext = PassiveDNS::CLI.run(["--help"])
21
21
  helptext.gsub!(/Usage: .*?\[/, "Usage: [")
22
22
  assert_equal(
23
- "Usage: [-d [3bcdmprtv]] [-g|-v|-m|-c|-x|-y|-j|-t] [-os <sep>] [-f <file>] [-r#|-w#|-v] [-l <count>] <ip|domain|cidr>
23
+ "Usage: [-d [3bcdmprtv]] [-g|-v|-m|-c|-x|-y|-j|-t] [-os <sep>] [-f <file>] [-r#|-w#|-v] [-l <count>] [--config <file>] <ip|domain|cidr>
24
24
  Passive DNS Providers
25
25
  -d3bcdmprtv uses all of the available passive dns database
26
26
  -d3 use 360.cn
@@ -202,4 +202,26 @@ Getting Help
202
202
  assert_equal(options_target, options)
203
203
  assert_equal(["8.8.8.8"], items)
204
204
  end
205
+
206
+ def test_configuration_file
207
+ options_target = {
208
+ :pdnsdbs => ["bfk"],
209
+ :format => "text",
210
+ :sep => "\t",
211
+ :recursedepth => 1,
212
+ :wait => 0,
213
+ :res => nil,
214
+ :debug => false,
215
+ :sqlitedb => nil,
216
+ :limit => nil,
217
+ :help => false,
218
+ :configfile => ".passivedns-client"
219
+ }
220
+
221
+
222
+ options, items = PassiveDNS::CLI.parse_command_line(["--config", ".passivedns-client"])
223
+ assert_equal(options_target, options)
224
+ assert_equal([], items)
225
+
226
+ end
205
227
  end
@@ -47,22 +47,28 @@ class TestPassiveDnsQuery < Minitest::Test
47
47
  end
48
48
 
49
49
  def test_BFK
50
- PassiveDNS::Client.new(['bfk'])
51
- d = PassiveDNS::Provider::BFK.new(@cp['bfk'] || {})
52
- refute_nil(d)
53
- rows = d.lookup("example.org",3)
54
- refute_nil(rows)
55
- refute_nil(rows.to_s)
56
- refute_nil(rows.to_xml)
57
- refute_nil(rows.to_json)
58
- refute_nil(rows.to_yaml)
59
- assert_equal(3, rows.length)
60
- rows = d.lookup("8.8.8.8")
61
- refute_nil(rows)
62
- refute_nil(rows.to_s)
63
- refute_nil(rows.to_xml)
64
- refute_nil(rows.to_json)
65
- refute_nil(rows.to_yaml)
50
+ assert_raises RuntimeError do
51
+ PassiveDNS::Client.new(['bfk'])
52
+ end
53
+
54
+ assert_raises RuntimeError do
55
+ d = PassiveDNS::Provider::BFK.new(@cp['bfk'] || {})
56
+ end
57
+
58
+ # refute_nil(d)
59
+ # rows = d.lookup("example.org",3)
60
+ # refute_nil(rows)
61
+ # refute_nil(rows.to_s)
62
+ # refute_nil(rows.to_xml)
63
+ # refute_nil(rows.to_json)
64
+ # refute_nil(rows.to_yaml)
65
+ # assert_equal(3, rows.length)
66
+ # rows = d.lookup("8.8.8.8")
67
+ # refute_nil(rows)
68
+ # refute_nil(rows.to_s)
69
+ # refute_nil(rows.to_xml)
70
+ # refute_nil(rows.to_json)
71
+ # refute_nil(rows.to_yaml)
66
72
  end
67
73
 
68
74
  def test_DNSDB
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: passivedns-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.8
4
+ version: 2.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - chrislee35
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-09 00:00:00.000000000 Z
11
+ date: 2018-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -162,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
162
162
  version: '0'
163
163
  requirements: []
164
164
  rubyforge_project:
165
- rubygems_version: 2.7.5
165
+ rubygems_version: 2.4.6
166
166
  signing_key:
167
167
  specification_version: 4
168
168
  summary: Query passive DNS databases