async-dns 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/async/dns/cache.rb +69 -0
- data/lib/async/dns/chunked.rb +4 -19
- data/lib/async/dns/endpoint.rb +23 -0
- data/lib/async/dns/extensions/resolv.rb +22 -82
- data/lib/async/dns/extensions/string.rb +6 -20
- data/lib/async/dns/handler.rb +72 -54
- data/lib/async/dns/resolver.rb +151 -137
- data/lib/async/dns/server.rb +62 -69
- data/lib/async/dns/system.rb +147 -80
- data/lib/async/dns/transaction.rb +30 -37
- data/lib/async/dns/transport.rb +27 -39
- data/lib/async/dns/version.rb +6 -20
- data/lib/async/dns.rb +11 -27
- data/license.md +29 -0
- data/readme.md +53 -0
- data/releases.md +21 -0
- data.tar.gz.sig +0 -0
- metadata +49 -137
- metadata.gz.sig +0 -0
- data/lib/async/dns/message.rb +0 -53
- data/lib/async/dns/replace.rb +0 -54
data/releases.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# Releases
|
2
|
+
|
3
|
+
## v1.4.0
|
4
|
+
|
5
|
+
- Minimum Ruby version is now v3.1.
|
6
|
+
- Drop dependency on `Async::IO` and refactor internal network code to use `IO::Endpoint` and `Socket` directly.
|
7
|
+
- Introduce `Async::DNS::Endpoint` for getting the default endpoint for a given name server.
|
8
|
+
- Remove old hacks for IPv6 on Ruby v2.3.
|
9
|
+
- Introduce `Async::DNS::Cache` for caching DNS lookups.
|
10
|
+
- Remove `logger` as an option and instance variable in favour of using `Console.logger` directly. This is a breaking change.
|
11
|
+
- Update error logging to include more details.
|
12
|
+
- Use keyword arguments `**options` where possible. This is a breaking change.
|
13
|
+
- `Async::DNS::StreamHandler` and `Async::DNS::DatagramHandler` have been refactored to use `IO::Endpoint` and have minor breaking interface changes.
|
14
|
+
- `Async::DNS::Resolver.default` should be used to get a default resolver instance.
|
15
|
+
- The resolver now supports `ndots:` when resolving names.
|
16
|
+
- `Async::DNS::Resolver#fully_qualified_name` is replaced by `Async::DNS::Resolver#fully_qualified_names` and can yield multiple names.
|
17
|
+
- If the host system supports IPv6, the resolver will also try to resolve IPv6 addresses.
|
18
|
+
- `Async::DNS::Server::DEFAULT_ENDPOINTS` is removed and replaced by `Async::DNS::Server.default_endpoint(port = 53)`.
|
19
|
+
- `Async::DNS::Server#fire` is removed with no replacement.
|
20
|
+
- The default `Async::DNS::Server#process` fails with `NXDomain` instead of `NotImplementedError`.
|
21
|
+
- `Async::DNS::System` implementation is updated to support IPv6 and `resolv.conf` options.
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,179 +1,92 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: async-dns
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
|
-
|
8
|
+
- Tony Arcieri
|
9
|
+
- Olle Jonsson
|
10
|
+
- Greg Thornton
|
11
|
+
- Hal Brodigan
|
12
|
+
- Hendrik Beskow
|
13
|
+
- Mike Perham
|
14
|
+
- Sean Dilda
|
15
|
+
- Stefan Wrobel
|
9
16
|
bindir: bin
|
10
17
|
cert_chain:
|
11
18
|
- |
|
12
19
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
20
|
+
MIIE2DCCA0CgAwIBAgIBATANBgkqhkiG9w0BAQsFADBhMRgwFgYDVQQDDA9zYW11
|
21
|
+
ZWwud2lsbGlhbXMxHTAbBgoJkiaJk/IsZAEZFg1vcmlvbnRyYW5zZmVyMR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yLmNvLm56MC4GA1UdEgQnMCWBI3NhbXVlbC53aWxs
|
37
|
+
aWFtc0BvcmlvbnRyYW5zZmVyLmNvLm56MA0GCSqGSIb3DQEBCwUAA4IBgQB5sxkE
|
38
|
+
cBsSYwK6fYpM+hA5B5yZY2+L0Z+27jF1pWGgbhPH8/FjjBLVn+VFok3CDpRqwXCl
|
39
|
+
xCO40JEkKdznNy2avOMra6PFiQyOE74kCtv7P+Fdc+FhgqI5lMon6tt9rNeXmnW/
|
40
|
+
c1NaMRdxy999hmRGzUSFjozcCwxpy/LwabxtdXwXgSay4mQ32EDjqR1TixS1+smp
|
41
|
+
8C/NCWgpIfzpHGJsjvmH2wAfKtTTqB9CVKLCWEnCHyCaRVuKkrKjqhYCdmMBqCws
|
42
|
+
JkxfQWC+jBVeG9ZtPhQgZpfhvh+6hMhraUYRQ6XGyvBqEUe+yo6DKIT3MtGE2+CP
|
43
|
+
eX9i9ZWBydWb8/rvmwmX2kkcBbX0hZS1rcR593hGc61JR6lvkGYQ2MYskBveyaxt
|
44
|
+
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
45
|
+
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
38
46
|
-----END CERTIFICATE-----
|
39
|
-
date:
|
47
|
+
date: 2025-02-15 00:00:00.000000000 Z
|
40
48
|
dependencies:
|
41
49
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '1.15'
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '1.15'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: async-rspec
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '1.0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '1.0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: bundler
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: covered
|
50
|
+
name: io-endpoint
|
85
51
|
requirement: !ruby/object:Gem::Requirement
|
86
52
|
requirements:
|
87
53
|
- - ">="
|
88
54
|
- !ruby/object:Gem::Version
|
89
55
|
version: '0'
|
90
|
-
type: :
|
56
|
+
type: :runtime
|
91
57
|
prerelease: false
|
92
58
|
version_requirements: !ruby/object:Gem::Requirement
|
93
59
|
requirements:
|
94
60
|
- - ">="
|
95
61
|
- !ruby/object:Gem::Version
|
96
62
|
version: '0'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: process-daemon
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - "~>"
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '1.0'
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - "~>"
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '1.0'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: rspec
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - "~>"
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '3.0'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - "~>"
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '3.0'
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: rspec-files
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - "~>"
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: '1.0'
|
132
|
-
type: :development
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - "~>"
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: '1.0'
|
139
|
-
- !ruby/object:Gem::Dependency
|
140
|
-
name: rspec-memory
|
141
|
-
requirement: !ruby/object:Gem::Requirement
|
142
|
-
requirements:
|
143
|
-
- - "~>"
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
version: '1.0'
|
146
|
-
type: :development
|
147
|
-
prerelease: false
|
148
|
-
version_requirements: !ruby/object:Gem::Requirement
|
149
|
-
requirements:
|
150
|
-
- - "~>"
|
151
|
-
- !ruby/object:Gem::Version
|
152
|
-
version: '1.0'
|
153
|
-
description:
|
154
|
-
email:
|
155
63
|
executables: []
|
156
64
|
extensions: []
|
157
65
|
extra_rdoc_files: []
|
158
66
|
files:
|
159
67
|
- lib/async/dns.rb
|
68
|
+
- lib/async/dns/cache.rb
|
160
69
|
- lib/async/dns/chunked.rb
|
70
|
+
- lib/async/dns/endpoint.rb
|
161
71
|
- lib/async/dns/extensions/resolv.rb
|
162
72
|
- lib/async/dns/extensions/string.rb
|
163
73
|
- lib/async/dns/handler.rb
|
164
|
-
- lib/async/dns/message.rb
|
165
|
-
- lib/async/dns/replace.rb
|
166
74
|
- lib/async/dns/resolver.rb
|
167
75
|
- lib/async/dns/server.rb
|
168
76
|
- lib/async/dns/system.rb
|
169
77
|
- lib/async/dns/transaction.rb
|
170
78
|
- lib/async/dns/transport.rb
|
171
79
|
- lib/async/dns/version.rb
|
80
|
+
- license.md
|
81
|
+
- readme.md
|
82
|
+
- releases.md
|
172
83
|
homepage: https://github.com/socketry/async-dns
|
173
84
|
licenses:
|
174
85
|
- MIT
|
175
|
-
metadata:
|
176
|
-
|
86
|
+
metadata:
|
87
|
+
documentation_uri: https://socketry.github.io/async-dns/
|
88
|
+
funding_uri: https://github.com/sponsors/ioquatix/
|
89
|
+
source_code_uri: https://github.com/socketry/async-dns.git
|
177
90
|
rdoc_options: []
|
178
91
|
require_paths:
|
179
92
|
- lib
|
@@ -181,15 +94,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
181
94
|
requirements:
|
182
95
|
- - ">="
|
183
96
|
- !ruby/object:Gem::Version
|
184
|
-
version: '
|
97
|
+
version: '3.1'
|
185
98
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
186
99
|
requirements:
|
187
100
|
- - ">="
|
188
101
|
- !ruby/object:Gem::Version
|
189
102
|
version: '0'
|
190
103
|
requirements: []
|
191
|
-
rubygems_version: 3.
|
192
|
-
signing_key:
|
104
|
+
rubygems_version: 3.6.2
|
193
105
|
specification_version: 4
|
194
106
|
summary: An easy to use DNS client resolver and server for Ruby.
|
195
107
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|
data/lib/async/dns/message.rb
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
# Copyright, 2009, 2012, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
2
|
-
#
|
3
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
-
# of this software and associated documentation files (the "Software"), to deal
|
5
|
-
# in the Software without restriction, including without limitation the rights
|
6
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
-
# copies of the Software, and to permit persons to whom the Software is
|
8
|
-
# furnished to do so, subject to the following conditions:
|
9
|
-
#
|
10
|
-
# The above copyright notice and this permission notice shall be included in
|
11
|
-
# all copies or substantial portions of the Software.
|
12
|
-
#
|
13
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
-
# THE SOFTWARE.
|
20
|
-
|
21
|
-
require 'stringio'
|
22
|
-
require 'resolv'
|
23
|
-
|
24
|
-
require 'base64'
|
25
|
-
|
26
|
-
require_relative 'extensions/resolv'
|
27
|
-
|
28
|
-
module Async::DNS
|
29
|
-
UDP_TRUNCATION_SIZE = 512
|
30
|
-
|
31
|
-
# The DNS message container.
|
32
|
-
Message = ::Resolv::DNS::Message
|
33
|
-
DecodeError = ::Resolv::DNS::DecodeError
|
34
|
-
|
35
|
-
# Decodes binary data into a {Message}.
|
36
|
-
def self.decode_message(data)
|
37
|
-
# Otherwise the decode process might fail with non-binary data.
|
38
|
-
if data.respond_to? :force_encoding
|
39
|
-
data.force_encoding("BINARY")
|
40
|
-
end
|
41
|
-
|
42
|
-
begin
|
43
|
-
return Message.decode(data)
|
44
|
-
rescue DecodeError
|
45
|
-
raise
|
46
|
-
rescue StandardError => error
|
47
|
-
new_error = DecodeError.new(error.message)
|
48
|
-
new_error.set_backtrace(error.backtrace)
|
49
|
-
|
50
|
-
raise new_error
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
data/lib/async/dns/replace.rb
DELETED
@@ -1,54 +0,0 @@
|
|
1
|
-
# Copyright, 2015, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
2
|
-
#
|
3
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
-
# of this software and associated documentation files (the "Software"), to deal
|
5
|
-
# in the Software without restriction, including without limitation the rights
|
6
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
-
# copies of the Software, and to permit persons to whom the Software is
|
8
|
-
# furnished to do so, subject to the following conditions:
|
9
|
-
#
|
10
|
-
# The above copyright notice and this permission notice shall be included in
|
11
|
-
# all copies or substantial portions of the Software.
|
12
|
-
#
|
13
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
-
# THE SOFTWARE.
|
20
|
-
|
21
|
-
require 'resolv'
|
22
|
-
require 'resolv-replace'
|
23
|
-
|
24
|
-
module Async::DNS
|
25
|
-
module Replace
|
26
|
-
class << self
|
27
|
-
attr_accessor :resolver
|
28
|
-
|
29
|
-
def resolver?
|
30
|
-
resolver != nil
|
31
|
-
end
|
32
|
-
|
33
|
-
def get_address(host)
|
34
|
-
begin
|
35
|
-
resolver.addresses_for(host).sample.to_s
|
36
|
-
rescue ResolutionFailure
|
37
|
-
raise SocketError, "Hostname not known: #{host}"
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
class << IPSocket
|
44
|
-
@@resolver = nil
|
45
|
-
|
46
|
-
def getaddress(host)
|
47
|
-
if Replace.resolver?
|
48
|
-
Replace.get_address(host)
|
49
|
-
else
|
50
|
-
original_resolv_getaddress(host)
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|