-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update LiveDNS endpoint and the docs URL #2
Conversation
Nicely spotted, however this is not enough ^^ The authentication mechanism did change between the 2 endpoints: |
Thanks @romuald for the review, I just pushed a commit to update this part 😉. |
@Themimitoof Thank you for your PR, I'll take a look to ensure the endpoints are the same before making the switch. However your new API is still shown as being in beta and this plugin is being used for production systems. Do you believe the new API is mature enough to be used in production ? The documentation explicitly states |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At a first glance, it appears the https://api.gandi.net/v5/livedns/domains
endpoint has changed and the attribute zone_records_href
from the previous API has vanished.
Unfortunately for some silly reason of mine I was using this attribute here and there to make my requests. Could you replace the domain.ZoneRecordsHref
currently used to make requests by domain.DomainRecordsHref
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that the when using the domain_records_href
instead of the zone_records_href
attribute we can submit both relative and absolute names for this endpoint.
That's good, it means I we may finally ditch that hack I'm not so proud of and use either wiki.gconfs.fr.
and wiki
to manipulate zones. Can you make this change also ?
I think I've listed everything that is needed to make the plugin works with the new endpoint. |
@Themimitoof any news on this ? |
Hello @obynio, unfortunately, I don't have enough bandwidth lately. I hope to be able to work on it this weekend. Have you a test procedure to try to test locally before requesting you a new review? |
We are lucky enough to have a very easy way to spin out a dev environment using You can configure a simple
Then in the directory of the plugin you're working on run
Then |
Since April 2020 we (Gandi) have deprecated the old LiveDNS endpoint in favor of the new one that is part of our public API project. This commit update the endpoint but also the link to the new documentation.
The new public API now uses `Authentication: Apikey <Apikey>` header to authenticate requests.
b82177e
to
4e8c5f5
Compare
@@ -15,11 +15,10 @@ func (p *Provider) setRecord(ctx context.Context, zone string, record libdns.Rec | |||
p.mutex.Lock() | |||
defer p.mutex.Unlock() | |||
|
|||
// there is some strange regexp in the api that prevents us from searching names ending with a dot | |||
// so we must ensure the names of the record is relative and does not end with a dot | |||
recRelativeName := strings.TrimRight(strings.TrimSuffix(record.Name, domain.Fqdn), ".") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact no we don't have a strange regexp in the api but this is a normal behavior.
When you specify this record in your BIND zone:
hello.skusku.pw IN A 3600 127.0.0.1
The record will be available in hello.skusku.pw.skusku.pw
because we wasn't added the point to mark the end of the FQDN (also named absolute record
in the RFC1035 (Domain names that end in a dot are called
absolute, and are taken as complete).
I think you already know that, just as reminder ;)
@@ -7,20 +7,20 @@ This package implements the [libdns interfaces](https://github.com/libdns/libdns | |||
|
|||
## Authenticating | |||
|
|||
This package supports **API Key authentication** but does not yet support **Sharing ID authentication**. Refer to the [LiveDNS documentation](https://doc.livedns.gandi.net/) for more information. | |||
This package only supports **API Key authentication**. Refer to the [Gandi's Public API documentation](https://api.gandi.net/docs/reference/#Authentication) for more information. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sharing ids are not an authentication mechanism. In fact a sharing id is the identifier of an organization.
Hello @obynio 👋 Here is my modifications to make the module working this the new LiveDNS API. I tested a couple of times and adding/append and deleting records works fine. It was the first time I played with Go, it was fun to understand how the module works and to contribute to it 😅
Soon it will disappear, don't worry about that 😉 |
Since April 2020 we (Gandi) have deprecated the old LiveDNS endpoint in favor of the new one that is part of our public API project.
This PR update the endpoint but also the link to the new documentation.
cc @grigouze @romuald