-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for dynamic updates (RFC2136) #31
Open
tarnfeld
wants to merge
60
commits into
master
Choose a base branch
from
feature/nsupdate
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
48520b1
Typo in the readme
tarnfeld a100666
[WIP]
tarnfeld 159702b
WIP
tarnfeld ffca58d
Fixed compiler errors
tarnfeld 43abcd9
Add a boolean argument to prevent resolving CNAMEs
tarnfeld da29d03
Ensure there is no leading slash from nameToKey
tarnfeld e5e685e
Fixed type error
tarnfeld ddc71c8
Added helper methods for domain/rrset validation checks
tarnfeld 1f68dca
Added more useful debug logging
tarnfeld 683576d
Added some basic test cases for panic based locks
tarnfeld 266b5bd
Merge branch 'master' into feature/nsupdate
tarnfeld 6838133
Added MOTD for makefile
tarnfeld d67d220
Test race conditions too
tarnfeld a65461d
Text alignment
tarnfeld 1b93f29
Progress with add/delete dynamic updates
tarnfeld bfbe460
Make sure we send a TSIG response back
tarnfeld d18eb08
Create new records as keys inside the type directory
tarnfeld eb36f88
Fix creating directories for records:
8a395e6
Fix 'given peers are not reachable' test errs:
0e36d77
Typo
8bcd572
Correct signature for not-yet-implementeds
5a8ba10
Use correct TTL etcd keyname:
1f9ea6b
Implement update record converters: SRV, TXT, PTR
5b09124
Clean up any stale locks in etcd before tests:
d0a67d6
Use etcd prefixes for locks:
9b87d5c
Add (failing) test for multiple records:
a3dda33
Merge remote-tracking branch 'origin/master' into feature/nsupdate
b7244d9
Merge branch 'master' into feature/nsupdate
6d6729b
Fix NameExists to use simpler flow from master
ac8fd0e
Fix some merge issues
c037341
Add CLI option for unauthenticated updates:
6232c76
Use consistent etcd keys for new records:
0bd0d05
Replace panic-based locking with blocking locks:
dd80139
Add simple lock test
5536ccc
Add conflicting lock test
3a396b6
Merge pull request #37 from duedil-ltd/nsupdate/consistent-keys
4d82fc8
Merge pull request #39 from duedil-ltd/nsupdate/allow-unauthed
edca961
Merge pull request #40 from duedil-ltd/nsupdate/syncronous-locking
c81e5fb
Annotate prereq conditions with their RFC meanings
36a19cc
Tests for Name is/is not in use
18a38b2
Fix prereq checks for name-(not-)in-use
383a06c
Tests for RRset exists (value independent)
0233539
Use the rrset-exists helper in prereq checks
8dc8889
Add strict-rr-match helper to resolver
b8fa209
Validate RRset matches in prereq checks
82b0506
Factor out test boilerplate via reflection
f145857
Make test faliures report right line
16786e0
Tests for RRset exists (value dependent)
ab7021f
Cover RRset does not exist too
ab3aaa9
Internal notes on fixes needed in performUpdate
b6c5859
Full validation of update RRS before updating
a99838a
Don't shadow the etcd package
ffb2ff6
Fix delete tests:
cc870c8
Check TTL on inserted record
fc4b785
Add (failing) test for Delete-RRset:
dbe9da9
WIP: rewrite performUpdate:
2bb281e
More refactoring of performUpdate:
6b0f450
Full CNAME support, warts and all
c750c0e
Don't call `SetRcode`, set it directly:
65cb285
Send correct response opcode
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package main | ||
|
||
import ( | ||
"bytes" | ||
"strings" | ||
) | ||
|
||
// nameToKey returns a string representing the etcd version of a domain, replacing dots with slashes | ||
// and reversing it (foo.net. -> /net/foo) | ||
func nameToKey(name string, suffix string) string { | ||
segments := strings.Split(name, ".") | ||
|
||
var keyBuffer bytes.Buffer | ||
for i := len(segments) - 1; i >= 0; i-- { | ||
if len(segments[i]) > 0 { | ||
keyBuffer.WriteString("/") | ||
keyBuffer.WriteString(segments[i]) | ||
} | ||
} | ||
|
||
keyBuffer.WriteString(suffix) | ||
return keyBuffer.String() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you really want to use dns.Split or dns.SplitDomainName in these cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I only just came across all of the domain label splitting functions earlier for this. Will update them all! Thanks.