Add support for Porkbun (closes #667) #1283
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds support for Porkbun and closes #667.
Porkbun API doesn't have credentials to authenticate with, then access domains; you just access the endpoint and pass in your secret keys via the POST body. As a result, I called
_list_records
in the_authenticate
function to determine whether the user had permissions to edit the DNS records for that domain.I ran both the provider file and the test file through
black
but let me know if that's not desired or if a different code style is preferred (black
was in thepoetry.lock
so I figured that you used that).I also censored out my IP address that is returned by the
/ping
endpoint from Porkbun, and I replaced the domain name I used withexample.xyz
. Hopefully I didn't miss any other sensitive data, but I'd appreciate a heads up in case you see something.Finally, the tests, when run against the live API, fail about halfway through with a 503 error. I think the API at some point stops responding to requests because it's either overloaded or it just doesn't let a specific user hit the API that hard. I stopped the tests halfway through and continued after a bit and they worked fine, though, so the recordings should be good.