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

Add support for the DS record (with updated field names) #50

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions octodns_powerdns/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,15 @@ def _data_for_TLSA(self, rrset):
def _data_for_DS(self, rrset):
values = []
for record in rrset['records']:
(flags, protocol, algorithm, public_key) = record['content'].split(
(key_tag, algorithm, digest_type, digest) = record['content'].split(
' ', 3
)
values.append(
{
'flags': flags,
'protocol': protocol,
'key_tag': key_tag,
'algorithm': algorithm,
'public_key': public_key,
'digest_type': digest_type,
'digest': digest,
}
)
return {'type': rrset['type'], 'values': values, 'ttl': rrset['ttl']}
Expand Down Expand Up @@ -486,7 +486,7 @@ def _records_for_TLSA(self, record):
def _records_for_DS(self, record):
return [
{
'content': f'{v.flags} {v.protocol} {v.algorithm} {v.public_key}',
'content': f'{v.key_tag} {v.algorithm} {v.digest_type} {v.digest}',
'disabled': False,
}
for v in record.values
Expand Down
16 changes: 8 additions & 8 deletions tests/config/unit.tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
value: ca.unit.tests
- type: 'DS'
values:
- algorithm: 2
flags: 2371
protocol: 13
public_key: 0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
- algorithm: 13
digest: 0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
digest_type: 2
key_tag: 2371
_853._tcp:
type: TLSA
values:
Expand Down Expand Up @@ -186,10 +186,10 @@ sub:
- 7.2.3.4.
- type: 'DS'
values:
- algorithm: 2
flags: 12345
protocol: 13
public_key: 0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
- algorithm: 13
digest: 0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
digest_type: 2
key_tag: 12345
txt:
ttl: 600
type: TXT
Expand Down
Loading