Skip to content

Commit

Permalink
Add support for the PowerDNS-Admin API
Browse files Browse the repository at this point in the history
  • Loading branch information
tmuncks committed Oct 20, 2021
1 parent 8884479 commit a281298
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ certbot-dns-powerdns

PowerDNS DNS Authenticator plugin for [Certbot](https://certbot.eff.org/).

Compatibility:
* PowerDNS Authoritative Server API
* PowerDNS-Admin API

This plugin is built from the ground up and follows the development style and life-cycle
of other `certbot-dns-*` plugins found in the
[Official Certbot Repository](https://github.com/certbot/certbot).
Expand Down
12 changes: 5 additions & 7 deletions certbot_dns_powerdns/dns_powerdns.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,9 @@ def __init__(self, api_url, api_key, ttl):
self.provider = powerdns.Provider(config)

def _handle_http_error(self, e, domain_name):
if domain_name in str(e) and (
# 4.0 and 4.1 compatibility
str(e).startswith('422 Client Error: Unprocessable Entity for url:') or
# 4.2
str(e).startswith('404 Client Error: Not Found for url:')
):
return # Expected errors when zone name guess is wrong
# Depending on server and API version, we expect certain error codes while trying
# to guess the correct zone name. Ignore.
if domain_name in e.response.url and e.response.status_code in [403, 404, 422]:
return

return super(_PowerDNSLexiconClient, self)._handle_http_error(e, domain_name)

0 comments on commit a281298

Please sign in to comment.