netbox-plugin-dns 1.2.6__py3-none-any.whl → 1.2.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of netbox-plugin-dns might be problematic. Click here for more details.
- netbox_dns/__init__.py +16 -8
- netbox_dns/api/field_serializers.py +25 -0
- netbox_dns/api/nested_serializers.py +19 -1
- netbox_dns/api/serializers.py +3 -0
- netbox_dns/api/serializers_/dnssec_key_template.py +59 -0
- netbox_dns/api/serializers_/dnssec_policy.py +113 -0
- netbox_dns/api/serializers_/record.py +2 -0
- netbox_dns/api/serializers_/record_template.py +2 -0
- netbox_dns/api/serializers_/zone.py +20 -1
- netbox_dns/api/serializers_/zone_template.py +13 -4
- netbox_dns/api/urls.py +4 -0
- netbox_dns/api/views.py +18 -0
- netbox_dns/choices/__init__.py +2 -0
- netbox_dns/choices/dnssec_key_template.py +63 -0
- netbox_dns/choices/dnssec_policy.py +40 -0
- netbox_dns/choices/record.py +2 -25
- netbox_dns/choices/utilities.py +26 -0
- netbox_dns/choices/zone.py +96 -1
- netbox_dns/fields/__init__.py +1 -0
- netbox_dns/fields/choice_array.py +33 -0
- netbox_dns/fields/timeperiod.py +15 -13
- netbox_dns/filtersets/__init__.py +3 -0
- netbox_dns/filtersets/dnssec_key_template.py +51 -0
- netbox_dns/filtersets/dnssec_policy.py +97 -0
- netbox_dns/filtersets/zone.py +30 -6
- netbox_dns/filtersets/zone_template.py +13 -2
- netbox_dns/forms/__init__.py +2 -0
- netbox_dns/forms/dnssec_key_template.py +189 -0
- netbox_dns/forms/dnssec_policy.py +593 -0
- netbox_dns/forms/nameserver.py +2 -0
- netbox_dns/forms/record_template.py +1 -0
- netbox_dns/forms/zone.py +120 -9
- netbox_dns/forms/zone_template.py +38 -0
- netbox_dns/graphql/__init__.py +7 -3
- netbox_dns/graphql/filters.py +16 -0
- netbox_dns/graphql/schema.py +20 -0
- netbox_dns/graphql/types.py +67 -3
- netbox_dns/locale/de/LC_MESSAGES/django.mo +0 -0
- netbox_dns/locale/fr/LC_MESSAGES/django.mo +0 -0
- netbox_dns/migrations/0015_dnssec.py +168 -0
- netbox_dns/migrations/0016_dnssec_policy_status.py +18 -0
- netbox_dns/migrations/0017_dnssec_policy_zone_zone_template.py +41 -0
- netbox_dns/migrations/0018_zone_domain_status_zone_expiration_date.py +23 -0
- netbox_dns/models/__init__.py +2 -0
- netbox_dns/models/dnssec_key_template.py +114 -0
- netbox_dns/models/dnssec_policy.py +203 -0
- netbox_dns/models/record.py +1 -1
- netbox_dns/models/zone.py +74 -19
- netbox_dns/models/zone_template.py +17 -7
- netbox_dns/navigation.py +49 -0
- netbox_dns/signals/dnssec.py +32 -0
- netbox_dns/tables/__init__.py +2 -0
- netbox_dns/tables/dnssec_key_template.py +48 -0
- netbox_dns/tables/dnssec_policy.py +131 -0
- netbox_dns/tables/zone.py +23 -2
- netbox_dns/tables/zone_template.py +4 -0
- netbox_dns/template_content.py +2 -1
- netbox_dns/templates/netbox_dns/dnsseckeytemplate.html +70 -0
- netbox_dns/templates/netbox_dns/dnssecpolicy.html +155 -0
- netbox_dns/templates/netbox_dns/zone/registration.html +19 -0
- netbox_dns/templates/netbox_dns/zone.html +16 -0
- netbox_dns/templates/netbox_dns/zonetemplate/child.html +46 -0
- netbox_dns/templates/netbox_dns/zonetemplate.html +12 -0
- netbox_dns/urls.py +23 -0
- netbox_dns/utilities/conversions.py +13 -0
- netbox_dns/validators/__init__.py +1 -0
- netbox_dns/validators/dnssec.py +148 -0
- netbox_dns/views/__init__.py +2 -0
- netbox_dns/views/dnssec_key_template.py +87 -0
- netbox_dns/views/dnssec_policy.py +155 -0
- netbox_dns/views/zone.py +11 -1
- {netbox_plugin_dns-1.2.6.dist-info → netbox_plugin_dns-1.2.7.dist-info}/METADATA +3 -2
- {netbox_plugin_dns-1.2.6.dist-info → netbox_plugin_dns-1.2.7.dist-info}/RECORD +76 -50
- {netbox_plugin_dns-1.2.6.dist-info → netbox_plugin_dns-1.2.7.dist-info}/WHEEL +1 -1
- {netbox_plugin_dns-1.2.6.dist-info → netbox_plugin_dns-1.2.7.dist-info/licenses}/LICENSE +0 -0
- {netbox_plugin_dns-1.2.6.dist-info → netbox_plugin_dns-1.2.7.dist-info}/top_level.txt +0 -0
netbox_dns/forms/zone.py
CHANGED
|
@@ -23,7 +23,7 @@ from utilities.forms.fields import (
|
|
|
23
23
|
DynamicModelChoiceField,
|
|
24
24
|
)
|
|
25
25
|
from utilities.release import load_release_data
|
|
26
|
-
from utilities.forms.widgets import BulkEditNullBooleanSelect
|
|
26
|
+
from utilities.forms.widgets import BulkEditNullBooleanSelect, DatePicker
|
|
27
27
|
from utilities.forms.rendering import FieldSet
|
|
28
28
|
from utilities.forms import BOOLEAN_WITH_BLANK_CHOICES, add_blank_choice
|
|
29
29
|
from tenancy.models import Tenant, TenantGroup
|
|
@@ -36,8 +36,9 @@ from netbox_dns.models import (
|
|
|
36
36
|
Registrar,
|
|
37
37
|
RegistrationContact,
|
|
38
38
|
ZoneTemplate,
|
|
39
|
+
DNSSECPolicy,
|
|
39
40
|
)
|
|
40
|
-
from netbox_dns.choices import ZoneStatusChoices
|
|
41
|
+
from netbox_dns.choices import ZoneStatusChoices, ZoneEPPStatusChoices
|
|
41
42
|
from netbox_dns.utilities import name_to_unicode, network_to_reverse
|
|
42
43
|
from netbox_dns.fields import RFC2317NetworkFormField, TimePeriodField
|
|
43
44
|
from netbox_dns.validators import validate_ipv4, validate_prefix, validate_rfc2317
|
|
@@ -58,10 +59,21 @@ class RollbackTransaction(Exception):
|
|
|
58
59
|
|
|
59
60
|
|
|
60
61
|
class ZoneTemplateUpdateMixin:
|
|
62
|
+
def _check_soa_mname(self):
|
|
63
|
+
if (
|
|
64
|
+
self.cleaned_data.get("soa_mname") is None
|
|
65
|
+
and "soa_mname" in self.fields.keys()
|
|
66
|
+
):
|
|
67
|
+
self.add_error(
|
|
68
|
+
"soa_mname",
|
|
69
|
+
_("soa_mname not set and no template or default value defined"),
|
|
70
|
+
)
|
|
71
|
+
|
|
61
72
|
def clean(self, *args, **kwargs):
|
|
62
73
|
super().clean(*args, **kwargs)
|
|
63
74
|
|
|
64
75
|
if (template := self.cleaned_data.get("template")) is None:
|
|
76
|
+
self._check_soa_mname()
|
|
65
77
|
return
|
|
66
78
|
|
|
67
79
|
if not self.cleaned_data.get("nameservers") and template.nameservers.all():
|
|
@@ -76,11 +88,7 @@ class ZoneTemplateUpdateMixin:
|
|
|
76
88
|
) not in (None, ""):
|
|
77
89
|
self.cleaned_data[field] = getattr(template, field)
|
|
78
90
|
|
|
79
|
-
|
|
80
|
-
self.add_error(
|
|
81
|
-
"soa_mname",
|
|
82
|
-
_("soa_mname not set and no template or default value defined"),
|
|
83
|
-
)
|
|
91
|
+
self._check_soa_mname()
|
|
84
92
|
|
|
85
93
|
if self.errors:
|
|
86
94
|
return
|
|
@@ -271,6 +279,11 @@ class ZoneForm(ZoneTemplateUpdateMixin, TenancyForm, NetBoxModelForm):
|
|
|
271
279
|
"soa_serial",
|
|
272
280
|
name=_("SOA"),
|
|
273
281
|
),
|
|
282
|
+
FieldSet(
|
|
283
|
+
"dnssec_policy",
|
|
284
|
+
"inline_signing",
|
|
285
|
+
name=_("DNSSEC"),
|
|
286
|
+
),
|
|
274
287
|
FieldSet(
|
|
275
288
|
"rfc2317_prefix",
|
|
276
289
|
"rfc2317_parent_managed",
|
|
@@ -279,6 +292,8 @@ class ZoneForm(ZoneTemplateUpdateMixin, TenancyForm, NetBoxModelForm):
|
|
|
279
292
|
FieldSet(
|
|
280
293
|
"registrar",
|
|
281
294
|
"registry_domain_id",
|
|
295
|
+
"expiration_date",
|
|
296
|
+
"domain_status",
|
|
282
297
|
"registrant",
|
|
283
298
|
"admin_c",
|
|
284
299
|
"tech_c",
|
|
@@ -369,8 +384,12 @@ class ZoneForm(ZoneTemplateUpdateMixin, TenancyForm, NetBoxModelForm):
|
|
|
369
384
|
"soa_minimum",
|
|
370
385
|
"rfc2317_prefix",
|
|
371
386
|
"rfc2317_parent_managed",
|
|
387
|
+
"dnssec_policy",
|
|
388
|
+
"inline_signing",
|
|
372
389
|
"registrar",
|
|
373
390
|
"registry_domain_id",
|
|
391
|
+
"expiration_date",
|
|
392
|
+
"domain_status",
|
|
374
393
|
"registrant",
|
|
375
394
|
"admin_c",
|
|
376
395
|
"tech_c",
|
|
@@ -379,8 +398,8 @@ class ZoneForm(ZoneTemplateUpdateMixin, TenancyForm, NetBoxModelForm):
|
|
|
379
398
|
"tenant",
|
|
380
399
|
"tags",
|
|
381
400
|
)
|
|
382
|
-
|
|
383
|
-
"
|
|
401
|
+
widgets = {
|
|
402
|
+
"expiration_date": DatePicker,
|
|
384
403
|
}
|
|
385
404
|
|
|
386
405
|
|
|
@@ -403,6 +422,11 @@ class ZoneFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
|
403
422
|
"soa_serial_auto",
|
|
404
423
|
name=_("SOA"),
|
|
405
424
|
),
|
|
425
|
+
FieldSet(
|
|
426
|
+
"dnssec_policy_id",
|
|
427
|
+
"inline_signing",
|
|
428
|
+
name=_("DNSSEC"),
|
|
429
|
+
),
|
|
406
430
|
FieldSet(
|
|
407
431
|
"rfc2317_prefix",
|
|
408
432
|
"rfc2317_parent_managed",
|
|
@@ -412,6 +436,9 @@ class ZoneFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
|
412
436
|
FieldSet(
|
|
413
437
|
"registrar_id",
|
|
414
438
|
"registry_domain_id",
|
|
439
|
+
"expiration_date_before",
|
|
440
|
+
"expiration_date_after",
|
|
441
|
+
"domain_status",
|
|
415
442
|
"registrant_id",
|
|
416
443
|
"admin_c_id",
|
|
417
444
|
"tech_c_id",
|
|
@@ -438,6 +465,7 @@ class ZoneFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
|
438
465
|
nameserver_id = DynamicModelMultipleChoiceField(
|
|
439
466
|
queryset=NameServer.objects.all(),
|
|
440
467
|
required=False,
|
|
468
|
+
null_option=_("None"),
|
|
441
469
|
label=_("Nameservers"),
|
|
442
470
|
)
|
|
443
471
|
active = forms.NullBooleanField(
|
|
@@ -475,35 +503,67 @@ class ZoneFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
|
475
503
|
rfc2317_parent_zone_id = DynamicModelMultipleChoiceField(
|
|
476
504
|
queryset=Zone.objects.all(),
|
|
477
505
|
required=False,
|
|
506
|
+
null_option=_("None"),
|
|
478
507
|
label=_("Parent Zone"),
|
|
479
508
|
)
|
|
509
|
+
dnssec_policy_id = DynamicModelMultipleChoiceField(
|
|
510
|
+
queryset=DNSSECPolicy.objects.all(),
|
|
511
|
+
required=False,
|
|
512
|
+
null_option=_("None"),
|
|
513
|
+
label=_("DNSSEC Policy"),
|
|
514
|
+
)
|
|
515
|
+
inline_signing = forms.NullBooleanField(
|
|
516
|
+
required=False,
|
|
517
|
+
widget=forms.Select(choices=BOOLEAN_WITH_BLANK_CHOICES),
|
|
518
|
+
label=_("Use Inline Signing"),
|
|
519
|
+
)
|
|
480
520
|
registrar_id = DynamicModelMultipleChoiceField(
|
|
481
521
|
queryset=Registrar.objects.all(),
|
|
482
522
|
required=False,
|
|
523
|
+
null_option=_("None"),
|
|
483
524
|
label=_("Registrar"),
|
|
484
525
|
)
|
|
485
526
|
registry_domain_id = forms.CharField(
|
|
486
527
|
required=False,
|
|
487
528
|
label=_("Registry Domain ID"),
|
|
488
529
|
)
|
|
530
|
+
expiration_date_after = forms.DateField(
|
|
531
|
+
required=False,
|
|
532
|
+
label=_("Expiration Date after"),
|
|
533
|
+
widget=DatePicker,
|
|
534
|
+
)
|
|
535
|
+
expiration_date_before = forms.DateField(
|
|
536
|
+
required=False,
|
|
537
|
+
label=_("Expiration Date before"),
|
|
538
|
+
widget=DatePicker,
|
|
539
|
+
)
|
|
540
|
+
domain_status = forms.MultipleChoiceField(
|
|
541
|
+
choices=ZoneEPPStatusChoices,
|
|
542
|
+
required=False,
|
|
543
|
+
label=_("Domain Status"),
|
|
544
|
+
)
|
|
489
545
|
registrant_id = DynamicModelMultipleChoiceField(
|
|
490
546
|
queryset=RegistrationContact.objects.all(),
|
|
491
547
|
required=False,
|
|
548
|
+
null_option=_("None"),
|
|
492
549
|
label=_("Registrant"),
|
|
493
550
|
)
|
|
494
551
|
admin_c_id = DynamicModelMultipleChoiceField(
|
|
495
552
|
queryset=RegistrationContact.objects.all(),
|
|
496
553
|
required=False,
|
|
554
|
+
null_option=_("None"),
|
|
497
555
|
label=_("Administrative Contact"),
|
|
498
556
|
)
|
|
499
557
|
tech_c_id = DynamicModelMultipleChoiceField(
|
|
500
558
|
queryset=RegistrationContact.objects.all(),
|
|
501
559
|
required=False,
|
|
560
|
+
null_option=_("None"),
|
|
502
561
|
label=_("Technical Contact"),
|
|
503
562
|
)
|
|
504
563
|
billing_c_id = DynamicModelMultipleChoiceField(
|
|
505
564
|
queryset=RegistrationContact.objects.all(),
|
|
506
565
|
required=False,
|
|
566
|
+
null_option=_("None"),
|
|
507
567
|
label=_("Billing Contact"),
|
|
508
568
|
)
|
|
509
569
|
tag = TagFilterField(Zone)
|
|
@@ -594,6 +654,19 @@ class ZoneImportForm(ZoneTemplateUpdateMixin, NetBoxModelImportForm):
|
|
|
594
654
|
),
|
|
595
655
|
label=_("RFC2317 Parent Managed"),
|
|
596
656
|
)
|
|
657
|
+
dnssec_policy = CSVModelChoiceField(
|
|
658
|
+
queryset=DNSSECPolicy.objects.all(),
|
|
659
|
+
required=False,
|
|
660
|
+
to_field_name="name",
|
|
661
|
+
error_messages={
|
|
662
|
+
"invalid_choice": _("DNSSEC policy %(value)s not found"),
|
|
663
|
+
},
|
|
664
|
+
label=_("DNSSEC Policy"),
|
|
665
|
+
)
|
|
666
|
+
inline_signing = forms.BooleanField(
|
|
667
|
+
required=False,
|
|
668
|
+
label=_("Use Inline Signing"),
|
|
669
|
+
)
|
|
597
670
|
registrar = CSVModelChoiceField(
|
|
598
671
|
queryset=Registrar.objects.all(),
|
|
599
672
|
required=False,
|
|
@@ -607,6 +680,11 @@ class ZoneImportForm(ZoneTemplateUpdateMixin, NetBoxModelImportForm):
|
|
|
607
680
|
required=False,
|
|
608
681
|
label=_("Registry Domain ID"),
|
|
609
682
|
)
|
|
683
|
+
domain_status = CSVChoiceField(
|
|
684
|
+
choices=ZoneEPPStatusChoices,
|
|
685
|
+
required=False,
|
|
686
|
+
label=_("Domain Status"),
|
|
687
|
+
)
|
|
610
688
|
registrant = CSVModelChoiceField(
|
|
611
689
|
queryset=RegistrationContact.objects.all(),
|
|
612
690
|
required=False,
|
|
@@ -676,10 +754,14 @@ class ZoneImportForm(ZoneTemplateUpdateMixin, NetBoxModelImportForm):
|
|
|
676
754
|
"soa_retry",
|
|
677
755
|
"soa_expire",
|
|
678
756
|
"soa_minimum",
|
|
757
|
+
"dnssec_policy",
|
|
758
|
+
"inline_signing",
|
|
679
759
|
"rfc2317_prefix",
|
|
680
760
|
"rfc2317_parent_managed",
|
|
681
761
|
"registrar",
|
|
682
762
|
"registry_domain_id",
|
|
763
|
+
"expiration_date",
|
|
764
|
+
"domain_status",
|
|
683
765
|
"registrant",
|
|
684
766
|
"admin_c",
|
|
685
767
|
"tech_c",
|
|
@@ -794,6 +876,16 @@ class ZoneBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
794
876
|
),
|
|
795
877
|
label=_("RFC2317 Parent Managed"),
|
|
796
878
|
)
|
|
879
|
+
dnssec_policy = DynamicModelChoiceField(
|
|
880
|
+
queryset=DNSSECPolicy.objects.all(),
|
|
881
|
+
required=False,
|
|
882
|
+
label=_("DNSSEC Policy"),
|
|
883
|
+
)
|
|
884
|
+
inline_signing = forms.NullBooleanField(
|
|
885
|
+
required=False,
|
|
886
|
+
widget=BulkEditNullBooleanSelect(),
|
|
887
|
+
label=_("Use Inline Signing"),
|
|
888
|
+
)
|
|
797
889
|
registrar = DynamicModelChoiceField(
|
|
798
890
|
queryset=Registrar.objects.all(),
|
|
799
891
|
required=False,
|
|
@@ -803,6 +895,16 @@ class ZoneBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
803
895
|
required=False,
|
|
804
896
|
label=_("Registry Domain ID"),
|
|
805
897
|
)
|
|
898
|
+
expiration_date = forms.DateField(
|
|
899
|
+
required=False,
|
|
900
|
+
label=_("Expiration Date"),
|
|
901
|
+
widget=DatePicker,
|
|
902
|
+
)
|
|
903
|
+
domain_status = forms.ChoiceField(
|
|
904
|
+
choices=add_blank_choice(ZoneEPPStatusChoices),
|
|
905
|
+
required=False,
|
|
906
|
+
label=_("Domain Status"),
|
|
907
|
+
)
|
|
806
908
|
registrant = DynamicModelChoiceField(
|
|
807
909
|
queryset=RegistrationContact.objects.all(),
|
|
808
910
|
required=False,
|
|
@@ -857,6 +959,11 @@ class ZoneBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
857
959
|
"soa_serial",
|
|
858
960
|
name=_("SOA"),
|
|
859
961
|
),
|
|
962
|
+
FieldSet(
|
|
963
|
+
"dnssec_policy",
|
|
964
|
+
"inline_signing",
|
|
965
|
+
name=_("DNSSEC"),
|
|
966
|
+
),
|
|
860
967
|
FieldSet(
|
|
861
968
|
"rfc2317_prefix",
|
|
862
969
|
"rfc2317_parent_managed",
|
|
@@ -865,6 +972,8 @@ class ZoneBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
865
972
|
FieldSet(
|
|
866
973
|
"registrar",
|
|
867
974
|
"registry_domain_id",
|
|
975
|
+
"expiration_date",
|
|
976
|
+
"domain_status",
|
|
868
977
|
"registrant",
|
|
869
978
|
"admin_c",
|
|
870
979
|
"tech_c",
|
|
@@ -879,6 +988,8 @@ class ZoneBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
879
988
|
"nameservers",
|
|
880
989
|
"rfc2317_prefix",
|
|
881
990
|
"registrar",
|
|
991
|
+
"expiration_date",
|
|
992
|
+
"domain_status",
|
|
882
993
|
"registry_domain_id",
|
|
883
994
|
"registrant",
|
|
884
995
|
"admin_c",
|
|
@@ -27,6 +27,7 @@ from netbox_dns.models import (
|
|
|
27
27
|
NameServer,
|
|
28
28
|
Registrar,
|
|
29
29
|
RegistrationContact,
|
|
30
|
+
DNSSECPolicy,
|
|
30
31
|
)
|
|
31
32
|
|
|
32
33
|
|
|
@@ -62,6 +63,7 @@ class ZoneTemplateForm(TenancyForm, NetBoxModelForm):
|
|
|
62
63
|
FieldSet("name", "description", "nameservers", name=_("Zone Template")),
|
|
63
64
|
FieldSet("soa_mname", "soa_rname", name=_("SOA")),
|
|
64
65
|
FieldSet("record_templates", name=_("Record Templates")),
|
|
66
|
+
FieldSet("dnssec_policy", name=_("DNSSEC")),
|
|
65
67
|
FieldSet(
|
|
66
68
|
"registrar",
|
|
67
69
|
"registrant",
|
|
@@ -82,6 +84,7 @@ class ZoneTemplateForm(TenancyForm, NetBoxModelForm):
|
|
|
82
84
|
"nameservers",
|
|
83
85
|
"soa_mname",
|
|
84
86
|
"soa_rname",
|
|
87
|
+
"dnssec_policy",
|
|
85
88
|
"record_templates",
|
|
86
89
|
"description",
|
|
87
90
|
"registrar",
|
|
@@ -105,6 +108,7 @@ class ZoneTemplateFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
|
105
108
|
FieldSet("name", "nameserver_id", "description", name=_("Attributes")),
|
|
106
109
|
FieldSet("soa_mname_id", "soa_rname", name=_("SOA")),
|
|
107
110
|
FieldSet("record_template_id", name=_("Record Templates")),
|
|
111
|
+
FieldSet("dnssec_policy", name=_("DNSSEC")),
|
|
108
112
|
FieldSet(
|
|
109
113
|
"registrar_id",
|
|
110
114
|
"registrant_id",
|
|
@@ -123,11 +127,13 @@ class ZoneTemplateFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
|
123
127
|
nameserver_id = DynamicModelMultipleChoiceField(
|
|
124
128
|
queryset=NameServer.objects.all(),
|
|
125
129
|
required=False,
|
|
130
|
+
null_option=_("None"),
|
|
126
131
|
label=_("Nameservers"),
|
|
127
132
|
)
|
|
128
133
|
soa_mname_id = DynamicModelMultipleChoiceField(
|
|
129
134
|
queryset=NameServer.objects.all(),
|
|
130
135
|
required=False,
|
|
136
|
+
null_option=_("None"),
|
|
131
137
|
label=_("MName"),
|
|
132
138
|
)
|
|
133
139
|
soa_rname = forms.CharField(
|
|
@@ -137,34 +143,46 @@ class ZoneTemplateFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
|
137
143
|
record_template_id = DynamicModelMultipleChoiceField(
|
|
138
144
|
queryset=RecordTemplate.objects.all(),
|
|
139
145
|
required=False,
|
|
146
|
+
null_option=_("None"),
|
|
140
147
|
label=_("Record Templates"),
|
|
141
148
|
)
|
|
142
149
|
description = forms.CharField(
|
|
143
150
|
required=False,
|
|
144
151
|
)
|
|
152
|
+
dnssec_policy_id = DynamicModelMultipleChoiceField(
|
|
153
|
+
queryset=DNSSECPolicy.objects.all(),
|
|
154
|
+
required=False,
|
|
155
|
+
null_option=_("None"),
|
|
156
|
+
label=_("DNSSEC Policy ID"),
|
|
157
|
+
)
|
|
145
158
|
registrar_id = DynamicModelMultipleChoiceField(
|
|
146
159
|
queryset=Registrar.objects.all(),
|
|
147
160
|
required=False,
|
|
161
|
+
null_option=_("None"),
|
|
148
162
|
label=_("Registrar"),
|
|
149
163
|
)
|
|
150
164
|
registrant_id = DynamicModelMultipleChoiceField(
|
|
151
165
|
queryset=RegistrationContact.objects.all(),
|
|
152
166
|
required=False,
|
|
167
|
+
null_option=_("None"),
|
|
153
168
|
label=_("Registrant"),
|
|
154
169
|
)
|
|
155
170
|
admin_c_id = DynamicModelMultipleChoiceField(
|
|
156
171
|
queryset=RegistrationContact.objects.all(),
|
|
157
172
|
required=False,
|
|
173
|
+
null_option=_("None"),
|
|
158
174
|
label=_("Administrative Contact"),
|
|
159
175
|
)
|
|
160
176
|
tech_c_id = DynamicModelMultipleChoiceField(
|
|
161
177
|
queryset=RegistrationContact.objects.all(),
|
|
162
178
|
required=False,
|
|
179
|
+
null_option=_("None"),
|
|
163
180
|
label=_("Technical Contact"),
|
|
164
181
|
)
|
|
165
182
|
billing_c_id = DynamicModelMultipleChoiceField(
|
|
166
183
|
queryset=RegistrationContact.objects.all(),
|
|
167
184
|
required=False,
|
|
185
|
+
null_option=_("None"),
|
|
168
186
|
label=_("Billing Contact"),
|
|
169
187
|
)
|
|
170
188
|
tag = TagFilterField(ZoneTemplate)
|
|
@@ -189,6 +207,15 @@ class ZoneTemplateImportForm(NetBoxModelImportForm):
|
|
|
189
207
|
required=False,
|
|
190
208
|
label=_("Record Templates"),
|
|
191
209
|
)
|
|
210
|
+
dnssec_policy = CSVModelChoiceField(
|
|
211
|
+
queryset=DNSSECPolicy.objects.all(),
|
|
212
|
+
required=False,
|
|
213
|
+
to_field_name="name",
|
|
214
|
+
error_messages={
|
|
215
|
+
"invalid_choice": _("DNSSEC policy %(value)s not found"),
|
|
216
|
+
},
|
|
217
|
+
label=_("DNSSEC Policy"),
|
|
218
|
+
)
|
|
192
219
|
registrar = CSVModelChoiceField(
|
|
193
220
|
queryset=Registrar.objects.all(),
|
|
194
221
|
required=False,
|
|
@@ -250,6 +277,7 @@ class ZoneTemplateImportForm(NetBoxModelImportForm):
|
|
|
250
277
|
"soa_mname",
|
|
251
278
|
"soa_rname",
|
|
252
279
|
"record_templates",
|
|
280
|
+
"dnssec_policy",
|
|
253
281
|
"description",
|
|
254
282
|
"registrar",
|
|
255
283
|
"registrant",
|
|
@@ -281,6 +309,11 @@ class ZoneTemplateBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
281
309
|
description = forms.CharField(
|
|
282
310
|
max_length=200, required=False, label=_("Description")
|
|
283
311
|
)
|
|
312
|
+
dnssec_policy = DynamicModelChoiceField(
|
|
313
|
+
queryset=DNSSECPolicy.objects.all(),
|
|
314
|
+
required=False,
|
|
315
|
+
label=_("DNSSEC Policy"),
|
|
316
|
+
)
|
|
284
317
|
registrar = DynamicModelChoiceField(
|
|
285
318
|
queryset=Registrar.objects.all(),
|
|
286
319
|
required=False,
|
|
@@ -334,6 +367,10 @@ class ZoneTemplateBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
334
367
|
"record_templates",
|
|
335
368
|
name=_("Record Templates"),
|
|
336
369
|
),
|
|
370
|
+
FieldSet(
|
|
371
|
+
"dnssec_policy",
|
|
372
|
+
name=_("DNSSEC"),
|
|
373
|
+
),
|
|
337
374
|
FieldSet(
|
|
338
375
|
"registrar",
|
|
339
376
|
"registrant",
|
|
@@ -351,6 +388,7 @@ class ZoneTemplateBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
351
388
|
"soa_mname",
|
|
352
389
|
"soa_rname",
|
|
353
390
|
"record_templates",
|
|
391
|
+
"dnssec_policy",
|
|
354
392
|
"registrar",
|
|
355
393
|
"registrant",
|
|
356
394
|
"admin_c",
|
netbox_dns/graphql/__init__.py
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
from .schema import (
|
|
2
|
-
NetBoxDNSViewQuery,
|
|
3
2
|
NetBoxDNSNameServerQuery,
|
|
4
|
-
|
|
5
|
-
NetBoxDNSRegistrarQuery,
|
|
3
|
+
NetBoxDNSViewQuery,
|
|
6
4
|
NetBoxDNSZoneQuery,
|
|
7
5
|
NetBoxDNSRecordQuery,
|
|
6
|
+
NetBoxDNSDNSSECKeyTemplateQuery,
|
|
7
|
+
NetBoxDNSDNSSECPolicyQuery,
|
|
8
|
+
NetBoxDNSRegistrationContactQuery,
|
|
9
|
+
NetBoxDNSRegistrarQuery,
|
|
8
10
|
NetBoxDNSZoneTemplateQuery,
|
|
9
11
|
NetBoxDNSRecordTemplateQuery,
|
|
10
12
|
)
|
|
@@ -14,6 +16,8 @@ schema = [
|
|
|
14
16
|
NetBoxDNSViewQuery,
|
|
15
17
|
NetBoxDNSZoneQuery,
|
|
16
18
|
NetBoxDNSRecordQuery,
|
|
19
|
+
NetBoxDNSDNSSECKeyTemplateQuery,
|
|
20
|
+
NetBoxDNSDNSSECPolicyQuery,
|
|
17
21
|
NetBoxDNSRegistrationContactQuery,
|
|
18
22
|
NetBoxDNSRegistrarQuery,
|
|
19
23
|
NetBoxDNSZoneTemplateQuery,
|
netbox_dns/graphql/filters.py
CHANGED
|
@@ -7,6 +7,8 @@ from netbox_dns.models import (
|
|
|
7
7
|
View,
|
|
8
8
|
Zone,
|
|
9
9
|
Record,
|
|
10
|
+
DNSSECKeyTemplate,
|
|
11
|
+
DNSSECPolicy,
|
|
10
12
|
RegistrationContact,
|
|
11
13
|
Registrar,
|
|
12
14
|
ZoneTemplate,
|
|
@@ -17,6 +19,8 @@ from netbox_dns.filtersets import (
|
|
|
17
19
|
ViewFilterSet,
|
|
18
20
|
ZoneFilterSet,
|
|
19
21
|
RecordFilterSet,
|
|
22
|
+
DNSSECKeyTemplateFilterSet,
|
|
23
|
+
DNSSECPolicyFilterSet,
|
|
20
24
|
RegistrationContactFilterSet,
|
|
21
25
|
RegistrarFilterSet,
|
|
22
26
|
ZoneTemplateFilterSet,
|
|
@@ -48,6 +52,18 @@ class NetBoxDNSRecordFilter(BaseFilterMixin):
|
|
|
48
52
|
ip_address: str | None
|
|
49
53
|
|
|
50
54
|
|
|
55
|
+
@strawberry_django.filter(DNSSECKeyTemplate, lookups=True)
|
|
56
|
+
@autotype_decorator(DNSSECKeyTemplateFilterSet)
|
|
57
|
+
class NetBoxDNSDNSSECKeyTemplateFilter(BaseFilterMixin):
|
|
58
|
+
ip_address: str | None
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
@strawberry_django.filter(DNSSECPolicy, lookups=True)
|
|
62
|
+
@autotype_decorator(DNSSECPolicyFilterSet)
|
|
63
|
+
class NetBoxDNSDNSSECPolicyFilter(BaseFilterMixin):
|
|
64
|
+
ip_address: str | None
|
|
65
|
+
|
|
66
|
+
|
|
51
67
|
@strawberry_django.filter(ZoneTemplate, lookups=True)
|
|
52
68
|
@autotype_decorator(ZoneTemplateFilterSet)
|
|
53
69
|
class NetBoxDNSZoneTemplateFilter(BaseFilterMixin):
|
netbox_dns/graphql/schema.py
CHANGED
|
@@ -8,6 +8,8 @@ from .types import (
|
|
|
8
8
|
NetBoxDNSViewType,
|
|
9
9
|
NetBoxDNSZoneType,
|
|
10
10
|
NetBoxDNSRecordType,
|
|
11
|
+
NetBoxDNSDNSSECKeyTemplateType,
|
|
12
|
+
NetBoxDNSDNSSECPolicyType,
|
|
11
13
|
NetBoxDNSRegistrationContactType,
|
|
12
14
|
NetBoxDNSRegistrarType,
|
|
13
15
|
NetBoxDNSZoneTemplateType,
|
|
@@ -41,6 +43,24 @@ class NetBoxDNSRecordQuery:
|
|
|
41
43
|
netbox_dns_record_list: List[NetBoxDNSRecordType] = strawberry_django.field()
|
|
42
44
|
|
|
43
45
|
|
|
46
|
+
@strawberry.type(name="Query")
|
|
47
|
+
class NetBoxDNSDNSSECKeyTemplateQuery:
|
|
48
|
+
netbox_dns_dnssec_key_template: NetBoxDNSDNSSECKeyTemplateType = (
|
|
49
|
+
strawberry_django.field()
|
|
50
|
+
)
|
|
51
|
+
netbox_dns_dnssec_key_template_list: List[NetBoxDNSDNSSECKeyTemplateType] = (
|
|
52
|
+
strawberry_django.field()
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
@strawberry.type(name="Query")
|
|
57
|
+
class NetBoxDNSDNSSECPolicyQuery:
|
|
58
|
+
netbox_dns_dnssec_policy: NetBoxDNSDNSSECPolicyType = strawberry_django.field()
|
|
59
|
+
netbox_dns_dnssec_policy_list: List[NetBoxDNSDNSSECPolicyType] = (
|
|
60
|
+
strawberry_django.field()
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
|
|
44
64
|
@strawberry.type(name="Query")
|
|
45
65
|
class NetBoxDNSRegistrationContactQuery:
|
|
46
66
|
netbox_dns_registration_contact: NetBoxDNSRegistrationContactType = (
|
netbox_dns/graphql/types.py
CHANGED
|
@@ -13,6 +13,8 @@ from netbox_dns.models import (
|
|
|
13
13
|
View,
|
|
14
14
|
Zone,
|
|
15
15
|
Record,
|
|
16
|
+
DNSSECKeyTemplate,
|
|
17
|
+
DNSSECPolicy,
|
|
16
18
|
RegistrationContact,
|
|
17
19
|
Registrar,
|
|
18
20
|
ZoneTemplate,
|
|
@@ -23,6 +25,8 @@ from .filters import (
|
|
|
23
25
|
NetBoxDNSViewFilter,
|
|
24
26
|
NetBoxDNSZoneFilter,
|
|
25
27
|
NetBoxDNSRecordFilter,
|
|
28
|
+
NetBoxDNSDNSSECKeyTemplateFilter,
|
|
29
|
+
NetBoxDNSDNSSECPolicyFilter,
|
|
26
30
|
NetBoxDNSRegistrationContactFilter,
|
|
27
31
|
NetBoxDNSRegistrarFilter,
|
|
28
32
|
NetBoxDNSZoneTemplateFilter,
|
|
@@ -58,6 +62,7 @@ class NetBoxDNSViewType(NetBoxObjectType):
|
|
|
58
62
|
@strawberry_django.type(Zone, fields="__all__", filters=NetBoxDNSZoneFilter)
|
|
59
63
|
class NetBoxDNSZoneType(NetBoxObjectType):
|
|
60
64
|
name: str
|
|
65
|
+
description: str | None
|
|
61
66
|
status: str
|
|
62
67
|
active: bool
|
|
63
68
|
view: Annotated["NetBoxDNSViewType", strawberry.lazy("netbox_dns.graphql.types")]
|
|
@@ -78,9 +83,13 @@ class NetBoxDNSZoneType(NetBoxObjectType):
|
|
|
78
83
|
soa_expire: BigInt
|
|
79
84
|
soa_minimum: BigInt
|
|
80
85
|
soa_serial_auto: bool
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
86
|
+
dnssec_policy: (
|
|
87
|
+
Annotated[
|
|
88
|
+
"NetBoxDNSDNSSECPolicyType", strawberry.lazy("netbox_dns.graphql.types")
|
|
89
|
+
]
|
|
90
|
+
| None
|
|
91
|
+
)
|
|
92
|
+
inline_signing: bool
|
|
84
93
|
registrar: (
|
|
85
94
|
Annotated["NetBoxDNSRegistrarType", strawberry.lazy("netbox_dns.graphql.types")]
|
|
86
95
|
| None
|
|
@@ -126,6 +135,8 @@ class NetBoxDNSZoneType(NetBoxObjectType):
|
|
|
126
135
|
rfc2317_child_zones: List[
|
|
127
136
|
Annotated["NetBoxDNSRecordType", strawberry.lazy("netbox_dns.graphql.types")]
|
|
128
137
|
]
|
|
138
|
+
arpa_network: str | None
|
|
139
|
+
tenant: Annotated["TenantType", strawberry.lazy("tenancy.graphql.types")] | None
|
|
129
140
|
|
|
130
141
|
|
|
131
142
|
@strawberry_django.type(Record, fields="__all__", filters=NetBoxDNSRecordFilter)
|
|
@@ -162,6 +173,53 @@ class NetBoxDNSRecordType(NetBoxObjectType):
|
|
|
162
173
|
]
|
|
163
174
|
|
|
164
175
|
|
|
176
|
+
@strawberry_django.type(
|
|
177
|
+
DNSSECKeyTemplate, fields="__all__", filters=NetBoxDNSDNSSECKeyTemplateFilter
|
|
178
|
+
)
|
|
179
|
+
class NetBoxDNSDNSSECKeyTemplateType(NetBoxObjectType):
|
|
180
|
+
name: str
|
|
181
|
+
description: str
|
|
182
|
+
tenant: Annotated["TenantType", strawberry.lazy("tenancy.graphql.types")] | None
|
|
183
|
+
type: str
|
|
184
|
+
lifetime: BigInt | None
|
|
185
|
+
algorithm: str
|
|
186
|
+
key_size: BigInt | None
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
@strawberry_django.type(
|
|
190
|
+
DNSSECPolicy, fields="__all__", filters=NetBoxDNSDNSSECPolicyFilter
|
|
191
|
+
)
|
|
192
|
+
class NetBoxDNSDNSSECPolicyType(NetBoxObjectType):
|
|
193
|
+
name: str
|
|
194
|
+
description: str | None
|
|
195
|
+
status: str
|
|
196
|
+
tenant: Annotated["TenantType", strawberry.lazy("tenancy.graphql.types")] | None
|
|
197
|
+
key_templates: List[
|
|
198
|
+
Annotated[
|
|
199
|
+
"NetBoxDNSDNSSECKeyTemplateType",
|
|
200
|
+
strawberry.lazy("netbox_dns.graphql.types"),
|
|
201
|
+
]
|
|
202
|
+
]
|
|
203
|
+
dnskey_ttl: BigInt | None
|
|
204
|
+
purge_keys: BigInt | None
|
|
205
|
+
publish_safety: BigInt | None
|
|
206
|
+
retire_safety: BigInt | None
|
|
207
|
+
signatures_jitter: BigInt | None
|
|
208
|
+
signatures_refresh: BigInt | None
|
|
209
|
+
signatures_validity: BigInt | None
|
|
210
|
+
signatures_validity_dnskey: BigInt | None
|
|
211
|
+
max_zone_ttl: BigInt | None
|
|
212
|
+
zone_propagation_delay: BigInt | None
|
|
213
|
+
create_cdnskey: bool
|
|
214
|
+
cds_digest_types: List[str]
|
|
215
|
+
parent_ds_ttl: BigInt | None
|
|
216
|
+
parent_propagation_delay: BigInt | None
|
|
217
|
+
use_nsec3: bool
|
|
218
|
+
nsec3_iterations: BigInt | None
|
|
219
|
+
nsec3_opt_out: bool
|
|
220
|
+
nsec3_salt_size: BigInt | None
|
|
221
|
+
|
|
222
|
+
|
|
165
223
|
@strawberry_django.type(
|
|
166
224
|
RegistrationContact, fields="__all__", filters=NetBoxDNSRegistrationContactFilter
|
|
167
225
|
)
|
|
@@ -226,6 +284,12 @@ class NetBoxDNSZoneTemplateType(NetBoxObjectType):
|
|
|
226
284
|
| None
|
|
227
285
|
)
|
|
228
286
|
soa_rname: str | None
|
|
287
|
+
dnssec_policy: (
|
|
288
|
+
Annotated[
|
|
289
|
+
"NetBoxDNSDNSSECPolicyType", strawberry.lazy("netbox_dns.graphql.types")
|
|
290
|
+
]
|
|
291
|
+
| None
|
|
292
|
+
)
|
|
229
293
|
record_templates: List[
|
|
230
294
|
Annotated[
|
|
231
295
|
"NetBoxDNSRecordTemplateType", strawberry.lazy("netbox_dns.graphql.types")
|
|
Binary file
|
|
Binary file
|