async-dns 1.3.0 → 1.4.0

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.
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.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
- autorequire:
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
- MIIEhDCCAuygAwIBAgIBATANBgkqhkiG9w0BAQsFADA3MTUwMwYDVQQDDCxzYW11
14
- ZWwud2lsbGlhbXMvREM9b3Jpb250cmFuc2Zlci9EQz1jby9EQz1uejAeFw0yMTA4
15
- MTYwNjMzNDRaFw0yMjA4MTYwNjMzNDRaMDcxNTAzBgNVBAMMLHNhbXVlbC53aWxs
16
- aWFtcy9EQz1vcmlvbnRyYW5zZmVyL0RDPWNvL0RDPW56MIIBojANBgkqhkiG9w0B
17
- AQEFAAOCAY8AMIIBigKCAYEAyXLSS/cw+fXJ5e7hi+U/TeChPWeYdwJojDsFY1xr
18
- xvtqbTTL8gbLHz5LW3QD2nfwCv3qTlw0qI3Ie7a9VMJMbSvgVEGEfQirqIgJXWMj
19
- eNMDgKsMJtC7u/43abRKx7TCURW3iWyR19NRngsJJmaR51yGGGm2Kfsr+JtKKLtL
20
- L188Wm3f13KAx7QJU8qyuBnj1/gWem076hzdA7xi1DbrZrch9GCRz62xymJlrJHn
21
- 9iZEZ7AxrS7vokhMlzSr/XMUihx/8aFKtk+tMLClqxZSmBWIErWdicCGTULXCBNb
22
- E/mljo4zEVKhlTWpJklMIhr55ZRrSarKFuW7en0+tpJrfsYiAmXMJNi4XAYJH7uL
23
- rgJuJwSaa/dMz+VmUoo7VKtSfCoOI+6v5/z0sK3oT6sG6ZwyI47DBq2XqNC6tnAj
24
- w+XmCywiTQrFzMMAvcA7rPI4F0nU1rZId51rOvvfxaONp+wgTi4P8owZLw0/j0m4
25
- 8C20DYi6EYx4AHDXiLpElWh3AgMBAAGjgZowgZcwCQYDVR0TBAIwADALBgNVHQ8E
26
- BAMCBLAwHQYDVR0OBBYEFB6ZaeWKxQjGTI+pmz7cKRmMIywwMC4GA1UdEQ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mQ32EDjqR1TixS1+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: 2021-09-20 00:00:00.000000000 Z
47
+ date: 2025-02-15 00:00:00.000000000 Z
40
48
  dependencies:
41
49
  - !ruby/object:Gem::Dependency
42
- name: async-io
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: :development
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
- post_install_message:
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: '0'
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.1.6
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
@@ -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
@@ -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