record_store 5.8.0 → 5.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -1
- data/README.md +2 -2
- data/Rakefile +1 -0
- data/dev.yml +1 -1
- data/lib/record_store.rb +1 -0
- data/lib/record_store/cli.rb +20 -1
- data/lib/record_store/record/spf.rb +1 -1
- data/lib/record_store/version.rb +1 -1
- data/lib/record_store/zone.rb +48 -0
- data/record_store.gemspec +6 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0de2b9654c8b2260778da756212d7e1e7a37d41044d001370f2ededcef00cec7
|
4
|
+
data.tar.gz: ceb08dc9a74484dd3645630901b5d13da249c0491f6244d065711977c74d557e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25757a3029ee3cf1c7a15aa342f59ea7943b0e865b21df2a2d7176f31af43fbfe6763d4f5a4da7012167e82a6e82b6cb27aa1210a53f11b4f30b629de5492fa4
|
7
|
+
data.tar.gz: 9e16174c5c7ea101b29cbb2b347f0917e02f7b70de86be0817b7f624b5607ad97218fa22f9d6c1dabf2408632fc9bbdf500ac6e95d970e22d65838f34c883765
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
# CHANGELOG
|
2
|
+
## 5.9.0
|
3
|
+
- add `--all` option for `record-store list` to list ignored records too [FEATURE]
|
4
|
+
- add `record-store info` command to list providers and delegation for zones [FEATURE]
|
5
|
+
|
6
|
+
## 5.8.0
|
7
|
+
- support SSHFP record type [FEATURE]
|
8
|
+
|
2
9
|
## 5.7.4
|
3
|
-
- NS1: changing the way long TXT records are processed (no more splitting to do on our side)
|
10
|
+
- NS1: changing the way long TXT records are processed (no more splitting to do on our side) [BUGFIX]
|
4
11
|
|
5
12
|
## 5.7.1
|
6
13
|
- add API rate limit for NS1 provider [FEATURE]
|
data/README.md
CHANGED
@@ -125,7 +125,7 @@ To add a new Provider, create a class inheriting `Provider` in [`lib/record_stor
|
|
125
125
|
|
126
126
|
**Note**: _there's no need to wrap `Provider#apply_changeset` unless it's necessary to do something before/after making changes to a zone._
|
127
127
|
|
128
|
-
Provider API interactions are tested with [VCR](https://github.com/vcr/vcr). To generate the fixtures, update [`test/dummy/secrets.json`](test/dummy/secrets.json) with valid credentials, run the test suite, and change the values back to stub credentials.
|
128
|
+
Provider API interactions are tested with [VCR](https://github.com/vcr/vcr). To generate the fixtures, update [`test/fixtures/config/dummy/secrets.json`](test/fixtures/config/dummy/secrets.json) with valid credentials, run the test suite, and change the values back to stub credentials.
|
129
129
|
|
130
130
|
**Important**: _be sure to [filter sensitive data](https://github.com/Shopify/record_store/blob/1ec0d1410cf8bedf79bc63e8e4cdc7cdb0f1019b/test/test_helper.rb#L23-L56) from the fixtures or you're going to have a bad time._
|
131
131
|
|
@@ -193,7 +193,7 @@ For provider-specific records (e.g. `ALIAS`), create the record model in `lib/re
|
|
193
193
|
|
194
194
|
#### Secrets
|
195
195
|
|
196
|
-
When adding a new provider, be sure to update the `secrets.json` in [`template/secrets.json`](template/secrets.json) and [`test/dummy/secrets.json`](test/dummy/secrets.json) with the new provider and required fields for the API to work.
|
196
|
+
When adding a new provider, be sure to update the `secrets.json` in [`template/secrets.json`](template/secrets.json) and [`test/fixtures/config/dummy/secrets.json`](test/fixtures/config/dummy/secrets.json) with the new provider and required fields for the API to work.
|
197
197
|
|
198
198
|
|
199
199
|
### Test Changes on Providers
|
data/Rakefile
CHANGED
data/dev.yml
CHANGED
data/lib/record_store.rb
CHANGED
data/lib/record_store/cli.rb
CHANGED
@@ -32,11 +32,30 @@ module RecordStore
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
+
desc 'info', 'Show information about zones under management'
|
36
|
+
option :delegation, desc: 'Include delegation', aliases: '-d', type: :boolean, default: false
|
37
|
+
def info
|
38
|
+
Zone.each do |name, zone|
|
39
|
+
puts "\n"
|
40
|
+
puts "Zone: #{name}"
|
41
|
+
puts "Providers:"
|
42
|
+
zone.config.providers.each { |p| puts "- #{p}" }
|
43
|
+
if (delegation = zone.fetch_authority)
|
44
|
+
puts "Authoritative nameservers:"
|
45
|
+
delegation.each { |d| puts "- #{d}" }
|
46
|
+
else
|
47
|
+
STDERR.puts "ERROR: Unable to determine delegation (#{name})"
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
35
52
|
desc 'list', 'Lists out records in YAML zonefiles'
|
53
|
+
option :all, desc: 'Show all records', aliases: '-a', type: :boolean, default: false
|
36
54
|
def list
|
37
55
|
Zone.each do |name, zone|
|
38
56
|
puts "Zone: #{name}"
|
39
|
-
|
57
|
+
records = options.fetch('all') ? zone.all : zone.records
|
58
|
+
records.each(&:log!)
|
40
59
|
end
|
41
60
|
end
|
42
61
|
|
data/lib/record_store/version.rb
CHANGED
data/lib/record_store/zone.rb
CHANGED
@@ -86,6 +86,10 @@ module RecordStore
|
|
86
86
|
@name.chomp('.')
|
87
87
|
end
|
88
88
|
|
89
|
+
def all
|
90
|
+
@records
|
91
|
+
end
|
92
|
+
|
89
93
|
def records
|
90
94
|
@records_cache ||= Zone.filter_records(@records, config.ignore_patterns)
|
91
95
|
end
|
@@ -108,8 +112,52 @@ module RecordStore
|
|
108
112
|
self.class.write(name, config: config, records: records, **write_options)
|
109
113
|
end
|
110
114
|
|
115
|
+
ROOT_SERVERS = %w(
|
116
|
+
a.root-servers.net
|
117
|
+
b.root-servers.net
|
118
|
+
c.root-servers.net
|
119
|
+
d.root-servers.net
|
120
|
+
e.root-servers.net
|
121
|
+
f.root-servers.net
|
122
|
+
g.root-servers.net
|
123
|
+
h.root-servers.net
|
124
|
+
i.root-servers.net
|
125
|
+
j.root-servers.net
|
126
|
+
k.root-servers.net
|
127
|
+
l.root-servers.net
|
128
|
+
m.root-servers.net
|
129
|
+
)
|
130
|
+
|
131
|
+
def fetch_authority(nameserver = ROOT_SERVERS.sample)
|
132
|
+
Resolv::DNS.open(nameserver: nameserver) do |resolv|
|
133
|
+
resolv.fetch_resource(name, Resolv::DNS::Resource::IN::SOA) do |reply, name|
|
134
|
+
break if reply.answer.any?
|
135
|
+
|
136
|
+
raise "No authority found (#{name})" unless reply.authority.any?
|
137
|
+
|
138
|
+
break extract_authority(reply)
|
139
|
+
end
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
111
143
|
private
|
112
144
|
|
145
|
+
def extract_authority(reply)
|
146
|
+
authority = reply.authority.sample
|
147
|
+
|
148
|
+
if unrooted_name.casecmp?(authority.first.to_s)
|
149
|
+
build_authority(reply.authority)
|
150
|
+
else
|
151
|
+
fetch_authority(authority.last.name.to_s) || build_authority(reply.authority)
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
155
|
+
def build_authority(authority)
|
156
|
+
authority.map.with_index do |(name, ttl, data), index|
|
157
|
+
Record::NS.new(ttl: ttl, fqdn: name.to_s, nsdname: data.name.to_s, record_id: index)
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
113
161
|
def build_records(records)
|
114
162
|
records.map { |record| Record.build_from_yaml_definition(record) }
|
115
163
|
end
|
data/record_store.gemspec
CHANGED
@@ -14,6 +14,12 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.homepage = 'https://github.com/Shopify/record_store'
|
15
15
|
spec.license = 'MIT'
|
16
16
|
|
17
|
+
if spec.respond_to?(:metadata)
|
18
|
+
spec.metadata['allowed_push_host'] = "https://rubygems.org"
|
19
|
+
else
|
20
|
+
raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
21
|
+
end
|
22
|
+
|
17
23
|
spec.files = %x(git ls-files -z).split("\x0").reject { |f| f.match(/^(test|DESIGN)/) }
|
18
24
|
spec.executables = ['record-store']
|
19
25
|
spec.require_paths = ['lib']
|
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: 5.
|
4
|
+
version: 5.9.0
|
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: 2020-04-
|
12
|
+
date: 2020-04-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
@@ -394,7 +394,8 @@ files:
|
|
394
394
|
homepage: https://github.com/Shopify/record_store
|
395
395
|
licenses:
|
396
396
|
- MIT
|
397
|
-
metadata:
|
397
|
+
metadata:
|
398
|
+
allowed_push_host: https://rubygems.org
|
398
399
|
post_install_message:
|
399
400
|
rdoc_options: []
|
400
401
|
require_paths:
|
@@ -410,7 +411,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
410
411
|
- !ruby/object:Gem::Version
|
411
412
|
version: '0'
|
412
413
|
requirements: []
|
413
|
-
rubygems_version: 3.0.
|
414
|
+
rubygems_version: 3.0.3
|
414
415
|
signing_key:
|
415
416
|
specification_version: 4
|
416
417
|
summary: Manage DNS using git
|