mailresolver 0.5.1 → 0.6.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 12a1881f2f511ee3179b481e2b0edfd43f79bfed4fdc9f7d96ce94a4fb511650
4
- data.tar.gz: a1f1aadf2ecfbe335cba1c5ddd33daeba467760ad7b0d1ec070905f9622d4120
3
+ metadata.gz: 694ac605361e95bb9ab69d00ea9e01ea3b06ca7d510f3bc8b4dfc776902abf4d
4
+ data.tar.gz: 38ba126c1aac2766dffe47b453371121896c3e0f262690d01c74a0c908266a75
5
5
  SHA512:
6
- metadata.gz: 9ee55c2b9fefb4afd0d576e7469804e9c969c653a4b285f1beb77b80efad56dbe77f12397568dba54c17bea7e37c20fa34326c988407fd3a4e3d7d8cc659a847
7
- data.tar.gz: 3a6ef2bbe9788425d1e65c8ac21364218eac4d67a0db34bdafc2918030bcf7f5557625410b9497a7095b272e55d5043b9f60a74e15b994409ab62a64e15f47db
6
+ metadata.gz: 3b659fde78f316410de238debb7241e564fa4fc545badafb41207e8964386fad11706b662e4f68e2d93ca83b092d129ff126f206b9f1dda215d97cf04db722d6
7
+ data.tar.gz: 673b4bed0f68ae4243c3ddafdcf1205f4a57a7ec84f4b4adaba502acecc604fda80ce9201af5436697c461241b0c849d64f8e7d8979f710ec56b32b65141f882
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.0
4
+
5
+ - `ns` lookup, on the resolver and the fake.
6
+
3
7
  ## 0.5.1
4
8
 
5
9
  - Re-release: 0.5.0
data/README.md CHANGED
@@ -2,20 +2,20 @@
2
2
 
3
3
  🔍 DNS resolution for mail, in Ruby.
4
4
 
5
- **mailresolver** is a small, injectable DNS client for mail libraries — TXT, A/AAAA, MX, PTR, and CNAME lookups.
5
+ **mailresolver** is a small, injectable DNS client for mail libraries — TXT, A/AAAA, MX, PTR, CNAME, and NS lookups.
6
6
 
7
7
  For mail libraries and the apps that use them: SPF/DKIM/DMARC/MTA-STS checks that need a missing record told apart from a server that couldn't answer, apps running several mail libraries that want one shared resolver instead of one apiece, test suites that want to fake DNS without touching a network.
8
8
 
9
9
  **mailresolver** handles:
10
10
 
11
- - TXT, A, AAAA, MX, PTR, and CNAME lookups, plus a merged `addresses` for A+AAAA
11
+ - TXT, A, AAAA, MX, PTR, CNAME, and NS lookups, plus a merged `addresses` for A+AAAA
12
12
  - a three-way error taxonomy — `NotFound`, `ServerFailure`, `Timeout` — instead of collapsing every failure into an empty answer
13
13
  - one shared resolver across every mail library in your app, multiplexed over dnsruby's single I/O thread
14
14
  - configurable retry/timeout schedule
15
15
  - DNSSEC validation and answer caching off, unconditionally, for callers that have no way to act on either
16
16
  - test doubles — a hash-backed fake and a real loopback nameserver — so a suite never needs the network
17
17
 
18
- > Not a general-purpose DNS client — five record types and three errors, built for what mail authentication needs.
18
+ > Not a general-purpose DNS client — six record types and three errors, built for what mail authentication needs.
19
19
 
20
20
  ## Contents
21
21
 
@@ -57,6 +57,7 @@ resolver.addresses("example.com") # => ["203.0.113.10", "2001:db8::1"]
57
57
  resolver.mx("example.com") # => ["mx1.example.com", "mx2.example.com"], sorted by preference
58
58
  resolver.ptr("203.0.113.10") # => ["mail.example.com"]
59
59
  resolver.cname("www.example.com") # => ["example.com"]
60
+ resolver.ns("example.com") # => ["ns1.example.net", "ns2.example.net"]
60
61
  ```
61
62
 
62
63
  `addresses` merges A and AAAA. A family the name doesn't publish contributes nothing to it rather than ending the lookup — but a name that doesn't exist at all raises `NoSuchName`, and a nameserver that couldn't answer still raises, same as every other method here.
@@ -106,7 +107,7 @@ DNSSEC validation and dnsruby's answer cache are both off, unconditionally. DNSS
106
107
 
107
108
  ## Custom Resolvers
108
109
 
109
- Anything that responds to `txt`, `a`, `aaaa`, `addresses`, `mx`, `ptr`, and `cname` — raising the three errors above — is a drop-in replacement. You don't have to write one: see [Test Doubles](#test-doubles).
110
+ Anything that responds to `txt`, `a`, `aaaa`, `addresses`, `mx`, `ptr`, `cname`, and `ns` — raising the three errors above — is a drop-in replacement. You don't have to write one: see [Test Doubles](#test-doubles).
110
111
 
111
112
  ## Test Doubles
112
113
 
@@ -57,6 +57,10 @@ module MailResolver
57
57
  records("CNAME", name).map { |record| record.domainname.to_s }
58
58
  end
59
59
 
60
+ def ns(name)
61
+ records("NS", name).map { |record| record.domainname.to_s }
62
+ end
63
+
60
64
  private
61
65
  def family(type, name)
62
66
  records(type, name).map { |record| record.address.to_s.downcase }
@@ -47,6 +47,10 @@ module MailResolver
47
47
  lookup(name, :cname)
48
48
  end
49
49
 
50
+ def ns(name)
51
+ lookup(name, :ns)
52
+ end
53
+
50
54
  private
51
55
  def family(type, name)
52
56
  lookup(name, type)
@@ -1,3 +1,3 @@
1
1
  module MailResolver
2
- VERSION = "0.5.1"
2
+ VERSION = "0.6.0"
3
3
  end
data/mailresolver.gemspec CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
8
8
  spec.authors = [ "Simon Lev" ]
9
9
 
10
10
  spec.summary = "DNS resolution for mail, in Ruby."
11
- spec.description = "DNS resolution for mail, in Ruby. **mailresolver** is a small, injectable DNS client for mail libraries — TXT, A/AAAA, MX, PTR, and CNAME lookups."
11
+ spec.description = "DNS resolution for mail, in Ruby. **mailresolver** is a small, injectable DNS client for mail libraries — TXT, A/AAAA, MX, PTR, CNAME, and NS lookups."
12
12
 
13
13
  spec.homepage = "https://github.com/mailpiece/mailresolver"
14
14
  spec.license = "MIT"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailresolver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Lev
@@ -24,7 +24,7 @@ dependencies:
24
24
  - !ruby/object:Gem::Version
25
25
  version: '1.74'
26
26
  description: DNS resolution for mail, in Ruby. **mailresolver** is a small, injectable
27
- DNS client for mail libraries — TXT, A/AAAA, MX, PTR, and CNAME lookups.
27
+ DNS client for mail libraries — TXT, A/AAAA, MX, PTR, CNAME, and NS lookups.
28
28
  executables: []
29
29
  extensions: []
30
30
  extra_rdoc_files: []