https://github.com/libdns/cloudflare
Cloudflare provider implementation for libdns
https://github.com/libdns/cloudflare
Last synced: 2 months ago
JSON representation
Cloudflare provider implementation for libdns
- Host: GitHub
- URL: https://github.com/libdns/cloudflare
- Owner: libdns
- License: mit
- Created: 2020-04-30T17:16:03.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2025-02-28T17:52:37.000Z (3 months ago)
- Last Synced: 2025-02-28T21:56:42.842Z (3 months ago)
- Language: Go
- Homepage:
- Size: 25.4 KB
- Stars: 64
- Watchers: 6
- Forks: 17
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Cloudflare for `libdns`
=======================[](https://pkg.go.dev/github.com/libdns/cloudflare)
This package implements the [libdns interfaces](https://github.com/libdns/libdns) for [Cloudflare](https://www.cloudflare.com).
## Authenticating
> [!IMPORTANT]
> This package supports API **token** authentication (as opposed to legacy API **keys**).There are two approaches for token permissions supported by this package:
1. Single token for everything
- `APIToken` permissions required: Zone:Read, Zone.DNS:Write - All zones
2. Dual token method
- `ZoneToken` permissions required: Zone:Read - All zones
- `APIToken` permissions required: Zone.DNS:Write - for the zone(s) you wish to manageThe dual token method allows users who have multiple DNS zones in their Cloudflare account to restrict which zones the token can access, whereas the first method will allow access to all DNS Zones.
If you only have one domain/zone then this approach does not provide any benefit, and you might as well just have the single API tokenTo use the dual token approach simply ensure that the `ZoneToken` property is provided - otherwise the package will use `APIToken` for all API requests.
To clarify, do NOT use API keys, which are globally-scoped:

DO use scoped API tokens:
