record_store 6.5.2 → 6.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/record_store/cli.rb +1 -1
- data/lib/record_store/version.rb +1 -1
- data/lib/record_store/zone.rb +27 -1
- data/lib/record_store.rb +1 -0
- data/template/zones/dynect.example.com.yml +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9af43560e4a84302824fb5b1abef5476bc0995e752d3960de068b45949b1d154
|
4
|
+
data.tar.gz: 4bc999da542a5484d7cf51a7bb652593c323fecac6d79d8e73ccbb62bd638ea0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d72d0a1bffea56a12070eab25df96cd120f00107779063ae651a141310b369764eeaa5fa8993d77c67f81e2f4e98e16641e6d8dacde4f35fa09be4a6fe08236e
|
7
|
+
data.tar.gz: e84f52373f10caa1fa464845a13a33383c7461392f69c88c17c032f9d91e8b96ffcd87fc9f1fc798478b05b2de2660629e2d6d4b89e232b405d80009676eac5b
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 6.5.3
|
4
|
+
- Adds check for detecting shadowed records, used when a record being added to a zone in record-store will have no effect because it is shadowed by another record.
|
5
|
+
|
3
6
|
## 6.5.2
|
4
7
|
- Ensure filters for implicit_records, `except_record` and `conflict_with`, are truly optional [BUGFIX]
|
5
8
|
|
data/lib/record_store/cli.rb
CHANGED
data/lib/record_store/version.rb
CHANGED
data/lib/record_store/zone.rb
CHANGED
@@ -21,6 +21,7 @@ module RecordStore
|
|
21
21
|
validate :validate_no_empty_non_terminal
|
22
22
|
validate :validate_can_handle_alias_records
|
23
23
|
validate :validate_no_duplicate_keys
|
24
|
+
validate :validate_zone_record_not_shadowed
|
24
25
|
|
25
26
|
class << self
|
26
27
|
def download(name, provider_name, **write_options)
|
@@ -62,7 +63,12 @@ module RecordStore
|
|
62
63
|
current_zone = nil
|
63
64
|
while zones.any?
|
64
65
|
mutex.synchronize { current_zone = zones.shift }
|
65
|
-
|
66
|
+
break if current_zone.nil? # account for the race between `zones.any?` and `zones.shift`
|
67
|
+
|
68
|
+
# `unchanged?` is deliberately outside locked context since it's a bit CPU/time heavy
|
69
|
+
unless current_zone.unchanged?
|
70
|
+
mutex.synchronize { modified_zones << current_zone }
|
71
|
+
end
|
66
72
|
end
|
67
73
|
end
|
68
74
|
end.each(&:join)
|
@@ -272,6 +278,26 @@ module RecordStore
|
|
272
278
|
end
|
273
279
|
end
|
274
280
|
|
281
|
+
def validate_zone_record_not_shadowed
|
282
|
+
nameserver_fqdns = records
|
283
|
+
.select { |record| record.is_a?(Record::NS) && name != record.fqdn }
|
284
|
+
.map { |record| record.fqdn.delete_suffix(".") }
|
285
|
+
.uniq
|
286
|
+
|
287
|
+
nameserver_fqdns.each do |ns_record|
|
288
|
+
selected_records = records.reject do |record|
|
289
|
+
record.is_a?(Record::NS) && \
|
290
|
+
record.fqdn.delete_suffix(".") == ns_record
|
291
|
+
end
|
292
|
+
selected_records.each do |record|
|
293
|
+
normalized_record = record.fqdn.delete_suffix(".")
|
294
|
+
next unless normalized_record.end_with?(".#{ns_record}") || normalized_record == ns_record
|
295
|
+
errors.add(:records, "Record #{record.fqdn} #{record.type} in Zone #{name} " \
|
296
|
+
"is shadowed by #{ns_record} and will be ignored")
|
297
|
+
end
|
298
|
+
end
|
299
|
+
end
|
300
|
+
|
275
301
|
def validate_no_empty_non_terminal
|
276
302
|
return unless config.empty_non_terminal_over_wildcard?
|
277
303
|
|
data/lib/record_store.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: record_store
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.5.
|
4
|
+
version: 6.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Willem van Bergen
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-
|
12
|
+
date: 2021-09-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|