Commit graph

288 commits

Author SHA1 Message Date
Brice Figureau e082c74de2
(#667) Remove unneeded SSHFP integration test (#677)
The test 49 was changing the fingerprint type of a SSHFP DNS RR,
but not the fingerprint hash. Changing the type of hash function
changes the hash result size (there's only two defined hash type of
different size in the RFC, SHA-1 and SHA-256).
This was failing with the OVH provider, because OVH is validating
the hash sizes of any created SSHFP RR and was finding an inconsistency.
Since there's already the test 50 which is both changing the type
and the fingerprint, the functionality is still covered and we
can remove test 49.
2020-03-02 11:23:47 -05:00
Brice Figureau bdddd466bf
(#628) Add get-zones to the OVH provider (#666)
Commit 87ad01d added the very useful `get-zones` command, which
requires providers to implement a new method `GetZoneRecords`.
This changes make the OVH provider support this.
2020-02-28 11:14:02 -05:00
Joel Margolis a57bf35788
EXOSCALE: Update exoscale/egoscale client to v0.23.0 (#664)
* Update Exoscale provider

* Update vendor folder for exoscale/egoscale v0.23.0

* Fix typos and SRV parsing

* Add . at the end of SRV records for exoscale
2020-02-27 23:06:12 -05:00
Joel Margolis 1232c17293
HEXONET: Update hexonet-sdk to v2.2.3+incompatible (#662)
* Update hexonet-sdk to v2.2.3+incompatible

* Update vendor

* Go mod tidy
2020-02-27 13:04:17 -05:00
Tom Limoncelli 05cedab5a7
Remove test for empty TXT strings. (#633) 2020-02-18 15:24:04 -05:00
Tom Limoncelli e172df2817
Integration testing: Standardize "empty" usage (#612)
* All tests start with an "empty", not end.
* "empty" formatted the same way for all tests.
2020-01-30 10:05:37 -05:00
Patrick Gaskin 825ba2d081 Switch to Go 1.13 error wrapping (#604)
* Replaced errors.Wrap with fmt.Errorf (#589)

* Find:    errors\.Wrap\(([^,]+),\s+(["`][^"`]*)(["`])\)
  Replace: fmt.Errorf($2: %w$3, $1)

* Replaced errors.Wrapf with fmt.Errorf (#589)

* Find:    errors\.Wrapf\(([^,]+),\s+(["`][^"`]*)(["`])\)
  Replace: fmt.Errorf($2: %w$3, $1)
* Find:    errors\.Wrapf\(([^,]+),\s+(["`][^"`]*)(["`])(,[^)]+)\)
* Replace: fmt.Errorf($2: %w$3$4, $1)

* Replaced errors.Errorf with fmt.Errorf (#589)

* Find:    errors\.Errorf
  Replace: fmt.Errorf

* Cleaned up remaining imports

* Cleanup

* Regenerate provider support matrix

This was broken by #533 ... and it's now the third time this has been missed.
2020-01-28 11:06:56 -05:00
Patrick Gaskin 2f83aa9302 Internals: Switch to v2 go.mod, drop GOPATH, and fix Azure Pipelines (#595)
* Switched to v2 go.mod

Also set GO111MODULE=on in build stuff to always use Go modules
even when in GOPATH.

* Ensure go.mod, go.sum, and vendor are up to date

* Attempt to fix Azure pipelines

* Add set -e to properly fail on exit (it didn't seem to be
  propagating properly before).
* Set workingDirectory for GoFmt and GoGen (this might be why it
  fails unlike compile and unitests).

* Another attempt to fix Azure Pipelines

* Use the Go env template for all go-related jobs.

* Completely fixed Azure Pipelines

* Added a display name to GoFmt for consistency.
* Fixed diffs for GoFmt and GoGen.
* Show git status for checks.

* Drop GOPATH for tests

TODO: Do the same for integration tests.

* Drop GOPATH for integration tests

* Show more diffs

* Regenerate provider support matrix

This wasn't done in #590...
2020-01-28 10:42:31 -05:00
Juho Teperi bfa36ebbf8 DIGITALOCEAN: CAA is supported with some caveats (#592)
Change the tests to skip test case with CAA `;` value for Digitalocean,
because that specific feature isn't supported.

Closes #588
2020-01-24 12:21:01 -05:00
Tom Limoncelli d3dc5a5eb7
Integration test: Add test for TXT with null string (#597) 2020-01-24 12:10:27 -05:00
Tom Limoncelli f6ce421fdd
NEW PROVIDER: GANDI_V5 (deprecates GANDI) (#572)
* GANDI_v5: Add Registrar support
* Add GANDI deprecation warning
* vendor github.com/tiramiseb/go-gandi
2020-01-20 14:13:32 -05:00
Anton Yurchenko 253cd07154 NEW PROVIDER: ClouDNS (#578)
* ClouDNS: first version of provider
* ClouDNS: documentation
* ClouDNS: code cleanup
* ClouDNS: GetNameservers now uses ClouDNS API to fetch NS servers list
* ClouDNS: CAA support
* ClouDNS: TLSA support
* ClouDNS: tests credentials now use variables instead of hardcoded values
* ClouDNS: SSHFP support
* ClouDNS: export only necessary methods
2020-01-20 14:07:38 -05:00
Anton Yurchenko 35e37ff91f Use ns1.example.com, not ns1.otherdomain.tld, in integration tests 2020-01-14 18:19:53 -05:00
Tom Limoncelli 2c0361b0d5
BUG: Correctly spell Cabability (#582) 2020-01-12 11:24:10 -05:00
Tom Limoncelli eed8e43fbd CLOUDFLARE: Integration tests should use API Token, not user/key (#557)
* providers/cloudflare: Support API tokens

Cloudflare API tokens are a new way to authenticate to Cloudflare API.
Unlike the Global API key, tokens can be given specific permissions to
only access parts of the API. See [1] for details.

[1] https://blog.cloudflare.com/api-tokens-general-availability/

This commit introduces a new credential for cloudflare called
`apitoken`, which is mutually exclusive with `apiuser` and `apikey`.

In order for DNSControl to work with this token, it should have the
right to read DNS zones and edit DNS records.

Closes #534

* CLOUDFLARE: Update integration tests for api token
2019-12-09 14:04:52 -05:00
Patrick Gaskin 70ce16ff23 Fix handling of SRV records with no target (indicated by ".")
According to the RFC, the way to indicate that a SRV has no target is to set the target to ".".  Some providers do not handle this, or the API returns "" instead of ".".  This situation is now tested in the integration tests and all providers (that support this) have been fixed.



* Cloudflare: Fix decoding empty SRV target (fixes #561)

SRV records with empty (".") targets are now returned as false by
the API, which breaks Unmarshaling it into a string.

* Use custom type for Cloudflare SRV target

Rewrote the SRV target decoding to use a custom type for (un)marshaling, as
Cloudflare returns false for null targets, but it requires a single period
for giving it one. The target code has also been made more flexible to future
API changes with additional normalization.

This has been tested with record creation, deletion, and update and works
as of 2019-11-05.

* DigitalOcean: Fix target FQDN for null targets

Without this, dnscontrol thinks an update is needed (.. != .) even
when the SRV target is correct.

* DNSimple: Fix parsing of null SRV target

DNSimple only returns two fields when the target is null.

* NameDotCom: Add note about not supporting null SRV targets, skip test

* DNSimple: Do not append a . unless we have all three parts

Signed-off-by: Amelia Aronsohn <squirrel@wearing.black>

* Regenerated provider matrix
2019-11-14 11:25:20 -05:00
Vatsalya Goel 443401d2a7 Upgrade go version to 1.13 (#550)
Sustained Engineering
2019-10-05 10:45:57 -04:00
Vatsalya Goel 813a186865 Add Azure DNS (#547)
* Add Azure DNS

* Remove unused code

* Fix failing tests and update build
2019-09-18 21:45:13 -04:00
Craig Peterson 364aac5073 fix format 2019-06-27 01:21:23 -04:00
Craig Peterson 394b9ccf41
respect max batch size for r53 (#509) 2019-06-26 23:45:34 -04:00
Tom Limoncelli a5dcad06a3
Fix integration tests (NAMEDOTCOM, CLOUDFLARE) (#498)
NAMEDOTCOM: TXTMulti is broken. Disable.
CLOUDFLARE: Fix SSHFP tests.
2019-05-27 15:10:00 -04:00
Koen Vlaswinkel 5538de6682 IGNORE() now supports glob pattern/wildcards (#463) 2019-05-27 10:14:29 -04:00
Peter Dunaskin 7383751803 Fix integration test. 2019-04-17 11:23:32 +02:00
Peter Dunaskin 7566c0428e Attempt to add NAPTR support. 2019-03-28 15:40:13 +01:00
Pierre-Emmanuel Jacquier 511c0bf7de NEW PROVIDER: Exoscale (#390)
* Add exoscale provider

Signed-off-by: Pierre-Emmanuel Jacquier <pierre-emmanuel.jacquier@epitech.eu>

* Fix validation

Signed-off-by: Pierre-Emmanuel Jacquier <pierre-emmanuel.jacquier@epitech.eu>

* Fix DualProvider

Signed-off-by: Pierre-Emmanuel Jacquier <pierre-emmanuel.jacquier@epitech.eu>
2019-02-22 09:10:23 -05:00
Craig Peterson 9a6af836dc
Activedirectory: Full support for managing NS records. (#450)
* condense AD 'unsupported record type' warnings

* active directory provider can create/modify/delete NS records!

* ad passes more of the tests now

* skip root NS records for safety

* clarifying comment
2019-02-20 12:30:35 -05:00
karlism f9fc6243d4 Add SSHFP DNS record support. (#439)
* Add SSHFP DNS record support.
* Fix integration test.
2019-01-28 17:26:20 -05:00
Tom Limoncelli 93a36cbba9
GCLOUD: Support TXTMulti (#415)
* GCLOUD: Support TXTMulti
* Testing: Test max TXT record length
2018-10-14 10:53:11 -04:00
Amy Aronsohn 4e417eaa06 Fix DNSimple SRV and MX records (#413)
* Fix SRV and MX records, update knownFailures

This gets us back to tests passing

Signed-off-by: Amy Aronsohn <WagThatTail@Me.com>

* Better comment

Signed-off-by: Amy Aronsohn <WagThatTail@Me.com>
2018-10-14 00:30:13 -04:00
Craig Peterson d006f62f8f make sure key/value grouping always uses fqdn 2018-09-07 13:46:44 -04:00
Kai Schwarz 3e5d223675 new provider module HEXONET (#373) 2018-08-30 08:54:42 -04:00
Craig Peterson 2c400b2d93 some more ad tests to fail 2018-03-29 14:46:21 -04:00
Craig Peterson 554e8a40e1
Update AD integration failures (#353) 2018-03-29 14:03:34 -04:00
Antoine Cœur 0d52745164 typo (#338) 2018-03-21 08:12:05 -04:00
Tom Limoncelli a7eba97ada
Refactor in preparation to unexport RecordConfig.{Name,NameFQDN,Target} (#337)
* Preparing for the unexport of Name/NameFQDN/Target
* Cleanups
2018-03-19 17:18:58 -04:00
Tom Limoncelli bf9007fde4 add example and tips 2018-03-09 06:53:43 -05:00
Koen Vlaswinkel afa80c24bd LINODE: Fix Linode provider (#333) 2018-03-08 13:48:11 -05:00
Craig Peterson 19ca760072 fix for deleting wildcard from r53. includes failing integration test 2018-03-01 10:09:02 -05:00
Tom Limoncelli 54de1ff698
NEW PROVIDER: OctoDNS (#309)
* govendor gopkg.in/yaml.v2
* Ignore YAML and BIND test data litter.  Create README.txt files to force git to create subdirectories.
* Update convertzone to also read OctoDNS files
2018-02-27 17:36:47 -05:00
Tom Limoncelli b83630044f Correction: Fix error message. 2018-02-27 16:53:02 -05:00
Tom Limoncelli 1097c96fcc
New Provider: GANDI-LIVEDNS (API v5) (#320)
* Add gandi LiveDNS api provider
* vendor testify and gandi live DNS
* govendor update github.com/prasmussen/gandi-api/{client,live_dns}
* Fix Gandi-livedns TXT unit test
* TravisCI should use go 1.10
2018-02-24 13:40:18 -05:00
Tom Limoncelli 65f8fb63f0
Better .gitignore of integration test stuff. (#316) 2018-02-05 10:28:58 -05:00
Brice Figureau 7b8d608019 ROUTE53: Support Route53's ALIAS record type (#239) (#301)
* Stable comparison of metadata (#239)

Iterating over a map in Go never produces twice the same ordering.
Thus when comparing two metadata map with more than one key, the
`differ` is always finding differences.

To properly compare records metadata, we need to iterate the maps
in a deterministic way.

Signed-off-by: Brice Figureau <brice@daysofwonder.com>

* Support for Route53 ALIAS record type (#239)

Route53 ALIAS doesn't behave like a regular ALIAS, and is much more
limited as its target can only be some specific AWS resources or
another record in the same zone.

According to #239, this change adds a new directive R53_ALIAS which
implements this specific alias. This record type can only be used
with the Route53 provider.

This directive usage looks like this:
```js
D("example.com", REGISTRAR, DnsProvider("ROUTE53"),
R53_ALIAS("foo1", "A", "bar") // record in same zone
R53_ALIAS("foo2", "A",
  "blahblah.elasticloadbalancing.us-west-1.amazonaws.com",
   R53_ZONE('Z368ELLRRE2KJ0')) // ELB in us-west-1

```

Unfortunately, Route53 requires indicating the hosted zone id
where the target is defined (those are listed in AWS documentation,
see the R53_ALIAS documentation for links).
2018-01-16 05:53:12 -05:00
Brice Figureau 2fc55dfdc4 Add IGNORE(label) which ignores label at the provider (#183) (#300)
* Add support for the IGNORE(name) directive (#183)

IGNORE is like NO_PURGE but for a spefic record instead of the whole
zone. This is very useful for instance if you have a zone where
only some records are managed externally from dnscontrol (for instance
using kubernetes external dns system).

Adding IGNORE("foo") in the zone will make dnscontrol not trying
to manage the "foo" record (and especially not deleting it).
dnscontrol will error out if the "foo" record is both ignored and
managed in dnscontrol.

This can be seen as a generic Cloudflare's ignored label.

Signed-off-by: Brice Figureau <brice@daysofwonder.com>

* Deprecate CloudFlare ignoredLabels in favor of IGNORE (#183)

Since IGNORE implements a generic `ignoredLabels` system, let
the user know CF `ignoredLabels` are deprecated.

Signed-off-by: Brice Figureau <brice@daysofwonder.com>
2018-01-15 15:39:29 -05:00
Pat Moroney 91e2cf67ef NAMEDOTCOM: add TXTMulti capability (#299)
* add TXTMulti capability to the namedotcom provider
* run go generate
* escape multi txt records before sending to the API
2018-01-11 07:23:59 -05:00
Tom Limoncelli b7c251190f
Vet and Lint the entire system (#296)
* govet and golint corrections
2018-01-09 12:53:16 -05:00
Tom Limoncelli de88bfe8b7
Add support for TXT records with multiple strings (BIND, ROUTE53) (#293)
* BIND: Support TXT records with multiple strings (#289)
* ROUTE53: Add support for TXT records with multiple strings (#292)
2018-01-04 19:19:35 -05:00
Tom Limoncelli 2d51cd57ed
NS1: TXT records are broken if they contain spaces (#270)
* Integration tests: Add simple TXT tests.
* NS1: Fix bug in TXT record handling.
2017-11-20 08:53:44 -05:00
Koen Vlaswinkel 9a44e785ac New provider: Linode (#268) 2017-11-14 23:08:06 -05:00
Brice Figureau e44dde52e2 New Provider: OVH DNS Provider (#143) (#175)
* OVH DNS Provider (#143)

This adds the OVH Provider along with its documentation.

Unfortunately we can't set this DNS provider to support `CanUsePTR`,
because OVH only supports setting PTR target on the Arpa zone.

* OVH Registrar provider (#143)

This implements OVH as a registrar provider.
Note that NS modifications are done in a "best effort" mode, as the
provider doesn't wait for the modifications to be fully applied
(the operation that can take a long time).

* Allow support for dual providers scenarios

Since OVH released their APIv6, it is now possible to update
zone apex NS records, opening the door to complete dual providers
scenarii.

This change implements apex NS management in an OVH zone.
2017-11-10 11:02:34 -08:00
Tom Limoncelli e7472f76f3 Downcase DNS names (#253)
* Downcase DNS names
* Document opinions
2017-11-07 14:12:17 -08:00
Tom Limoncelli b409637332 Revert! 2017-10-25 12:11:51 -04:00
Tom Limoncelli 2a98e29eb0 wip! 2017-10-25 11:52:54 -04:00
Craig Peterson 2c5f4c88ea DNSimple: handle pagination appropriately. (#242)
* dnsimple paging

* remove unrelated change
2017-10-18 13:53:44 -04:00
Patrick G 23427516c0 Added Vultr provider (#217) (#219)
* Added Vultr provider
* Fixed tests
* Fixed CI build validation
* Add unsupported features
* Added #rtype_variations tags according to stackexchange.github.io/dnscontrol/adding-new-rtypes
* Add title (for compatibility with #223)
* Removed extra rtype_variations
2017-10-12 09:21:36 -04:00
Craig Peterson 2cfd67e4fa Namecheap take Provider (#202)
* re-copying namecheap dns provider and testing

* document limits. mx broken because super odd api

* manually path namecheap lib. passing tests.

* generate

* generate

* clarify limit

* conflict

* add dependency

* fully document namecheap capabilities
2017-10-03 11:53:56 -04:00
Tom Limoncelli e88dd1d48e Fix GCLOUD integration test (#214) 2017-09-29 15:49:39 -04:00
Craig Peterson 823e8bb1a3 Add SPF flattening feature. (#126) 2017-09-29 15:30:36 -04:00
Jamie Lennox 7daa7a6467 Add SoftLayer DNS provider (#59)
Add SoftLayer DNS as a DomainServiceProvider.

The SoftLayer API is a bit of a mess and treats MX and SRV records
differently. This leads to some replication and custom handling issues
to work around.

In this patch I have to change the SRV test case to be _tcp instead of
_protocol because softlayer requires a "known" protocol which AFAICT is
tcp, udp or tls. I think this will be acceptable in most cases.

Signed-off-by: Jamie Lennox <jamielennox@gmail.com>
2017-09-26 13:14:53 -04:00
eliheady 4aac517d62 Add TLSA record support (#165) (#203) 2017-09-15 09:03:29 -04:00
Craig Peterson 6ce221df49 comment gandi page size 2017-09-13 11:56:40 -04:00
Craig Peterson b0c465c3a9 Ns1 provider (#63)
* add ns1 libs to vendor

* Create shim and wire into tests

* ns1 provider more working.

* vendor correct files

* comment diff functions

* ns1 docs

* making mx work with ns1

* ?

* refactor tests to make capability blocks easier. fix up ns1
2017-09-13 11:49:15 -04:00
Tom Limoncelli e15b28c3b6 ROUTE53: Fix broken integration test. 2017-09-08 17:13:59 -04:00
Tom Limoncelli 7116fd9bce Add integration test for large (>100 record) zones 2017-08-31 15:10:46 -04:00
Tom Limoncelli aa5db83563 integration_test.go: SRV tests should use more realistic data. 2017-08-30 18:41:43 -04:00
Juho Teperi ad27cc9b3b Digitalocean provider (#171)
* Implement Digitalocean provider
* Vendor digitalocean lib
* Enable SRV for Digitalocean and fix the tests
* Test cname etc. records pointing to the same domain
2017-08-10 13:31:20 -07:00
PJ Eby 638ee45e6c Implement SRV support for CloudFlare provider (#174)
* Implement SRV support for CloudFlare provider
* go fmt
* Use valid SRV names in SRV tests
2017-08-10 13:02:06 -07:00
Pat Moroney 93764da4e3 Namecom punycode (#170)
* convert records to punycode before processing

* make IDN CNAME target use a real IDN TLD
2017-08-05 08:08:22 -07:00
Tom Limoncelli 2f0f5330fc Add CAA support (#161)
* Added CAA support

* Fixed bind parsing of CAA records

* Added CAA parsing test

* Renamed CAA json fields

* Added CAA tag validation

* Updated CAA docs to clarify on the value field

* parse_tests: Fixed typo in caaflags

* Added integration test

* Small cleanups
2017-07-25 14:59:40 -04:00
Tom Limoncelli e6ce3b8895 Cleanup SRV testing
* Integration tests: PTR tests should only happen if CanUsePTR
* Integration tests: SRE tests should only happen if CanUseSRV
* CanUseSRV should be validated early (in pkg/normalize/validate.go)
* CLOUDFLARE does not support SRV. Check for this during validation
* GCLOUD CanUsesRV (mostly by accident, but whatever works)
2017-07-20 15:55:26 -04:00
Tom Limoncelli 9aac24e14c Add support for SRV records for BIND 2017-07-19 16:02:11 -04:00
Tom Limoncelli d55b20ecdb Add SRV Record Type (#136)
* Add support for SRV records for NAMEDOTCOM and ROUTE53.
* Improve docs
* Rename RR() to ToRR().
* Rename RecordConfig Priority to MxPreference (affects json IR data)
2017-07-19 15:53:40 -04:00
Tom Limoncelli d346d561a0 NAMEDOTCOM needs parameterization to permit integration testing. 2017-07-13 15:21:16 -04:00
Tom Limoncelli 4fc8bd86fd providers.json: Add NAMEDOTCOM 2017-07-13 10:39:55 -04:00
Tom Limoncelli b7af5e70fe providers.json: Pass file thought fmtjson 2017-07-13 10:38:51 -04:00
Tom Limoncelli 598017a843 providers.json: Turn // into "comments". 2017-07-13 10:36:57 -04:00
Tom Limoncelli 582e5c2bb1 Make PTR more magical (#148)
* Initial code and tests
2017-07-07 13:59:29 -04:00
Craig Peterson 42ef9f4b9e moving a bunch of packages under pkg (#124)
* moving a bunch of packages under pkg

* fix gen

* fix tst

* oops

* fix test fo real

* parse mx/a
2017-05-25 14:25:39 -04:00
Craig Peterson fb14cea91e Support ALIAS records with Cloudflare (#89)
* simple facility for registering provider capabilities

* support for cloudflare. tests.

* js and docs

* docs

* generate
2017-04-19 13:13:28 -06:00
Craig Peterson bb1dcac520 Testing and fixing AD (#74)
* updates to AD

* fix linux build
2017-04-13 10:19:51 -06:00
Craig Peterson d205c8b4ed Adding gandi to integration suite. Fixing bugs. (#57)
* Adding gandi to integration suite. Fixing bugs.
Fixes #35
Fixes #36

* small fixes

* gandi docs
2017-03-27 16:03:01 -06:00
Craig Peterson 7073b8f989 getting tests setup for r53. Not mixing deletes and other changes in same changeset. 2017-03-22 13:08:23 -06:00
Craig Peterson 6dea5e30cf tests for mx records 2017-03-22 10:54:55 -06:00
Craig Peterson 1f1e0fbab3 log corrections on second run 2017-03-22 10:41:54 -06:00
Craig Peterson 2ac43a424b Letting you run only some tests. Way to document failures in individual providers and skip. 2017-03-22 10:40:47 -06:00
Craig Peterson 854c84e652 Update bind docs and Getting Started (#53)
* intitial work for bind refactor

* relax requirement that creds.json exists.

* Updating bind docs.
Fixes #48

* typo

* can exclude provider from default set in creds.json

* Add bind to integration tests. Fix for IDNs.
2017-03-22 10:38:08 -06:00
Anthony Eden 4fef4a8550 DNSimple provider (#43)
* Implement a basic DNSimple provider.

Handles domain delegation as well as record create, update, and delete.

Note that this is completely untested at the moment. It’s so alpha it might burn your face off.

* Add some inline comments. Always use the StackExchange libs.

* Clean up dnsimple docs a little

* This will need to be changed before merging.

* Import the dnsimple dnscontrol package from its expected path

* Properly build the FQDN and implement record listing so create/update/delete are used correctly.

* Add support for overriding base URL to allow connection to sandbox.

* Vendor dnsimple-go and its dependencies.

* Remove unnecessary doc file.

* Use dnsutil.AddOrigin for combining record name and origin.

* Modifying dnsimple provider to pass tests
2017-03-18 19:58:47 -06:00
Craig Peterson 101916a6e4 Integration Testing framework (#46)
* integration test started

* details

* More tests.

* idn tests and punycode (not tested fully because I'm on an aiplane)

* test for dual provider compatibility

* readme for tests

* vendor idna

* fix casing
2017-03-16 22:42:53 -07:00