netbox-plugin-dns 1.2.6__py3-none-any.whl → 1.2.7b2__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 +15 -1
- netbox_dns/api/serializers.py +3 -0
- netbox_dns/api/serializers_/dnssec_key_template.py +46 -0
- netbox_dns/api/serializers_/dnssec_policy.py +83 -0
- netbox_dns/api/serializers_/zone.py +10 -0
- 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/fields/__init__.py +1 -0
- netbox_dns/fields/choice_array.py +20 -0
- netbox_dns/filtersets/__init__.py +3 -0
- netbox_dns/filtersets/dnssec_key_template.py +51 -0
- netbox_dns/filtersets/dnssec_policy.py +73 -0
- netbox_dns/filtersets/zone.py +23 -4
- netbox_dns/filtersets/zone_template.py +11 -0
- netbox_dns/forms/__init__.py +2 -0
- netbox_dns/forms/dnssec_key_template.py +188 -0
- netbox_dns/forms/dnssec_policy.py +563 -0
- netbox_dns/forms/zone.py +48 -0
- netbox_dns/forms/zone_template.py +29 -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/models/__init__.py +2 -0
- netbox_dns/models/dnssec_key_template.py +114 -0
- netbox_dns/models/dnssec_policy.py +201 -0
- netbox_dns/models/zone.py +29 -16
- netbox_dns/models/zone_template.py +16 -6
- 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 +17 -1
- netbox_dns/tables/zone_template.py +4 -0
- netbox_dns/templates/netbox_dns/dnsseckeytemplate.html +70 -0
- netbox_dns/templates/netbox_dns/dnssecpolicy.html +155 -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 +16 -0
- netbox_dns/validators/__init__.py +1 -0
- netbox_dns/validators/dnssec.py +146 -0
- netbox_dns/views/__init__.py +2 -0
- netbox_dns/views/dnssec_key_template.py +87 -0
- netbox_dns/views/dnssec_policy.py +153 -0
- {netbox_plugin_dns-1.2.6.dist-info → netbox_plugin_dns-1.2.7b2.dist-info}/METADATA +2 -2
- {netbox_plugin_dns-1.2.6.dist-info → netbox_plugin_dns-1.2.7b2.dist-info}/RECORD +62 -38
- {netbox_plugin_dns-1.2.6.dist-info → netbox_plugin_dns-1.2.7b2.dist-info}/LICENSE +0 -0
- {netbox_plugin_dns-1.2.6.dist-info → netbox_plugin_dns-1.2.7b2.dist-info}/WHEEL +0 -0
- {netbox_plugin_dns-1.2.6.dist-info → netbox_plugin_dns-1.2.7b2.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,563 @@
|
|
|
1
|
+
from packaging.version import Version
|
|
2
|
+
|
|
3
|
+
from django import forms
|
|
4
|
+
from django.utils.translation import gettext_lazy as _
|
|
5
|
+
|
|
6
|
+
from netbox.forms import (
|
|
7
|
+
NetBoxModelBulkEditForm,
|
|
8
|
+
NetBoxModelFilterSetForm,
|
|
9
|
+
NetBoxModelImportForm,
|
|
10
|
+
NetBoxModelForm,
|
|
11
|
+
)
|
|
12
|
+
from utilities.forms.fields import (
|
|
13
|
+
TagFilterField,
|
|
14
|
+
CSVModelChoiceField,
|
|
15
|
+
CSVChoiceField,
|
|
16
|
+
DynamicModelChoiceField,
|
|
17
|
+
DynamicModelMultipleChoiceField,
|
|
18
|
+
)
|
|
19
|
+
from utilities.release import load_release_data
|
|
20
|
+
from utilities.forms.rendering import FieldSet
|
|
21
|
+
from utilities.forms.widgets import BulkEditNullBooleanSelect
|
|
22
|
+
from utilities.forms import BOOLEAN_WITH_BLANK_CHOICES, add_blank_choice
|
|
23
|
+
from tenancy.models import Tenant, TenantGroup
|
|
24
|
+
from tenancy.forms import TenancyForm, TenancyFilterForm
|
|
25
|
+
|
|
26
|
+
from netbox_dns.models import DNSSECPolicy, DNSSECKeyTemplate
|
|
27
|
+
from netbox_dns.choices import DNSSECPolicyDigestChoices, DNSSECPolicyStatusChoices
|
|
28
|
+
from netbox_dns.fields import TimePeriodField
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
__all__ = (
|
|
32
|
+
"DNSSECPolicyForm",
|
|
33
|
+
"DNSSECPolicyFilterForm",
|
|
34
|
+
"DNSSECPolicyImportForm",
|
|
35
|
+
"DNSSECPolicyBulkEditForm",
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
QUICK_ADD = Version(load_release_data().version) >= Version("4.2.5")
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class DNSSECPolicyForm(TenancyForm, NetBoxModelForm):
|
|
42
|
+
fieldsets = (
|
|
43
|
+
FieldSet(
|
|
44
|
+
"name",
|
|
45
|
+
"description",
|
|
46
|
+
"status",
|
|
47
|
+
"key_templates",
|
|
48
|
+
name=_("Attributes"),
|
|
49
|
+
),
|
|
50
|
+
FieldSet(
|
|
51
|
+
"dnskey_ttl",
|
|
52
|
+
"purge_keys",
|
|
53
|
+
"publish_safety",
|
|
54
|
+
"retire_safety",
|
|
55
|
+
"signatures_jitter",
|
|
56
|
+
"signatures_refresh",
|
|
57
|
+
"signatures_validity",
|
|
58
|
+
"signatures_validity_dnskey",
|
|
59
|
+
"max_zone_ttl",
|
|
60
|
+
"zone_propagation_delay",
|
|
61
|
+
name=_("Timing"),
|
|
62
|
+
),
|
|
63
|
+
FieldSet(
|
|
64
|
+
"create_cdnskey",
|
|
65
|
+
"cds_digest_types",
|
|
66
|
+
"parent_ds_ttl",
|
|
67
|
+
"parent_propagation_delay",
|
|
68
|
+
name=_("Parent Delegation"),
|
|
69
|
+
),
|
|
70
|
+
FieldSet(
|
|
71
|
+
"use_nsec3",
|
|
72
|
+
"nsec3_iterations",
|
|
73
|
+
"nsec3_opt_out",
|
|
74
|
+
"nsec3_salt_size",
|
|
75
|
+
name=_("Proof of Non-Existence"),
|
|
76
|
+
),
|
|
77
|
+
FieldSet("tenant_group_id", "tenant_id", name=_("Tenancy")),
|
|
78
|
+
FieldSet("tags", name=_("Tags")),
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
key_templates = DynamicModelMultipleChoiceField(
|
|
82
|
+
queryset=DNSSECKeyTemplate.objects.all(),
|
|
83
|
+
required=False,
|
|
84
|
+
label=_("Key Templates"),
|
|
85
|
+
help_text=_("Select CSK or KSK/ZSK templates for signing"),
|
|
86
|
+
quick_add=QUICK_ADD,
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
class Meta:
|
|
90
|
+
model = DNSSECPolicy
|
|
91
|
+
fields = (
|
|
92
|
+
"name",
|
|
93
|
+
"description",
|
|
94
|
+
"status",
|
|
95
|
+
"key_templates",
|
|
96
|
+
"dnskey_ttl",
|
|
97
|
+
"purge_keys",
|
|
98
|
+
"publish_safety",
|
|
99
|
+
"retire_safety",
|
|
100
|
+
"signatures_jitter",
|
|
101
|
+
"signatures_refresh",
|
|
102
|
+
"signatures_validity",
|
|
103
|
+
"signatures_validity_dnskey",
|
|
104
|
+
"max_zone_ttl",
|
|
105
|
+
"zone_propagation_delay",
|
|
106
|
+
"create_cdnskey",
|
|
107
|
+
"cds_digest_types",
|
|
108
|
+
"parent_ds_ttl",
|
|
109
|
+
"parent_propagation_delay",
|
|
110
|
+
"use_nsec3",
|
|
111
|
+
"nsec3_iterations",
|
|
112
|
+
"nsec3_opt_out",
|
|
113
|
+
"nsec3_salt_size",
|
|
114
|
+
"tenant_group",
|
|
115
|
+
"tenant",
|
|
116
|
+
"tags",
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
dnskey_ttl = TimePeriodField(
|
|
120
|
+
required=False,
|
|
121
|
+
label=_("DNSKEY TTL"),
|
|
122
|
+
)
|
|
123
|
+
purge_keys = TimePeriodField(
|
|
124
|
+
required=False,
|
|
125
|
+
label=_("Purge Keys"),
|
|
126
|
+
)
|
|
127
|
+
publish_safety = TimePeriodField(
|
|
128
|
+
required=False,
|
|
129
|
+
label=_("Publish Safety"),
|
|
130
|
+
)
|
|
131
|
+
retire_safety = TimePeriodField(
|
|
132
|
+
required=False,
|
|
133
|
+
label=_("Retire Safety"),
|
|
134
|
+
)
|
|
135
|
+
signatures_jitter = TimePeriodField(
|
|
136
|
+
required=False,
|
|
137
|
+
label=_("Signatures Jitter"),
|
|
138
|
+
)
|
|
139
|
+
signatures_refresh = TimePeriodField(
|
|
140
|
+
required=False,
|
|
141
|
+
label=_("Signatures Refresh"),
|
|
142
|
+
)
|
|
143
|
+
signatures_validity = TimePeriodField(
|
|
144
|
+
required=False,
|
|
145
|
+
label=_("Signatures Validity"),
|
|
146
|
+
)
|
|
147
|
+
signatures_validity_dnskey = TimePeriodField(
|
|
148
|
+
required=False,
|
|
149
|
+
label=_("Signatures Validity (DNSKEY)"),
|
|
150
|
+
)
|
|
151
|
+
max_zone_ttl = TimePeriodField(
|
|
152
|
+
required=False,
|
|
153
|
+
label=_("Max Zone TTL"),
|
|
154
|
+
)
|
|
155
|
+
zone_propagation_delay = TimePeriodField(
|
|
156
|
+
required=False,
|
|
157
|
+
label=_("Zone Propagation Delay"),
|
|
158
|
+
)
|
|
159
|
+
parent_ds_ttl = TimePeriodField(
|
|
160
|
+
required=False,
|
|
161
|
+
label=_("Parent DS TTL"),
|
|
162
|
+
)
|
|
163
|
+
parent_propagation_delay = TimePeriodField(
|
|
164
|
+
required=False,
|
|
165
|
+
label=_("Parent Propagation Delay"),
|
|
166
|
+
)
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
class DNSSECPolicyFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
170
|
+
model = DNSSECPolicy
|
|
171
|
+
fieldsets = (
|
|
172
|
+
FieldSet("q", "filter_id", "tag"),
|
|
173
|
+
FieldSet(
|
|
174
|
+
"name",
|
|
175
|
+
"description",
|
|
176
|
+
"status",
|
|
177
|
+
"key_template_id",
|
|
178
|
+
name=_("Attributes"),
|
|
179
|
+
),
|
|
180
|
+
FieldSet(
|
|
181
|
+
"dnskey_ttl",
|
|
182
|
+
"purge_keys",
|
|
183
|
+
"publish_safety",
|
|
184
|
+
"retire_safety",
|
|
185
|
+
"signatures_jitter",
|
|
186
|
+
"signatures_refresh",
|
|
187
|
+
"signatures_validity",
|
|
188
|
+
"signatures_validity_dnskey",
|
|
189
|
+
"max_zone_ttl",
|
|
190
|
+
"zone_propagation_delay",
|
|
191
|
+
name=_("Timing"),
|
|
192
|
+
),
|
|
193
|
+
FieldSet(
|
|
194
|
+
"create_cdnskey",
|
|
195
|
+
"cds_digest_types",
|
|
196
|
+
"parent_ds_ttl",
|
|
197
|
+
"parent_propagation_delay",
|
|
198
|
+
name=_("Parent Delegation"),
|
|
199
|
+
),
|
|
200
|
+
FieldSet(
|
|
201
|
+
"use_nsec3",
|
|
202
|
+
"nsec3_iterations",
|
|
203
|
+
"nsec3_opt_out",
|
|
204
|
+
"nsec3_salt_size",
|
|
205
|
+
name=_("Proof of Non-Existence"),
|
|
206
|
+
),
|
|
207
|
+
FieldSet("tenant_group_id", "tenant_id", name=_("Tenancy")),
|
|
208
|
+
FieldSet("tags", name=_("Tags")),
|
|
209
|
+
)
|
|
210
|
+
|
|
211
|
+
name = forms.CharField(
|
|
212
|
+
required=False,
|
|
213
|
+
)
|
|
214
|
+
description = forms.CharField(
|
|
215
|
+
required=False,
|
|
216
|
+
)
|
|
217
|
+
status = forms.MultipleChoiceField(
|
|
218
|
+
choices=DNSSECPolicyStatusChoices,
|
|
219
|
+
required=False,
|
|
220
|
+
label=_("Status"),
|
|
221
|
+
)
|
|
222
|
+
key_template_id = DynamicModelMultipleChoiceField(
|
|
223
|
+
queryset=DNSSECKeyTemplate.objects.all(),
|
|
224
|
+
required=False,
|
|
225
|
+
label=_("Key Templates"),
|
|
226
|
+
)
|
|
227
|
+
dnskey_ttl = TimePeriodField(
|
|
228
|
+
required=False,
|
|
229
|
+
label=_("DNSKEY TTL"),
|
|
230
|
+
)
|
|
231
|
+
purge_keys = TimePeriodField(
|
|
232
|
+
required=False,
|
|
233
|
+
label=_("Purge Keys"),
|
|
234
|
+
)
|
|
235
|
+
publish_safety = TimePeriodField(
|
|
236
|
+
required=False,
|
|
237
|
+
label=_("Publish Safety"),
|
|
238
|
+
)
|
|
239
|
+
retire_safety = TimePeriodField(
|
|
240
|
+
required=False,
|
|
241
|
+
label=_("Retire Safety"),
|
|
242
|
+
)
|
|
243
|
+
signatures_jitter = TimePeriodField(
|
|
244
|
+
required=False,
|
|
245
|
+
label=_("Signatures Jitter"),
|
|
246
|
+
)
|
|
247
|
+
signatures_refresh = TimePeriodField(
|
|
248
|
+
required=False,
|
|
249
|
+
label=_("Signatures Refresh"),
|
|
250
|
+
)
|
|
251
|
+
signatures_validity = TimePeriodField(
|
|
252
|
+
required=False,
|
|
253
|
+
label=_("Signatures Validity"),
|
|
254
|
+
)
|
|
255
|
+
signatures_validity_dnskey = TimePeriodField(
|
|
256
|
+
required=False,
|
|
257
|
+
label=_("Signatures Validity (DNSKEY)"),
|
|
258
|
+
)
|
|
259
|
+
max_zone_ttl = TimePeriodField(
|
|
260
|
+
required=False,
|
|
261
|
+
label=_("Max Zone TTL"),
|
|
262
|
+
)
|
|
263
|
+
zone_propagation_delay = TimePeriodField(
|
|
264
|
+
required=False,
|
|
265
|
+
label=_("Zone Propagation Delay"),
|
|
266
|
+
)
|
|
267
|
+
create_cdnskey = forms.NullBooleanField(
|
|
268
|
+
required=False,
|
|
269
|
+
widget=forms.Select(choices=BOOLEAN_WITH_BLANK_CHOICES),
|
|
270
|
+
label=_("Create CDNSKEY"),
|
|
271
|
+
)
|
|
272
|
+
cds_digest_types = forms.MultipleChoiceField(
|
|
273
|
+
required=False,
|
|
274
|
+
choices=DNSSECPolicyDigestChoices,
|
|
275
|
+
label=_("CDS Digest Types"),
|
|
276
|
+
)
|
|
277
|
+
parent_ds_ttl = TimePeriodField(
|
|
278
|
+
required=False,
|
|
279
|
+
label=_("Parent DS TTL"),
|
|
280
|
+
)
|
|
281
|
+
parent_propagation_delay = TimePeriodField(
|
|
282
|
+
required=False,
|
|
283
|
+
label=_("Parent Propagation Delay"),
|
|
284
|
+
)
|
|
285
|
+
use_nsec3 = forms.NullBooleanField(
|
|
286
|
+
required=False,
|
|
287
|
+
widget=forms.Select(choices=BOOLEAN_WITH_BLANK_CHOICES),
|
|
288
|
+
label=_("Use NSEC3"),
|
|
289
|
+
)
|
|
290
|
+
nsec3_iterations = forms.IntegerField(
|
|
291
|
+
required=False,
|
|
292
|
+
label=_("NSEC3 Iterations"),
|
|
293
|
+
)
|
|
294
|
+
nsec3_opt_out = forms.NullBooleanField(
|
|
295
|
+
required=False,
|
|
296
|
+
widget=forms.Select(choices=BOOLEAN_WITH_BLANK_CHOICES),
|
|
297
|
+
label=_("NSEC3 Opt-Out"),
|
|
298
|
+
)
|
|
299
|
+
nsec3_salt_size = forms.IntegerField(
|
|
300
|
+
required=False,
|
|
301
|
+
label=_("NSEC3 Salt Size"),
|
|
302
|
+
)
|
|
303
|
+
|
|
304
|
+
tag = TagFilterField(DNSSECPolicy)
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
class DNSSECPolicyImportForm(NetBoxModelImportForm):
|
|
308
|
+
status = CSVChoiceField(
|
|
309
|
+
choices=DNSSECPolicyStatusChoices,
|
|
310
|
+
required=False,
|
|
311
|
+
label=_("Status"),
|
|
312
|
+
)
|
|
313
|
+
dnskey_ttl = TimePeriodField(
|
|
314
|
+
required=False,
|
|
315
|
+
label=_("DNSKEY TTL"),
|
|
316
|
+
)
|
|
317
|
+
purge_keys = TimePeriodField(
|
|
318
|
+
required=False,
|
|
319
|
+
label=_("Purge Keys"),
|
|
320
|
+
)
|
|
321
|
+
publish_safety = TimePeriodField(
|
|
322
|
+
required=False,
|
|
323
|
+
label=_("Publish Safety"),
|
|
324
|
+
)
|
|
325
|
+
retire_safety = TimePeriodField(
|
|
326
|
+
required=False,
|
|
327
|
+
label=_("Retire Safety"),
|
|
328
|
+
)
|
|
329
|
+
signatures_jitter = TimePeriodField(
|
|
330
|
+
required=False,
|
|
331
|
+
label=_("Signatures Jitter"),
|
|
332
|
+
)
|
|
333
|
+
signatures_refresh = TimePeriodField(
|
|
334
|
+
required=False,
|
|
335
|
+
label=_("Signatures Refresh"),
|
|
336
|
+
)
|
|
337
|
+
signatures_validity = TimePeriodField(
|
|
338
|
+
required=False,
|
|
339
|
+
label=_("Signatures Validity"),
|
|
340
|
+
)
|
|
341
|
+
signatures_validity_dnskey = TimePeriodField(
|
|
342
|
+
required=False,
|
|
343
|
+
label=_("Signatures Validity (DNSKEY)"),
|
|
344
|
+
)
|
|
345
|
+
max_zone_ttl = TimePeriodField(
|
|
346
|
+
required=False,
|
|
347
|
+
label=_("Max Zone TTL"),
|
|
348
|
+
)
|
|
349
|
+
zone_propagation_delay = TimePeriodField(
|
|
350
|
+
required=False,
|
|
351
|
+
label=_("Zone Propagation Delay"),
|
|
352
|
+
)
|
|
353
|
+
parent_ds_ttl = TimePeriodField(
|
|
354
|
+
required=False,
|
|
355
|
+
label=_("Parent DS TTL"),
|
|
356
|
+
)
|
|
357
|
+
parent_propagation_delay = TimePeriodField(
|
|
358
|
+
required=False,
|
|
359
|
+
label=_("Parent Propagation Delay"),
|
|
360
|
+
)
|
|
361
|
+
tenant = CSVModelChoiceField(
|
|
362
|
+
queryset=Tenant.objects.all(),
|
|
363
|
+
to_field_name="name",
|
|
364
|
+
required=False,
|
|
365
|
+
label=_("Tenant"),
|
|
366
|
+
)
|
|
367
|
+
|
|
368
|
+
class Meta:
|
|
369
|
+
model = DNSSECPolicy
|
|
370
|
+
fields = (
|
|
371
|
+
"name",
|
|
372
|
+
"description",
|
|
373
|
+
"key_templates",
|
|
374
|
+
"dnskey_ttl",
|
|
375
|
+
"purge_keys",
|
|
376
|
+
"publish_safety",
|
|
377
|
+
"retire_safety",
|
|
378
|
+
"signatures_jitter",
|
|
379
|
+
"signatures_refresh",
|
|
380
|
+
"signatures_validity",
|
|
381
|
+
"signatures_validity_dnskey",
|
|
382
|
+
"max_zone_ttl",
|
|
383
|
+
"zone_propagation_delay",
|
|
384
|
+
"create_cdnskey",
|
|
385
|
+
"cds_digest_types",
|
|
386
|
+
"parent_ds_ttl",
|
|
387
|
+
"parent_propagation_delay",
|
|
388
|
+
"use_nsec3",
|
|
389
|
+
"nsec3_iterations",
|
|
390
|
+
"nsec3_opt_out",
|
|
391
|
+
"nsec3_salt_size",
|
|
392
|
+
"tenant",
|
|
393
|
+
"tags",
|
|
394
|
+
)
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
class DNSSECPolicyBulkEditForm(NetBoxModelBulkEditForm):
|
|
398
|
+
model = DNSSECPolicy
|
|
399
|
+
|
|
400
|
+
description = forms.CharField(
|
|
401
|
+
max_length=200,
|
|
402
|
+
required=False,
|
|
403
|
+
label=_("Description"),
|
|
404
|
+
)
|
|
405
|
+
status = forms.ChoiceField(
|
|
406
|
+
choices=add_blank_choice(DNSSECPolicyStatusChoices),
|
|
407
|
+
required=False,
|
|
408
|
+
label=_("Status"),
|
|
409
|
+
)
|
|
410
|
+
dnskey_ttl = TimePeriodField(
|
|
411
|
+
required=False,
|
|
412
|
+
label=_("DNSKEY TTL"),
|
|
413
|
+
)
|
|
414
|
+
purge_keys = TimePeriodField(
|
|
415
|
+
required=False,
|
|
416
|
+
label=_("Purge Keys"),
|
|
417
|
+
)
|
|
418
|
+
publish_safety = TimePeriodField(
|
|
419
|
+
required=False,
|
|
420
|
+
label=_("Publish Safety"),
|
|
421
|
+
)
|
|
422
|
+
retire_safety = TimePeriodField(
|
|
423
|
+
required=False,
|
|
424
|
+
label=_("Retire Safety"),
|
|
425
|
+
)
|
|
426
|
+
signatures_jitter = TimePeriodField(
|
|
427
|
+
required=False,
|
|
428
|
+
label=_("Signatures Jitter"),
|
|
429
|
+
)
|
|
430
|
+
signatures_refresh = TimePeriodField(
|
|
431
|
+
required=False,
|
|
432
|
+
label=_("Signatures Refresh"),
|
|
433
|
+
)
|
|
434
|
+
signatures_validity = TimePeriodField(
|
|
435
|
+
required=False,
|
|
436
|
+
label=_("Signatures Validity"),
|
|
437
|
+
)
|
|
438
|
+
signatures_validity_dnskey = TimePeriodField(
|
|
439
|
+
required=False,
|
|
440
|
+
label=_("Signatures Validity (DNSKEY)"),
|
|
441
|
+
)
|
|
442
|
+
max_zone_ttl = TimePeriodField(
|
|
443
|
+
required=False,
|
|
444
|
+
label=_("Max Zone TTL"),
|
|
445
|
+
)
|
|
446
|
+
zone_propagation_delay = TimePeriodField(
|
|
447
|
+
required=False,
|
|
448
|
+
label=_("Zone Propagation Delay"),
|
|
449
|
+
)
|
|
450
|
+
create_cdnskey = forms.NullBooleanField(
|
|
451
|
+
required=False,
|
|
452
|
+
widget=BulkEditNullBooleanSelect(),
|
|
453
|
+
label=_("Create CDNSKEY"),
|
|
454
|
+
)
|
|
455
|
+
cds_digest_types = forms.MultipleChoiceField(
|
|
456
|
+
choices=DNSSECPolicyDigestChoices,
|
|
457
|
+
required=False,
|
|
458
|
+
label=_("CDS Digest Types"),
|
|
459
|
+
)
|
|
460
|
+
parent_ds_ttl = TimePeriodField(
|
|
461
|
+
required=False,
|
|
462
|
+
label=_("Parent DS TTL"),
|
|
463
|
+
)
|
|
464
|
+
parent_propagation_delay = TimePeriodField(
|
|
465
|
+
required=False,
|
|
466
|
+
label=_("Parent Propagation Delay"),
|
|
467
|
+
)
|
|
468
|
+
use_nsec3 = forms.NullBooleanField(
|
|
469
|
+
required=False,
|
|
470
|
+
widget=BulkEditNullBooleanSelect(),
|
|
471
|
+
label=_("Use NSEC3"),
|
|
472
|
+
)
|
|
473
|
+
nsec3_iterations = forms.IntegerField(
|
|
474
|
+
required=False,
|
|
475
|
+
label=_("NSEC3 Iterations"),
|
|
476
|
+
)
|
|
477
|
+
nsec3_opt_out = forms.NullBooleanField(
|
|
478
|
+
required=False,
|
|
479
|
+
widget=BulkEditNullBooleanSelect(),
|
|
480
|
+
label=_("NSEC3 Opt-Out"),
|
|
481
|
+
)
|
|
482
|
+
nsec3_salt_size = forms.IntegerField(
|
|
483
|
+
required=False,
|
|
484
|
+
label=_("NSEC3 Salt Size"),
|
|
485
|
+
)
|
|
486
|
+
tenant_group = DynamicModelChoiceField(
|
|
487
|
+
queryset=TenantGroup.objects.all(),
|
|
488
|
+
required=False,
|
|
489
|
+
label=_("Tenant Group"),
|
|
490
|
+
)
|
|
491
|
+
tenant = DynamicModelChoiceField(
|
|
492
|
+
queryset=Tenant.objects.all(),
|
|
493
|
+
required=False,
|
|
494
|
+
label=_("Tenant"),
|
|
495
|
+
)
|
|
496
|
+
|
|
497
|
+
fieldsets = (
|
|
498
|
+
FieldSet(
|
|
499
|
+
"description",
|
|
500
|
+
"key_templates",
|
|
501
|
+
name=_("Attributes"),
|
|
502
|
+
),
|
|
503
|
+
FieldSet(
|
|
504
|
+
"dnskey_ttl",
|
|
505
|
+
"purge_keys",
|
|
506
|
+
"publish_safety",
|
|
507
|
+
"retire_safety",
|
|
508
|
+
"signatures_jitter",
|
|
509
|
+
"signatures_refresh",
|
|
510
|
+
"signatures_validity",
|
|
511
|
+
"signatures_validity_dnskey",
|
|
512
|
+
"max_zone_ttl",
|
|
513
|
+
"zone_propagation_delay",
|
|
514
|
+
name=_("Timing"),
|
|
515
|
+
),
|
|
516
|
+
FieldSet(
|
|
517
|
+
"create_cdnskey",
|
|
518
|
+
"cds_digest_types",
|
|
519
|
+
"parent_ds_ttl",
|
|
520
|
+
"parent_propagation_delay",
|
|
521
|
+
name=_("Parent Delegation"),
|
|
522
|
+
),
|
|
523
|
+
FieldSet(
|
|
524
|
+
"use_nsec3",
|
|
525
|
+
"nsec3_iterations",
|
|
526
|
+
"nsec3_opt_out",
|
|
527
|
+
"nsec3_salt_size",
|
|
528
|
+
name=_("Proof of Non-Existence"),
|
|
529
|
+
),
|
|
530
|
+
FieldSet("tenant_group", "tenant", name=_("Tenancy")),
|
|
531
|
+
)
|
|
532
|
+
|
|
533
|
+
nullable_fields = (
|
|
534
|
+
"description",
|
|
535
|
+
"tenant",
|
|
536
|
+
"dnskey_ttl",
|
|
537
|
+
"purge_keys",
|
|
538
|
+
"publish_safety",
|
|
539
|
+
"retire_safety",
|
|
540
|
+
"signatures_jitter",
|
|
541
|
+
"signatures_refresh",
|
|
542
|
+
"signatures_validity",
|
|
543
|
+
"signatures_validity_dnskey",
|
|
544
|
+
"max_zone_ttl",
|
|
545
|
+
"zone_propagation_delay",
|
|
546
|
+
"cds_digest_types",
|
|
547
|
+
"parent_ds_ttl",
|
|
548
|
+
"parent_propagation_delay",
|
|
549
|
+
"nsec3_iterations",
|
|
550
|
+
"nsec3_opt_out",
|
|
551
|
+
"nsec3_salt_size",
|
|
552
|
+
"cds_digest_types",
|
|
553
|
+
"parent_ds_ttl",
|
|
554
|
+
"parent_propagation_delay",
|
|
555
|
+
)
|
|
556
|
+
|
|
557
|
+
def clean_cds_digest_types(self, *args, **kwargs):
|
|
558
|
+
if not (
|
|
559
|
+
cds_digest_types := self.cleaned_data.get("cds_digest_types")
|
|
560
|
+
) and "cds_digest_types" not in self.data.get("_nullify", []):
|
|
561
|
+
return self.initial.get("cds_digest_types")
|
|
562
|
+
|
|
563
|
+
return cds_digest_types
|
netbox_dns/forms/zone.py
CHANGED
|
@@ -36,6 +36,7 @@ from netbox_dns.models import (
|
|
|
36
36
|
Registrar,
|
|
37
37
|
RegistrationContact,
|
|
38
38
|
ZoneTemplate,
|
|
39
|
+
DNSSECPolicy,
|
|
39
40
|
)
|
|
40
41
|
from netbox_dns.choices import ZoneStatusChoices
|
|
41
42
|
from netbox_dns.utilities import name_to_unicode, network_to_reverse
|
|
@@ -271,6 +272,11 @@ class ZoneForm(ZoneTemplateUpdateMixin, TenancyForm, NetBoxModelForm):
|
|
|
271
272
|
"soa_serial",
|
|
272
273
|
name=_("SOA"),
|
|
273
274
|
),
|
|
275
|
+
FieldSet(
|
|
276
|
+
"dnssec_policy",
|
|
277
|
+
"inline_signing",
|
|
278
|
+
name=_("DNSSEC"),
|
|
279
|
+
),
|
|
274
280
|
FieldSet(
|
|
275
281
|
"rfc2317_prefix",
|
|
276
282
|
"rfc2317_parent_managed",
|
|
@@ -369,6 +375,8 @@ class ZoneForm(ZoneTemplateUpdateMixin, TenancyForm, NetBoxModelForm):
|
|
|
369
375
|
"soa_minimum",
|
|
370
376
|
"rfc2317_prefix",
|
|
371
377
|
"rfc2317_parent_managed",
|
|
378
|
+
"dnssec_policy",
|
|
379
|
+
"inline_signing",
|
|
372
380
|
"registrar",
|
|
373
381
|
"registry_domain_id",
|
|
374
382
|
"registrant",
|
|
@@ -403,6 +411,11 @@ class ZoneFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
|
403
411
|
"soa_serial_auto",
|
|
404
412
|
name=_("SOA"),
|
|
405
413
|
),
|
|
414
|
+
FieldSet(
|
|
415
|
+
"dnssec_policy",
|
|
416
|
+
"inline_signing",
|
|
417
|
+
name=_("DNSSEC"),
|
|
418
|
+
),
|
|
406
419
|
FieldSet(
|
|
407
420
|
"rfc2317_prefix",
|
|
408
421
|
"rfc2317_parent_managed",
|
|
@@ -482,6 +495,11 @@ class ZoneFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
|
482
495
|
required=False,
|
|
483
496
|
label=_("Registrar"),
|
|
484
497
|
)
|
|
498
|
+
dnssec_policy_id = DynamicModelMultipleChoiceField(
|
|
499
|
+
queryset=DNSSECPolicy.objects.all(),
|
|
500
|
+
required=False,
|
|
501
|
+
label=_("DNSSEC Policy"),
|
|
502
|
+
)
|
|
485
503
|
registry_domain_id = forms.CharField(
|
|
486
504
|
required=False,
|
|
487
505
|
label=_("Registry Domain ID"),
|
|
@@ -594,6 +612,19 @@ class ZoneImportForm(ZoneTemplateUpdateMixin, NetBoxModelImportForm):
|
|
|
594
612
|
),
|
|
595
613
|
label=_("RFC2317 Parent Managed"),
|
|
596
614
|
)
|
|
615
|
+
dnssec_policy = CSVModelChoiceField(
|
|
616
|
+
queryset=DNSSECPolicy.objects.all(),
|
|
617
|
+
required=False,
|
|
618
|
+
to_field_name="name",
|
|
619
|
+
error_messages={
|
|
620
|
+
"invalid_choice": _("DNSSEC policy %(value)s not found"),
|
|
621
|
+
},
|
|
622
|
+
label=_("DNSSEC Policy"),
|
|
623
|
+
)
|
|
624
|
+
inline_signing = forms.BooleanField(
|
|
625
|
+
required=False,
|
|
626
|
+
label=_("Use Inline Signing"),
|
|
627
|
+
)
|
|
597
628
|
registrar = CSVModelChoiceField(
|
|
598
629
|
queryset=Registrar.objects.all(),
|
|
599
630
|
required=False,
|
|
@@ -676,6 +707,8 @@ class ZoneImportForm(ZoneTemplateUpdateMixin, NetBoxModelImportForm):
|
|
|
676
707
|
"soa_retry",
|
|
677
708
|
"soa_expire",
|
|
678
709
|
"soa_minimum",
|
|
710
|
+
"dnssec_policy",
|
|
711
|
+
"inline_signing",
|
|
679
712
|
"rfc2317_prefix",
|
|
680
713
|
"rfc2317_parent_managed",
|
|
681
714
|
"registrar",
|
|
@@ -794,6 +827,16 @@ class ZoneBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
794
827
|
),
|
|
795
828
|
label=_("RFC2317 Parent Managed"),
|
|
796
829
|
)
|
|
830
|
+
dnssec_policy = DynamicModelChoiceField(
|
|
831
|
+
queryset=DNSSECPolicy.objects.all(),
|
|
832
|
+
required=False,
|
|
833
|
+
label=_("DNSSEC Policy"),
|
|
834
|
+
)
|
|
835
|
+
inline_signing = forms.NullBooleanField(
|
|
836
|
+
required=False,
|
|
837
|
+
widget=BulkEditNullBooleanSelect(),
|
|
838
|
+
label=_("Use Inline Signing"),
|
|
839
|
+
)
|
|
797
840
|
registrar = DynamicModelChoiceField(
|
|
798
841
|
queryset=Registrar.objects.all(),
|
|
799
842
|
required=False,
|
|
@@ -857,6 +900,11 @@ class ZoneBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
857
900
|
"soa_serial",
|
|
858
901
|
name=_("SOA"),
|
|
859
902
|
),
|
|
903
|
+
FieldSet(
|
|
904
|
+
"dnssec_policy",
|
|
905
|
+
"inline_signing",
|
|
906
|
+
name=_("DNSSEC"),
|
|
907
|
+
),
|
|
860
908
|
FieldSet(
|
|
861
909
|
"rfc2317_prefix",
|
|
862
910
|
"rfc2317_parent_managed",
|