[PR #568] [MERGED] Gandi Personal Access Token support #733

Open
opened 2025-11-20 04:25:53 -05:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/qdm12/ddns-updater/pull/568
Author: @varner-owl
Created: 12/10/2023
Status: Merged
Merged: 1/14/2024
Merged by: @qdm12

Base: masterHead: add-gandi-bearer-token


📝 Commits (3)

📊 Changes

2 files changed (+27 additions, -14 deletions)

View changed files

📝 docs/gandi.md (+3 -3)
📝 internal/provider/providers/gandi/provider.go (+24 -11)

📄 Description

Currently authentication for updates to Gandi domains can only be done with the Gandi API key. Gandi has depreciated the API key in favor of Personal Access Tokens.

This PR adds the option to authenticate using a Personal Access Tokens but does not require a token to be used instead of an API key. This should not break anyone's current configurations or require updates to their configuration files. This implementation produces a KeyNotSet error only if both the API Key and Personal Access Token are not provided or are empty the config file. If both an API key and Personal Access Token are provided, it will default to using the Token for authentication. It does not use the API key as a fall back (i.e. if authentication via Token fails, try again with the API key), but this could be implemented in the future if desired.

Example config.json with different possible valid configurations:

{
    "settings": [
        {
            "provider": "gandi",
            "domain": "mydomain.com",
            "host": "@",
            "key": "mysecretkey",
            "ip_version": "ipv4"
        },
        {
            "provider": "gandi",
            "domain": "mydomain.com",
            "host": "@",
            "token": "mypersonalaccesstoken",
            "ip_version": "ipv4"
        },
        {
            "provider": "gandi",
            "domain": "mydomain.com",
            "host": "@",
            "key": "mysecretkey",
            "token": "mypersonalaccesstoken",
            "ip_version": "ipv4"
        }
    ]
}

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/qdm12/ddns-updater/pull/568 **Author:** [@varner-owl](https://github.com/varner-owl) **Created:** 12/10/2023 **Status:** ✅ Merged **Merged:** 1/14/2024 **Merged by:** [@qdm12](https://github.com/qdm12) **Base:** `master` ← **Head:** `add-gandi-bearer-token` --- ### 📝 Commits (3) - [`bb24a16`](https://github.com/qdm12/ddns-updater/commit/bb24a16ec0a63768603d99d0d65a7fcbd02de8cc) Add PAT authentication - [`ebc5140`](https://github.com/qdm12/ddns-updater/commit/ebc5140836a67fc0ad907997084ade50a13b445a) Correct keynotset error message - [`69d678c`](https://github.com/qdm12/ddns-updater/commit/69d678c872f83e88a204d63724d8332c582409ba) Code review by @qdm12 ### 📊 Changes **2 files changed** (+27 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `docs/gandi.md` (+3 -3) 📝 `internal/provider/providers/gandi/provider.go` (+24 -11) </details> ### 📄 Description Currently authentication for updates to Gandi domains can only be done with the Gandi API key. [Gandi has depreciated the API key in favor of Personal Access Tokens. ](https://api.gandi.net/docs/authentication/) This PR adds the option to authenticate using a Personal Access Tokens but does not require a token to be used instead of an API key. This should not break anyone's current configurations or require updates to their configuration files. This implementation produces a KeyNotSet error only if both the API Key and Personal Access Token are not provided or are empty the config file. If both an API key and Personal Access Token are provided, it will default to using the Token for authentication. It does not use the API key as a fall back (i.e. if authentication via Token fails, try again with the API key), but this could be implemented in the future if desired. Example config.json with different possible valid configurations: ``` { "settings": [ { "provider": "gandi", "domain": "mydomain.com", "host": "@", "key": "mysecretkey", "ip_version": "ipv4" }, { "provider": "gandi", "domain": "mydomain.com", "host": "@", "token": "mypersonalaccesstoken", "ip_version": "ipv4" }, { "provider": "gandi", "domain": "mydomain.com", "host": "@", "key": "mysecretkey", "token": "mypersonalaccesstoken", "ip_version": "ipv4" } ] } ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2025-11-20 04:25:53 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ddns-updater#733