Commit graph

288 commits

Author SHA1 Message Date
Tom Limoncelli 21e85e6528
"Target" RecordConfig should not be exported (#1061)
* Unexport RecordConfig.Target
* Fix tests
* HEDNS: Fix usage of target field to resolve TXT handling (#1067)

Co-authored-by: Robert Blenkinsopp <robert@blenkinsopp.net>
2021-03-04 18:58:23 -05:00
Jan-Philipp Benecke 06a1cc3d38
POWERDNS: Some minor fixes for ALIAS and TXTMulti and integration testing (#1065)
* POWERDNS: Some minor fixes for ALIAS and integration testing
* POWERDNS: Readd missing error handling
2021-03-01 07:09:49 -05:00
Tom Limoncelli c547beacc0
NEW FEATURE: Support Split Horizon DNS (#1034)
* Implement main feature
* BIND: Permit printf-like file name formats
* BIND: Make filenameformat work forwards and backwards.
* Fix extrator test cases
2021-02-05 12:12:45 -05:00
taybinakh 2d5a09f217
CLOUDNS: Implement AUTOSPLIT (#1035)
* implement AUTOSPLIT for ClouDNS

Co-authored-by: IT-Sumpfling <it-sumpfling@maxit-con.de>
Co-authored-by: bentaybi jamal <jamal@pfalzcloud.de>
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2021-01-31 07:40:03 -05:00
Tom Limoncelli 23f65163e8
CLOUDFLAREAPI: Support Punycode for CF_REDIRECT/CF_TEMP_REDIRECT (with tests) (#1026)
* CLOUDFLAREAPI: CF_REDIRECT should support Punycode
* Add tests to CF_*REDIR
* CLOUDFLARE: DS records only permitted on children
2021-01-24 16:36:23 -05:00
Nick Gregory 945ffb7e80
NEW PROVIDER: Oracle Cloud (#1021)
* feat: add Oracle provider

* fix ALIAS and NS tests

* return... else if -> return... if

* fix assignment

* remove extraneous blank lines

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2021-01-24 15:35:12 -05:00
taybinakh d7f40ed680
Implement DS record support for ClouDNS (#1018)
* Add PTR support for ClouDNS

* Implement PTR Support for CLouDNS

* implemnent DS Record for ClouDNS

* implement DS record for clouDNS

* pull request review

* note that SshFpAlgorithm and DsAlgorithm both use json field algorithm

* primitive rate limit and fix order of NS/DS-entries

* codefixes

Co-authored-by: IT-Sumpfling <it-sumpfling@maxit-con.de>
Co-authored-by: bentaybi jamal <jamal@pfalzcloud.de>
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2021-01-22 12:54:39 -05:00
Tom Limoncelli 0893f74895
CLOUDFLAREAPI: Now works with PunyCode/IDNA (#1019) 2021-01-14 09:53:06 -05:00
Tom Limoncelli 50db086278
NEW PROVIDER: MSDNS (#1005)
* New provider
* Add support for SRV records
* Modify ACTIVEDIRECTORY_PS provider to warn that it is deprecated.
2020-12-28 16:07:33 -05:00
Brice Figureau 38e3e706cd
(#1003) Make OVH TXTMulti capable (#1008)
* maint: OVH doesn't support Null MX

so, better exclude this provider from the Null MX integration test.

* (#1003) OVH natively supports TXT multistrings

OVH directly supports multistrings TXT, so this change just enables
this feature.
2020-12-28 14:53:22 -05:00
taybinakh e9f4257ad2
CLOUDNS: Implement PTR Record Support (#999)
* Add PTR support for ClouDNS

* Implement PTR Support for CLouDNS

Co-authored-by: IT-Sumpfling <it-sumpfling@maxit-con.de>
Co-authored-by: bentaybi jamal <jamal@pfalzcloud.de>
2020-12-22 13:32:00 -05:00
Tom Limoncelli c89f14e926
TESTING: Fail cleaner if no domain set (#998) 2020-12-18 12:14:43 -05:00
Tom Limoncelli 096458d91c
CLOUDFLAREAPI: Support TXTMulti and empty TXT targets (#978)
* CLOUDFLAREAPI: Add TXTMulti support

* CLOUDFLAREAPI: Support TXTMulti and empty TXT strings
2020-11-29 14:39:15 -05:00
Tom Limoncelli 12a3354c0c
Enable Bring-Your-Own-Secrets (#982)
* Move env from steps to job
* Rename env to be predictable.
* fix conditional
* document B.O.Y.S.
* Update docs/byo-secrets.md

Co-authored-by: Max Horstmann <MaxHorstmann@users.noreply.github.com>

* respond to reviews
* fixup!

Co-authored-by: Max Horstmann <MaxHorstmann@users.noreply.github.com>
2020-11-29 14:15:40 -05:00
Tom Limoncelli 07917006bb
Gracefully skip tests if the secrets are not available (#977)
* Sort provider lists and add comments to explain sorting
* Skip tests we can not run
* Add INWX
2020-11-29 06:04:22 -05:00
Sven Peter e29f7440f5
INWX: Guard against single-quote TXT targets (#971)
* INWX: split out and disable TXT with single-quote test
* INWX: add check for single-quotes in TXT records
2020-11-28 15:38:58 -05:00
Tom Limoncelli db6ad08f5e
GCLOUD: Retry on ratelimit (#946)
* Add exponential delay retry on 429, 503; and single retry on 404s.
2020-11-18 09:06:45 -05:00
Tom Limoncelli 1f471a15b9
DIGITALOCEAN: Support TXTMulti with caveats (#949)
* DIGITALOCEAN: Support TXTMulti with caveats
* go get github.com/digitalocean/godo
* DIGITALOCEAN: Enable CI tests
2020-11-18 08:22:31 -05:00
Jakob Ackermann 550fa436ed
HETZNER: better rate limit handling (#936)
* HETZNER: better rate limit handling

- Hetzner is using a Proxy service 'kong' which broadcasts it limits
- honor 'Retry-After' of 429 responses
- delay requests per-se: see the amended docs for details

Signed-off-by: Jakob Ackermann <das7pad@outlook.com>

* HETZNER: apply review feedback: store quotaName as lower case

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
Signed-off-by: Jakob Ackermann <das7pad@outlook.com>

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2020-11-16 12:26:52 -05:00
Tom Limoncelli 184131b1e3
AZURE_DNS: Remove artificial delays (#943)
* AZURE_DNS: Remove artificial delays
* CloudflareAPI is too slow for all tests
2020-11-13 12:21:13 -05:00
Tom Limoncelli ba08e718b7
DIGITALOCEAN: Abide by rate limits (#934)
* Implement exponential back-off
2020-11-12 10:53:44 -05:00
Tom Limoncelli 724d5ff6c7
ROUTE53: Fix R53_ALIAS creation failure (#938)
Fixes https://github.com/StackExchange/dnscontrol/issues/937

* Add integration test to repro https://github.com/StackExchange/dnscontrol/issues/937
* Reformat integration tests to be more readable.
* ROUTE53: Create CNAME/R53_ALIAS in best order
* Each R53_ALIAS_* should be its own change, not combined.
* Refactor and simplify (omg it has gotten ugly)
2020-11-12 00:30:40 -05:00
Jakob Ackermann 2b50af0cbc
NEW PROVIDER: HETZNER DNS Console (#904)
* HETZNER: implement the provider for Hetzner DNS Console

Signed-off-by: Jakob Ackermann <das7pad@outlook.com>

* HETZNER: apply review feedback

- add domain into error messages
- insert sub-strings using `%q`
- insert sub-errors using `%w`
- change api.getZone() signature to return a (potentially `nil`) Zone
   pointer instead of a (potentially empty) Zone value
- sort imports and confirm with `$ goimports -w providers/hetzner/`
- use exact 'api_key' term in error message of settings validation
- add blank line for logic separation
- drop internal record id from correction messages

Co-Authored-By: Tom Limoncelli <tlimoncelli@stackoverflow.com>
Signed-off-by: Jakob Ackermann <das7pad@outlook.com>

* HETZNER: add request rate-limiting handling

There are a limited number of data-points on how their rate-limiting
 works at this time. I deduce from my account to others and use a fixed/
 constant backoff of 1s as the initial delay. Thereafter exponential
 increase with factor 2 (not needed at this time).
Hetzner has not made any official statements on rate-limiting, so this
 is guesswork only.

Signed-off-by: Jakob Ackermann <das7pad@outlook.com>

* HETZNER: address golint complaints

- baseUrl -> baseURL
- mark Record as private -> record
- mark Zone as private -> zone
- mark RequestRateLimiter as private -> requestRateLimiter
- capitalize Id fields as ID
- keep delay logic on same level, move return out of branch

Signed-off-by: Jakob Ackermann <das7pad@outlook.com>

* HETZNER: rate_limited: init the response timestamp on requestRateLimiter

Signed-off-by: Jakob Ackermann <das7pad@outlook.com>

* HETZNER: requestRateLimiter: align local variable with struct name

Signed-off-by: Jakob Ackermann <das7pad@outlook.com>

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2020-10-22 09:44:21 -04:00
Tom Limoncelli da1cbad4ec
HEXONET: Implement get-zones, fix module problem (#898)
* VULTR: Update govultr to v1.0.0 (fixes #892) (#897)

* go get -u github.com/hexonet/go-sdk

* Fix HEXONET providers.json entry

* providers.json: json commma

* providers.json: fmtjson

* HEXONET: Implement get-zones. Fix tests and docs.

* fixup!

* Update azure test failures

* Move version info into its own package

* Use new version system
2020-10-12 11:45:44 -04:00
Patrick Gaskin b6d2ddd04c
VULTR: Null MX records are not supported (#702) (#894) 2020-10-08 16:12:22 -04:00
Tom Limoncelli b6fd4dffd7
Cleanups: Fix many issues reported by staticcheck.io (#837)
* Lint: Fix ST1005: error strings should not be capitalized

* Cleanup: Fix a lot of staticcheck.io warnings
2020-08-30 20:38:08 -04:00
Robert Blenkinsopp 74dd34443a
NEW PROVIDER: HEDNS: Hurricane Electric DNS (dns.he.net) (#822)
* Add initial dns.he.net provider support

* Update to new IncrementalDiff interface

* Fix ListZones output for `all` query on `get-zones`

* Refactor authentication code for 2FA with better error checking

* Fix integration test and refactor zone record retrieval

* Add option to use `.hedns-session` file to store sessions between runs

* Add comment on `session-file-path`

* Add integration test for TXT records longer than 255 characters

* Add additional checks for expected responses, and better 2FA error checking

* Minor documentation changes

* Revert "Add integration test for TXT records longer than 255 characters"

This reverts commit 657272db

* Add note on provider fragility due to parsing the web-interface

* Resolve go lint issues

* Clarify security warnings in documentation
2020-08-26 13:38:28 -04:00
Mike Cochrane b01b278d18
Fix IGNORE_TARGET integration test. Fixes (#818) (#819) 2020-08-18 17:45:34 -04:00
Mike Cochrane 960dc66bd2
New feature: IGNORE_TARGET. Rename INGORE to IGNORE_NAME (#806) 2020-08-18 11:14:34 -04:00
Sven Peter f88c60a8f3
New provider: INWX (#808)
* adds initial support for INWX

* adds all features to the INWX provider

* allows domain for tests in creds.json for INWX

* runs go generate to update docs for INWX

* fixes formatting with gofmt

* changes goinwx to github.com/nrdcg/goinwx v0.8.0

* simplifies inwx sandbox check

* changes inwx unknown key error to a warning

* adds models.PostProcessRecords for inwx records

* replaces strings.TrimRight with [:-1] to remove final dot for inwx

* adds a comment about the domain creds.json key for the inwx provider

* removes warning for invalid creds.json keys in the inwx provider

* adds TOTP calculation support for inwx

* adds comments to inwxProvider

* improves INWX error messages

* adds additional documentation about the TOTP support for INWX

* adds inwx documentation

* bumps goinwx to 0.8.1 to fix the inwx API
2020-08-17 08:45:44 -04:00
Sven Peter 690f49e041
fix: only run SRV null target test when supported (#807) 2020-08-10 18:36:33 -04:00
Tom Limoncelli 491a3f8720 Relax tests for Azure temporarily 2020-06-25 17:05:10 -04:00
Tom Limoncelli ea46bc3bbd
integration_test.go: Split out pagesize tests (#771) 2020-06-24 15:16:00 -04:00
Matthew Huxtable ff8ce26cee
Provider support for DS records as children only (#765)
This functionality is required by the GCLOUD provider, which supports
recordsets of type DS but only for child records of the zone, to enable
further delegation. It does not support them at the apex of the zone (@)
because Google Cloud DNS is not itself a registrar which needs to model
this information.

A related change (14ff68b151, #760) was
previously introduced to enable DS support in Google, which broke
integration tests with this provider.

To cleanly support this, we introduce a new provider capability
CanUseDSForChildren and appropriate integration tests. Further, it is no
longer possible to verify a provider has the proper capabilities for a
zone simply by existence of particular records; we adapt the capability
checks to enable inspection of the individual recordsets where this is
required.

Closes #762
2020-06-18 17:24:13 -04:00
Robert Koch 2e8589e4ce Added DS for cloudflare provider with tests 2020-05-30 11:06:13 -04:00
Tom Limoncelli c0354a585d DS: More cleanups 2020-05-30 11:06:12 -04:00
Tom Limoncelli a89ab89ab6
Fix the merge mess I made with the DS merge (#754)
* DS: More cleanups

* Added DS for cloudflare provider with tests

* Merge

* Added generated files

* Regenerated documentation matrix

* rebased and regenerated

* Updated integration tests

* Rebase and regenerate

* More cleanups

Co-authored-by: Robert Koch <robert@kochie.io>
Co-authored-by: Nicolai Ehemann <nicolai.ehemann@enerko-informatik.de>
2020-05-30 11:05:54 -04:00
Tom Limoncelli 87a5c4b339
New RTYPE: DS records now supported! (#753)
Thanks to @haraldkoch for starting this, @McNetic for picking it up.

* Added DS record type

* Added DS for cloudflare provider with tests

* Removed DS validation, fixed parse test

* Added generated files

* Added dnsimple ds record

* Regenerated documentation matrix

* rebased and regenerated

* Updated integration tests

* Rebase and regenerate

* Enable DS record type for provider desec

* Added DS record type

* Added DS for cloudflare provider with tests

* Removed DS validation, fixed parse test

* Added generated files

* Added dnsimple ds record

* Regenerated documentation matrix

* rebased and regenerated

* Updated integration tests

* Rebase and regenerate

* Enable DS record type for provider desec

* Rebase and fixes

Co-authored-by: Robert Koch <robert@kochie.io>
Co-authored-by: Nicolai Ehemann <nicolai.ehemann@enerko-informatik.de>
2020-05-30 10:40:21 -04:00
Jan-Philipp Benecke ffd4e46dda
New DNS provider PowerDNS (#748)
* Added PowerDNS as dns provider

* Remove unnecessary comments

* Some tests

* Implemented feedback
2020-05-30 09:54:07 -04:00
Tom Limoncelli eeebe58830 CLOUDFLAREAPI: disable failing integration tests for unicode 2020-05-23 10:10:40 -04:00
Amelia Aronsohn b2b0ed4154
Update DNSimple Provider to api client 0.62 (#739)
* Update DNSimple-go to 0.61

This adds support for contexts, exports all return values, Adds ZoneRecordAttributes to fix support for blank record names.

* Add UserAgent to client

* Update Integration test for DNSimple

We now support Empty TXT, however we do not support Null MX yet.

* Bump to dnsimple-go 0.62 & use dnsimple.String()
2020-05-13 16:37:49 -04:00
Tom Limoncelli d8a153c01f
Clarify dev docs (#734)
* Clarify dev docs

* fixup!
2020-05-08 10:56:58 -04:00
Grégoire Henry 8dd66ec605
New provider: AXFR+DDNS (#259) (#729)
* NEW PROVIDER: AXFR+DDNS (#259)

* AXFRDDNS: split GetZoneRecords in two functions

* AXFRDDNS: improve code documentation

* AXFRDDNS: line-wrap documentation

* AXFRDDNS: add simple `named.conf` as example

* AXFRDDNS: improve error messages

* AXFRDDNS: improve doc.

* AXFRDDNS: update `OWNERS`

* Linting and other cosmetic changes

* AXFRDDNS: fix grammar

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2020-05-08 10:55:51 -04:00
Kordian Bruck 02e6a49bb8
NEW PROVIDER: NETCUP (DNS) (#718)
* Add support for netcup DNS api.
* Add documentation page.
* Update reference to new version path.
* Add OWNERS entry for netcup.
* Add credentials for integration test. Netcup does not support PTRs. Fix parsing/formating of SRV records.
* Skip integration tests that are not supported.
* Use single quotes in JS code.
2020-04-17 13:58:44 -04:00
Tom Limoncelli 24b7d0641e Update github.com/StackExchange/dnscontrol/v2 2020-04-14 16:49:03 -04:00
PJ Eby a3ef53574c
Support RFC 7505 "null MX" (#702) (#703)
* Fix #702: Spurious null MX changes on CloudFlare

* Test roundtripping null MX on Cloudflare

* Use an if instead of TrimSuffix

* Add other providers that support RFC 7505

* Suppress test for non-compliant providers
2020-03-25 09:53:28 -04:00
Tom Limoncelli 1b5935d1af
Release 3.0.0 Candidate (#699)
Final changes before V3.0.0 release

* Remove old Gandi.  Fixes #575
* Many cleanups
* go mod tidy && go mod vendor

* integration_test.go: Output subtest name

* Cleanups

* integration_test.go: Description should include sub-test name
* Add a whitespace test to js/parse_tests/017-txt.js

* Cloudflare strips whitespace from end of TXT

* Fixes https://github.com/StackExchange/dnscontrol/issues/700

* Whitespace at end of TXT records

Name.com strips the whitespace from the end of a TXT record. There's
nothing we can do other than file a bug.

* Fixes https://github.com/StackExchange/dnscontrol/issues/701
2020-03-22 13:38:37 -04:00
Tom Limoncelli 14e48b9b07
linting (#693)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2020-03-10 16:53:17 -04:00
Tom Limoncelli 67e78f7e15
refactor into groups (#684)
* Refactor tests into "groups", each with its own filter (not/only/requires) to select which providers are appropriate.
* Test driver code is now a lot more simple and clear.
* Add support for not(), only(), and requires() as a way to select/reject providers for a test.
* Add docs explaining how to add tests
* Logging messages are much cleaner now, especially when tests are skipped.
* -start and -end now refer to test groups, not individual tests.  Log messages list the group numbers clearly.
* Add stringer for Capabilities
* Change the order of the tests so that simple tests are first
* Removed knownFailures from providers.json
* fmtjson providers.json

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2020-03-10 10:13:20 -04:00
Vatsalya Goel 884118f6dd
AZURE_DNS: Add support for Alias: AZURE_ALIAS() (#675)
* Add support for Alias in Azure

* Actioned comments and added parse tests

* GetTargetDebug

* Go formatting
2020-03-02 11:25:42 -05:00
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