Add DS records to reverse zone

This commit is contained in:
Sebastian Lohff 2019-05-31 12:52:46 +02:00
parent ef5afbfe3a
commit 39b65ceba0
2 changed files with 10 additions and 6 deletions

View File

@ -210,7 +210,7 @@ class NameserverForm(MntFormMixin, WhoisObjectFormMixin, forms.ModelForm):
return cleaned_data return cleaned_data
class ReverseZoneForm(forms.ModelForm): class ReverseZoneForm(DSRecordMixin, forms.ModelForm):
prefix = forms.CharField(validators=[IP46CIDRValidator]) prefix = forms.CharField(validators=[IP46CIDRValidator])
class Meta: class Meta:

View File

@ -13,6 +13,13 @@ import ipaddress
# allow owners of a subnet to create reverse dns record? # allow owners of a subnet to create reverse dns record?
class DSRecordModelMixin(models.Model):
class Meta:
abstract = True
ds_records = models.TextField(blank=True, verbose_name='DS Records',
help_text='DS Records in the format of [id] [crypto-algo] [hash-algo] [hash]')
class Nameserver(MntdObject): class Nameserver(MntdObject):
handleSuffix = "NS" handleSuffix = "NS"
# dns name # dns name
@ -42,7 +49,7 @@ class Nameserver(MntdObject):
return [] return []
class Domain(MntdObject): class Domain(DSRecordModelMixin, MntdObject):
handle = None handle = None
handleSuffix = "DOM" handleSuffix = "DOM"
name = models.CharField(max_length=67, unique=True, db_index=True) name = models.CharField(max_length=67, unique=True, db_index=True)
@ -50,9 +57,6 @@ class Domain(MntdObject):
nameservers = models.ManyToManyField(Nameserver, blank=True) nameservers = models.ManyToManyField(Nameserver, blank=True)
admin_c = models.ManyToManyField(Contact) admin_c = models.ManyToManyField(Contact)
ds_records = models.TextField(blank=True, verbose_name='DS Records',
help_text='DS Records in the format of [id] [crypto-algo] [hash-algo] [hash]')
def getPK(self): def getPK(self):
return self.name return self.name
@ -85,7 +89,7 @@ class Domain(MntdObject):
return name.lower() return name.lower()
class ReverseZone(WhoisObject): class ReverseZone(DSRecordModelMixin, WhoisObject):
handle = None handle = None
parentNet = models.ForeignKey(InetNum) parentNet = models.ForeignKey(InetNum)