Browse Source

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

pull/588/head
Justin B Newman 5 years ago
parent
commit
427b8a1a06
2 changed files with 13 additions and 1 deletions
  1. +1
    -1
      octodns/record/__init__.py
  2. +12
    -0
      tests/test_octodns_record.py

+ 1
- 1
octodns/record/__init__.py 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):


+ 12
- 0
tests/test_octodns_record.py 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', {


Loading…
Cancel
Save