dns-zonefile 1.1.12 → 1.2.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: 2cb49e3ee8ed92d42323f4619979ee16eea492f643ccf44bec74ce237f97512b
4
- data.tar.gz: 940ed29605e9b5b650bc925414cfdd7d807eaf51f20ae1c96302f3e59a85f0ba
3
+ metadata.gz: 2e03fd7e584a66f2ad1dfa8b55214bb4c84e2eacce69cb99d4717b195fccff9d
4
+ data.tar.gz: 64727fe7326f916e0b49d25bc662285220b3c6bc77c2cdc161ea6baaa36d912f
5
5
  SHA512:
6
- metadata.gz: 342403e936bc703dea402e4ab9801e345a83ea8a6b767085476bd67afe69c9ba9a182df215cc35d7ebe8e7dd53f5f19459385d4fa10d381814c8f0c9f5741dad
7
- data.tar.gz: f06db28573800361166c693a3bd86209325225f6ae7520cdfb1384649e2eb6e3c0bbef1a717b16dbd04bc67b1d39d3918ddf880f342fed8dce748d8091c79159
6
+ metadata.gz: def79e0087a99c705347dca181448696cbc0d44587c111241128c8b56250847505cefe5b34661fd6ebe26952b14ef037a86ab9d031ce7164cfa1bde06d4cbefc
7
+ data.tar.gz: 9106004e78e04153b04f94b5e054595faad619804c8584192d7b2ea328128cbb1306cc1098dce919df50f7c1d8a2905ad13432959896913e3d394b12ac3943db
@@ -19,8 +19,8 @@ jobs:
19
19
  strategy:
20
20
  fail-fast: false
21
21
  matrix:
22
- os: [ubuntu-20.04, ubuntu-latest]
23
- ruby: ['2.7', '3.0', '3.1', head, jruby, truffleruby]
22
+ os: [ubuntu-latest]
23
+ ruby: ['2.7', '3.0', '3.1', '3.4', jruby, truffleruby]
24
24
  runs-on: ${{ matrix.os }}
25
25
  steps:
26
26
  - uses: actions/checkout@v3
data/CONTRIBUTING.md CHANGED
@@ -5,7 +5,7 @@
5
5
  Clone the repository and move into it:
6
6
 
7
7
  ```
8
- $ git clone git@github.com:craigw/dns-zonefile.git
8
+ $ git clone git@github.com:aeden/dns-zonefile.git
9
9
  $ cd dns-zonefile
10
10
  ```
11
11
 
@@ -33,4 +33,4 @@ Submit unit tests for your changes. You can test your changes on your machine by
33
33
 
34
34
  ## Publishing
35
35
 
36
- Once a PR is merged into master, bump the version in `lib/dns/zonefile/version.rb` and commit that change. Next, add a new tag with that version number 'git tag vx.x.x' and push the tag to GitHub 'git push origin vx.x.x'. Finally, if you are a maintainer with access rights for rubygems.org, run `gem build dns-zonefile.gemspec` followed by `gem push dns-zonefile-x.x.x.gem` where x.x.x is the version number you just set.
36
+ Once a PR is merged into `main`, bump the version in `lib/dns/zonefile/version.rb` and commit that change. Next, add a new tag with that version number 'git tag vx.x.x' and push the tag to GitHub 'git push origin vx.x.x'. Finally, if you are a maintainer with access rights for rubygems.org, run `gem build dns-zonefile.gemspec` followed by `gem push dns-zonefile-x.x.x.gem` where x.x.x is the version number you just set.
data/{TODO → TODO.md} RENAMED
@@ -2,5 +2,3 @@
2
2
  * Output the zone object-graph as a zone string.
3
3
  * Allow comparison of resource records and zones for checking equality.
4
4
  * Allow unqualified ns and rp in SOA
5
- * Implement the changes in the eam pull request for other record types:
6
- https://github.com/craigw/dns-zonefile/pull/1
data/dns-zonefile.gemspec CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  be investigated programatically, manipulated, validated or printed into
19
19
  some canonical form.
20
20
  EOD
21
- spec.homepage = "https://github.com/craigw/dns-zonefile"
21
+ spec.homepage = "https://github.com/aeden/dns-zonefile"
22
22
 
23
23
  # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
24
24
  # delete this section to allow pushing this gem to any host.
@@ -1,5 +1,5 @@
1
1
  module DNS
2
2
  module Zonefile
3
- VERSION = "1.1.12"
3
+ VERSION = "1.2.0"
4
4
  end
5
5
  end
data/lib/dns/zonefile.rb CHANGED
@@ -52,6 +52,7 @@ module DNS
52
52
  when "SRV" then @records << SRV.new(@vars, e)
