* 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
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
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
* gandi/livedns: Print actual changes to be pushed
Currently, preview & push output prints all domain records values:
$ dnscontrol preview
----- DNS Provider: gandi...1 correction
#1: Setting dns records for example.com:
mail.example.com.
1.2.3.4
"ga"
"bu"
"zo"
With this change, it would only show what changes from current state:
$ dnscontrol preview
----- DNS Provider: gandi...1 correction
#1: Setting dns records for example.com:
CREATE TXT ga.example.com "ga" ttl=10800
MODIFY TXT bu.example.com "bu" ttl=10800
DELETE TXT meu.example.com "meu" ttl=10800
* Add import
Remove the following:
```
$ govendor list +unused
vu github.com/xlucas/go-ovh/ovh
vu golang.org/x/text/secure/bidirule
vu golang.org/x/text/unicode/bidi
vu golang.org/x/text/unicode/norm
```