This repository has been archived by the owner on Dec 19, 2023. It is now read-only.
feat: add support for setting DNS Sec #439
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
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
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 |
---|---|---|
|
@@ -115,9 +115,26 @@ describe('dns', () => { | |
}; | ||
|
||
before(async () => { | ||
// Clean up any leaked resources | ||
const [zones] = await dns.getZones(); | ||
await Promise.all(zones.map(zone => zone.delete({force: true}))); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @bcoe this is kind of funny. If two test suites happened to be running at the same time, there's no way this was going to work 馃槅 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch 馃憤 |
||
await ZONE.create({dnsName: DNS_DOMAIN}); | ||
await Promise.all( | ||
zones.map(async zone => { | ||
const hoursOld = | ||
(Date.now() - new Date(zone.metadata.creationTime).getTime()) / | ||
1000 / | ||
60 / | ||
60; | ||
if (hoursOld > 1) { | ||
await zone.delete({force: true}); | ||
} | ||
}) | ||
); | ||
await ZONE.create({ | ||
dnsName: DNS_DOMAIN, | ||
dnssecConfig: { | ||
state: 'on', | ||
}, | ||
}); | ||
}); | ||
|
||
after(done => { | ||
|
@@ -306,7 +323,12 @@ describe('dns', () => { | |
it('should replace records', async () => { | ||
const name = 'test-zone-' + uuid.v4().substr(0, 18); | ||
// Do this in a new zone so no existing records are affected. | ||
const [zone] = await dns.createZone(name, {dnsName: DNS_DOMAIN}); | ||
const [zone] = await dns.createZone(name, { | ||
dnsName: DNS_DOMAIN, | ||
dnssecConfig: { | ||
state: 'on', | ||
}, | ||
}); | ||
const [originalRecords] = await zone.getRecords('ns'); | ||
const originalData = originalRecords[0].data; | ||
const newRecord = zone.record('ns', { | ||
|
@@ -319,6 +341,7 @@ describe('dns', () => { | |
const added = change.metadata.additions[0].rrdatas; | ||
assert.deepStrictEqual(deleted, originalData); | ||
assert.deepStrictEqual(added, newRecord.data); | ||
await zone.delete({force: true}); | ||
}); | ||
}); | ||
}); |
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
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.
The API already excepted this field, but we weren't setting it?
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, there are many fields this thing accepts that we're not currently exposing. For now, this one gets us out of overground jail though.