53
53
  when "SPF" then @records << SPF.new(@vars, e)
54
54
  when "SSHFP" then @records << SSHFP.new(@vars, e)
55
+ when "TLSA" then @records << TLSA.new(@vars, e)
55
56
  when "TXT" then @records << TXT.new(@vars, e)
56
57
  when "SOA" then
57
58
  # No-op
@@ -286,6 +287,24 @@ module DNS
286
287
  end
287
288
  end
288
289
 
290
+ class TLSA < Record
291
+ attr_accessor :host, :usage, :selector, :matching_type, :certificate_data
292
+
293
+ def initialize(vars, zonefile_record)
294
+ @vars = vars
295
+ if zonefile_record
296
+ self.host = qualify_host(zonefile_record.host.to_s)
297
+ @vars[:last_host] = host
298
+ self.ttl = zonefile_record.ttl.to_i
299
+ self.klass = zonefile_record.klass.to_s
300
+ self.usage = zonefile_record.usage.to_i
301
+ self.selector = zonefile_record.selector.to_i
302
+ self.matching_type = zonefile_record.matching_type.to_i
303
+ self.certificate_data = zonefile_record.certificate_data.to_s
304
+ end
305
+ end
306
+ end
307
+
289
308
  class TXT < Record
290
309
  attr_accessor :host, :data
291
310
 
@@ -56,7 +56,7 @@ grammar Zonefile
56
56
  end
57
57
 
58
58
  rule resource_record
59
- record:(a_record / aaaa_record / caa_record / cname_record / mx_record / naptr_record / ns_record / ptr_record / srv_record / spf_record / sshfp_record / txt_record / soa_record) space* comment? linebreak {
59
+ record:(a_record / aaaa_record / caa_record / cname_record / mx_record / naptr_record / ns_record / ptr_record / srv_record / spf_record / sshfp_record / tlsa_record / txt_record / soa_record) space* comment? linebreak {
60
60
  def zone
61
61
  p = parent
62
62
  while p.respond_to?(:parent) && p.parent
@@ -299,6 +299,29 @@ grammar Zonefile
299
299
  }
300
300
  end
301
301
 
302
+ rule tlsa_record
303
+ (
304
+ host space ms_age ttl klass "TLSA" space usage:integer space selector:integer space matching_type:integer space certificate_data:tlsa_certificate_data /
305
+ host space ms_age klass ttl "TLSA" space usage:integer space selector:integer space matching_type:integer space certificate_data:tlsa_certificate_data
306
+ ) {
307
+ def to_s
308
+ "#{host} #{ttl} #{klass} TLSA #{usage} #{selector} #{matching_type} #{certificate_data}"
309
+ end
310
+
311
+ def record_type
312
+ "TLSA"
313
+ end
314
+ }
315
+ end
316
+
317
+ rule tlsa_certificate_data
318
+ [a-fA-F0-9 ]+ {
319
+ def to_s
320
+ text_value.strip
321
+ end
322
+ }
323
+ end
324
+
302
325
  rule txt_record
303
326
  (
304
327
  host space ms_age ttl klass "TXT" space data:ms_txt_data /
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dns-zonefile
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.12
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Craig R Webster
8
8
  - Anthony Eden
9
- autorequire:
10
9
  bindir: exe
11
10
  cert_chain: []
12
- date: 2022-11-25 00:00:00.000000000 Z
11
+ date: 1980-01-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: treetop
@@ -106,7 +105,7 @@ files:
106
105
  - LICENCE
107
106
  - README.md
108
107
  - Rakefile
109
- - TODO
108
+ - TODO.md
110
109
  - bin/console
111
110
  - bin/setup
112
111
  - dns-zonefile.gemspec
@@ -122,11 +121,10 @@ files:
122
121
  - lib/dns/zonefile.rb
123
122
  - lib/dns/zonefile.treetop
124
123
  - lib/dns/zonefile/version.rb
125
- homepage: https://github.com/craigw/dns-zonefile
124
+ homepage: https://github.com/aeden/dns-zonefile
126
125
  licenses: []
127
126
  metadata:
128
127
  allowed_push_host: https://rubygems.org
129
- post_install_message:
130
128
  rdoc_options: []
131
129
  require_paths:
132
130
  - lib
@@ -141,8 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
141
139
  - !ruby/object:Gem::Version
142
140
  version: '0'
143
141
  requirements: []
144
- rubygems_version: 3.3.7
145
- signing_key:
142
+ rubygems_version: 3.6.7
146
143
  specification_version: 4
147
144
  summary: Work with zonefiles (RFC 1035 section 5 and RFC 1034 section 3.6.1)
148
145
  test_files: []