1
0
mirror of https://github.com/github/octodns.git synced 2024-05-11 05:55:00 +00:00

Add support for wildcard SRV records, as shown in RFC 2782

This commit is contained in:
Justin B Newman
2020-07-20 12:48:47 -05:00
parent 53194bd360
commit 427b8a1a06
2 changed files with 13 additions and 1 deletions

View File

@@ -1209,7 +1209,7 @@ class SrvValue(EqualityTupleMixin):
class SrvRecord(_ValuesMixin, Record):
_type = 'SRV'
_value_type = SrvValue
_name_re = re.compile(r'^_[^\.]+\.[^\.]+')
_name_re = re.compile(r'^(\*|_[^\.]+)\.[^\.]+')
@classmethod
def validate(cls, name, fqdn, data):

View File

@@ -2155,6 +2155,18 @@ class TestRecordValidation(TestCase):
}
})
# permit wildcard entries
Record.new(self.zone, '*._tcp', {
'type': 'SRV',
'ttl': 600,
'value': {
'priority': 1,
'weight': 2,
'port': 3,
'target': 'food.bar.baz.'
}
})
# invalid name
with self.assertRaises(ValidationError) as ctx:
Record.new(self.zone, 'neup', {