dns-zonefile 1.1.13 → 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: 52eb68dd2b6354b08b882718cc9ea59fdd0db340695695d10a5332211bb2f192
4
- data.tar.gz: 0031fab46b67d08b8a44336cc80d5b5970b0dcd45b3e7470a4822235427dbde7
3
+ metadata.gz: 2e03fd7e584a66f2ad1dfa8b55214bb4c84e2eacce69cb99d4717b195fccff9d
4
+ data.tar.gz: 64727fe7326f916e0b49d25bc662285220b3c6bc77c2cdc161ea6baaa36d912f
5
5
  SHA512:
6
- metadata.gz: dc626d8ac11cd536e1fe8106d707efd4a63af9a57f211afd5e40d4dcec4cfdba9384332986e0d6c2fe13a6e72fba868fb9ae979231045b9831ec4b2c1389e96f
7
- data.tar.gz: b4450217343c924d6985ea62a26f86f83717f851311f922830992569101228401794020693920683a0c87320bf90ac6e3eb4d0465b985f0f3545f3c42999f00a
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
@@ -1,5 +1,5 @@
1
1
  module DNS
2
2
  module Zonefile
3
- VERSION = "1.1.13"
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.13
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-12-12 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
@@ -126,7 +125,6 @@ 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: []