Skip to content

Commit

Permalink
implement location version of pan-net-security#19
Browse files Browse the repository at this point in the history
  • Loading branch information
nickhilliard committed Nov 13, 2023
1 parent 8884479 commit 745a069
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions certbot_dns_powerdns/dns_powerdns.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,23 @@ def _setup_credentials(self):
'credentials',
'PowerDNS credentials file',
{
'zone': 'PowerDNS API zone',
'api-url': 'PowerDNS-compatible API FQDN',
'api-key': 'PowerDNS-compatible API key (X-API-Key)'
}
)

def _perform(self, domain, validation_name, validation):
self._get_powerdns_client().add_txt_record(
domain, validation_name, validation)
self.credentials.conf('zone'), validation_name, validation)

def _cleanup(self, domain, validation_name, validation):
self._get_powerdns_client().del_txt_record(
domain, validation_name, validation)
self.credentials.conf('zone'), validation_name, validation)

def _get_powerdns_client(self):
return _PowerDNSLexiconClient(
self.credentials.conf('zone'),
self.credentials.conf('api-url'),
self.credentials.conf('api-key'),
self.ttl
Expand All @@ -71,12 +73,13 @@ class _PowerDNSLexiconClient(dns_common_lexicon.LexiconClient):
Encapsulates all communication with the PowerDNS via Lexicon.
"""

def __init__(self, api_url, api_key, ttl):
def __init__(self, zone, api_url, api_key, ttl):
super(_PowerDNSLexiconClient, self).__init__()

config = dns_common_lexicon.build_lexicon_config('powerdns', {
'ttl': ttl,
}, {
'zone': zone,
'auth_token': api_key,
'pdns_server': api_url,
})
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from setuptools import setup
from setuptools import find_packages

version = "0.2.1"
version = "0.2.1.1"

with open('README.md') as f:
long_description = f.read()
Expand Down

0 comments on commit 745a069

Please sign in to comment.