Skip to content

Commit

Permalink
Merge pull request #92 from jmittermair/fix-caa-records-whitespace-split
Browse files Browse the repository at this point in the history
Fix CAA records whitespace splitting with additional optional properties
  • Loading branch information
ross authored May 8, 2024
2 parents d9b046b + 33acea1 commit 278a998
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v0.0.? - 2024-??-?? -

* Fix CAA rdata parsing to allow values with tags

## v0.0.7 - 2024-04-11 - Helps if you use the actual Session token

### Important
Expand Down
2 changes: 1 addition & 1 deletion octodns_route53/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,7 @@ def _data_for_geo(self, rrset):
def _data_for_CAA(self, rrset):
values = []
for rr in rrset['ResourceRecords']:
flags, tag, value = rr['Value'].split()
flags, tag, value = rr['Value'].split(' ', 2)
values.append({'flags': flags, 'tag': tag, 'value': value[1:-1]})
return {
'type': rrset['Type'],
Expand Down
12 changes: 10 additions & 2 deletions tests/test_octodns_provider_route53.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,11 @@ class TestRoute53Provider(TestCase):
{
'ttl': 69,
'type': 'CAA',
'value': {'flags': 0, 'tag': 'issue', 'value': 'ca.unit.tests'},
'value': {
'flags': 0,
'tag': 'issue',
'value': 'ca.unit.tests; cansignhttpexchanges=yes',
},
},
),
(
Expand Down Expand Up @@ -1125,7 +1129,11 @@ def test_populate(self):
{
'Name': 'unit.tests.',
'Type': 'CAA',
'ResourceRecords': [{'Value': '0 issue "ca.unit.tests"'}],
'ResourceRecords': [
{
'Value': '0 issue "ca.unit.tests; cansignhttpexchanges=yes"'
}
],
'TTL': 69,
},
{
Expand Down

0 comments on commit 278a998

Please sign in to comment.