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:
@@ -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):
|
||||
|
||||
@@ -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', {
|
||||
|
||||
Reference in New Issue
Block a user