Skip to content
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 dreamhost to use dns-list_records instead of domain-list_domains #998

Merged
merged 1 commit into from
Nov 3, 2021

Conversation

ryan953
Copy link
Contributor

@ryan953 ryan953 commented Oct 31, 2021

The Dreamhost api command domain-list_domains will be retired on Nov 2nd 2021.

This diff converts the _authenticate() method to use dns-list_records instead.

Fixes #974


The obvious difference between domain-list_domains and dns-list_records is that list_records will return any A, CNAME, MX, TXT (and so on) record in the Dreamhost account. Potentially a lot more information compared to the list of domains.

Using the test api token (scroll to "Test Account") we can see the difference in response size:

Before:

$ curl -so /dev/null "https://api.dreamhost.com/?key=6SHU5P2HLDAYECUM&cmd=domain-list_domains&format=json"  -w '%{size_download}'
752

After:

$ curl -so /dev/null "https://api.dreamhost.com/?key=6SHU5P2HLDAYECUM&cmd=dns-list_records&format=json"  -w '%{size_download}'
15940

This is just an example account but illustrates the difference. Any account could have a large number of domain, and/or a large number of records per domain.

I added the condition that the found record should be of type "A" or "AAAA". It's trivial for someone to add any domain (like facebook.com) to their account and create that record though. Doing so puts facebook.com in both the responses for both dns-list_records and domains-list_domains. I can see that behavior today in my account.
This means that _authenticate() wasn't, and still doesn't, do a strong ownership check of the domain name. Instead is does verify that the api token works. We shouldn't need that ownership check though, because if nameservers point somewhere else nothing will read that dns record.


The notice about all the deprecated Dreamhost API's is here, but it's likely to change after Nov 2nd. Copied here for reference:

Upcoming EOL

As of November 2, 2021, the following API commands will be removed and no longer function.

Account API commands
Domain API commands
Mail API commands
MySQL API commands
Rewards API commands
User API commands
The following three commands will continue to function normally.

Announcement List API commands
API metacommands
DNS API commands

@adferrand
Copy link
Collaborator

Thanks, I prepare a release right now.

@adferrand adferrand merged commit 1088fe3 into AnalogJ:master Nov 3, 2021
MasinAD pushed a commit to MasinAD/lexicon that referenced this pull request Mar 29, 2022
MasinAD pushed a commit to MasinAD/lexicon that referenced this pull request Mar 29, 2022
MasinAD pushed a commit to MasinAD/lexicon that referenced this pull request Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dreamhost integration will break November 2nd, 2021
2 participants