netbox-plugin-dns 1.2.5__tar.gz → 1.2.7__tar.gz

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.

Files changed (187) hide show
  1. {netbox_plugin_dns-1.2.5/netbox_plugin_dns.egg-info → netbox_plugin_dns-1.2.7}/PKG-INFO +3 -2
  2. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/__init__.py +16 -8
  3. netbox_plugin_dns-1.2.7/netbox_dns/api/field_serializers.py +25 -0
  4. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/api/nested_serializers.py +19 -1
  5. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/api/serializers.py +3 -0
  6. netbox_plugin_dns-1.2.7/netbox_dns/api/serializers_/dnssec_key_template.py +59 -0
  7. netbox_plugin_dns-1.2.7/netbox_dns/api/serializers_/dnssec_policy.py +113 -0
  8. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/api/serializers_/record.py +2 -0
  9. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/api/serializers_/record_template.py +2 -0
  10. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/api/serializers_/zone.py +20 -1
  11. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/api/serializers_/zone_template.py +13 -4
  12. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/api/urls.py +4 -0
  13. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/api/views.py +18 -0
  14. netbox_plugin_dns-1.2.7/netbox_dns/choices/__init__.py +4 -0
  15. netbox_plugin_dns-1.2.7/netbox_dns/choices/dnssec_key_template.py +63 -0
  16. netbox_plugin_dns-1.2.7/netbox_dns/choices/dnssec_policy.py +40 -0
  17. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/choices/record.py +2 -25
  18. netbox_plugin_dns-1.2.7/netbox_dns/choices/utilities.py +26 -0
  19. netbox_plugin_dns-1.2.7/netbox_dns/choices/zone.py +119 -0
  20. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/fields/__init__.py +2 -0
  21. netbox_plugin_dns-1.2.7/netbox_dns/fields/choice_array.py +33 -0
  22. netbox_plugin_dns-1.2.7/netbox_dns/fields/timeperiod.py +33 -0
  23. netbox_plugin_dns-1.2.7/netbox_dns/filtersets/__init__.py +12 -0
  24. netbox_plugin_dns-1.2.7/netbox_dns/filtersets/dnssec_key_template.py +51 -0
  25. netbox_plugin_dns-1.2.7/netbox_dns/filtersets/dnssec_policy.py +97 -0
  26. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/filtersets/zone.py +30 -6
  27. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/filtersets/zone_template.py +13 -2
  28. {netbox_plugin_dns-1.2.5/netbox_dns/filtersets → netbox_plugin_dns-1.2.7/netbox_dns/forms}/__init__.py +2 -1
  29. netbox_plugin_dns-1.2.7/netbox_dns/forms/dnssec_key_template.py +189 -0
  30. netbox_plugin_dns-1.2.7/netbox_dns/forms/dnssec_policy.py +593 -0
  31. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/forms/nameserver.py +2 -0
  32. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/forms/record.py +12 -6
  33. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/forms/record_template.py +10 -3
  34. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/forms/zone.py +142 -31
  35. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/forms/zone_template.py +38 -0
  36. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/graphql/__init__.py +7 -3
  37. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/graphql/filters.py +16 -0
  38. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/graphql/schema.py +20 -0
  39. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/graphql/types.py +67 -3
  40. netbox_plugin_dns-1.2.7/netbox_dns/locale/de/LC_MESSAGES/django.mo +0 -0
  41. netbox_plugin_dns-1.2.7/netbox_dns/locale/fr/LC_MESSAGES/django.mo +0 -0
  42. netbox_plugin_dns-1.2.7/netbox_dns/migrations/0015_dnssec.py +168 -0
  43. netbox_plugin_dns-1.2.7/netbox_dns/migrations/0016_dnssec_policy_status.py +18 -0
  44. netbox_plugin_dns-1.2.7/netbox_dns/migrations/0017_dnssec_policy_zone_zone_template.py +41 -0
  45. netbox_plugin_dns-1.2.7/netbox_dns/migrations/0018_zone_domain_status_zone_expiration_date.py +23 -0
  46. {netbox_plugin_dns-1.2.5/netbox_dns/forms → netbox_plugin_dns-1.2.7/netbox_dns/models}/__init__.py +3 -1
  47. netbox_plugin_dns-1.2.7/netbox_dns/models/dnssec_key_template.py +114 -0
  48. netbox_plugin_dns-1.2.7/netbox_dns/models/dnssec_policy.py +203 -0
  49. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/models/record.py +1 -1
  50. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/models/zone.py +74 -19
  51. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/models/zone_template.py +17 -7
  52. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/navigation.py +49 -0
  53. netbox_plugin_dns-1.2.7/netbox_dns/signals/dnssec.py +32 -0
  54. {netbox_plugin_dns-1.2.5/netbox_dns/models → netbox_plugin_dns-1.2.7/netbox_dns/tables}/__init__.py +3 -1
  55. netbox_plugin_dns-1.2.7/netbox_dns/tables/dnssec_key_template.py +48 -0
  56. netbox_plugin_dns-1.2.7/netbox_dns/tables/dnssec_policy.py +131 -0
  57. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/tables/zone.py +23 -2
  58. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/tables/zone_template.py +4 -0
  59. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/template_content.py +2 -1
  60. netbox_plugin_dns-1.2.7/netbox_dns/templates/netbox_dns/dnsseckeytemplate.html +70 -0
  61. netbox_plugin_dns-1.2.7/netbox_dns/templates/netbox_dns/dnssecpolicy.html +155 -0
  62. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/templates/netbox_dns/zone/registration.html +19 -0
  63. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/templates/netbox_dns/zone.html +16 -0
  64. netbox_plugin_dns-1.2.7/netbox_dns/templates/netbox_dns/zonetemplate/child.html +46 -0
  65. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/templates/netbox_dns/zonetemplate.html +12 -0
  66. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/urls.py +23 -0
  67. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/utilities/conversions.py +13 -0
  68. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/validators/__init__.py +1 -0
  69. netbox_plugin_dns-1.2.7/netbox_dns/validators/dnssec.py +148 -0
  70. {netbox_plugin_dns-1.2.5/netbox_dns/tables → netbox_plugin_dns-1.2.7/netbox_dns/views}/__init__.py +2 -0
  71. netbox_plugin_dns-1.2.7/netbox_dns/views/dnssec_key_template.py +87 -0
  72. netbox_plugin_dns-1.2.7/netbox_dns/views/dnssec_policy.py +155 -0
  73. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/views/zone.py +11 -1
  74. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7/netbox_plugin_dns.egg-info}/PKG-INFO +3 -2
  75. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_plugin_dns.egg-info/SOURCES.txt +28 -0
  76. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/pyproject.toml +1 -1
  77. netbox_plugin_dns-1.2.5/netbox_dns/choices/__init__.py +0 -2
  78. netbox_plugin_dns-1.2.5/netbox_dns/choices/zone.py +0 -24
  79. netbox_plugin_dns-1.2.5/netbox_dns/locale/de/LC_MESSAGES/django.mo +0 -0
  80. netbox_plugin_dns-1.2.5/netbox_dns/views/__init__.py +0 -8
  81. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/LICENSE +0 -0
  82. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/README.md +0 -0
  83. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/api/serializers_/__init__.py +0 -0
  84. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/api/serializers_/nameserver.py +0 -0
  85. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/api/serializers_/prefix.py +0 -0
  86. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/api/serializers_/registrar.py +0 -0
  87. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/api/serializers_/registration_contact.py +0 -0
  88. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/api/serializers_/view.py +0 -0
  89. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/apps.py +0 -0
  90. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/fields/address.py +0 -0
  91. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/fields/ipam.py +0 -0
  92. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/fields/network.py +0 -0
  93. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/fields/rfc2317.py +0 -0
  94. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/filtersets/nameserver.py +0 -0
  95. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/filtersets/record.py +0 -0
  96. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/filtersets/record_template.py +0 -0
  97. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/filtersets/registrar.py +0 -0
  98. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/filtersets/registration_contact.py +0 -0
  99. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/filtersets/view.py +0 -0
  100. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/forms/registrar.py +0 -0
  101. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/forms/registration_contact.py +0 -0
  102. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/forms/view.py +0 -0
  103. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/locale/en/LC_MESSAGES/django.mo +0 -0
  104. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/management/commands/cleanup_database.py +0 -0
  105. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/management/commands/cleanup_rrset_ttl.py +0 -0
  106. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/management/commands/rebuild_dnssync.py +0 -0
  107. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/management/commands/setup_dnssync.py +0 -0
  108. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/management/commands/update_soa.py +0 -0
  109. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/migrations/0001_squashed_netbox_dns_0_15.py +0 -0
  110. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/migrations/0001_squashed_netbox_dns_0_22.py +0 -0
  111. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/migrations/0002_contact_description_registrar_description.py +0 -0
  112. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/migrations/0003_default_view.py +0 -0
  113. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/migrations/0004_create_and_assign_default_view.py +0 -0
  114. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/migrations/0005_alter_zone_view_not_null.py +0 -0
  115. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/migrations/0006_templating.py +0 -0
  116. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/migrations/0007_alter_ordering_options.py +0 -0
  117. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/migrations/0008_view_prefixes.py +0 -0
  118. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/migrations/0009_rename_contact_registrationcontact.py +0 -0
  119. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/migrations/0010_view_ip_address_filter.py +0 -0
  120. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/migrations/0011_rename_related_fields.py +0 -0
  121. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/migrations/0012_natural_ordering.py +0 -0
  122. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/migrations/0013_zonetemplate_soa_mname_zonetemplate_soa_rname.py +0 -0
  123. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/migrations/0014_alter_unique_constraints_lowercase.py +0 -0
  124. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/migrations/0020_netbox_3_4.py +0 -0
  125. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/migrations/0021_record_ip_address.py +0 -0
  126. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/migrations/0022_search.py +0 -0
  127. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/migrations/0023_alter_record_value.py +0 -0
  128. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/migrations/0024_tenancy.py +0 -0
  129. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/migrations/0025_ipam_coupling_cf.py +0 -0
  130. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/migrations/0026_domain_registration.py +0 -0
  131. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/migrations/0027_alter_registrar_iana_id.py +0 -0
  132. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/migrations/0028_rfc2317_fields.py +0 -0
  133. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/migrations/0029_record_fqdn.py +0 -0
  134. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/migrations/__init__.py +0 -0
  135. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/mixins/__init__.py +0 -0
  136. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/mixins/object_modification.py +0 -0
  137. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/models/nameserver.py +0 -0
  138. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/models/record_template.py +0 -0
  139. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/models/registrar.py +0 -0
  140. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/models/registration_contact.py +0 -0
  141. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/models/view.py +0 -0
  142. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/signals/__init__.py +0 -0
  143. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/signals/ipam_dnssync.py +0 -0
  144. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/tables/ipam_dnssync.py +0 -0
  145. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/tables/nameserver.py +0 -0
  146. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/tables/record.py +0 -0
  147. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/tables/record_template.py +0 -0
  148. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/tables/registrar.py +0 -0
  149. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/tables/registration_contact.py +0 -0
  150. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/tables/view.py +0 -0
  151. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/templates/netbox_dns/nameserver.html +0 -0
  152. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/templates/netbox_dns/record/managed.html +0 -0
  153. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/templates/netbox_dns/record/related.html +0 -0
  154. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/templates/netbox_dns/record.html +0 -0
  155. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/templates/netbox_dns/recordtemplate.html +0 -0
  156. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/templates/netbox_dns/registrar.html +0 -0
  157. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/templates/netbox_dns/registrationcontact.html +0 -0
  158. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/templates/netbox_dns/view/button.html +0 -0
  159. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/templates/netbox_dns/view/prefix.html +0 -0
  160. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/templates/netbox_dns/view/related.html +0 -0
  161. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/templates/netbox_dns/view.html +0 -0
  162. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/templates/netbox_dns/zone/base.html +0 -0
  163. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/templates/netbox_dns/zone/child.html +0 -0
  164. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/templates/netbox_dns/zone/child_zone.html +0 -0
  165. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/templates/netbox_dns/zone/delegation_record.html +0 -0
  166. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/templates/netbox_dns/zone/managed_record.html +0 -0
  167. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/templates/netbox_dns/zone/record.html +0 -0
  168. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/templates/netbox_dns/zone/rfc2317_child_zone.html +0 -0
  169. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/templatetags/__init__.py +0 -0
  170. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/templatetags/netbox_dns.py +0 -0
  171. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/utilities/__init__.py +0 -0
  172. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/utilities/dns.py +0 -0
  173. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/utilities/ipam_dnssync.py +0 -0
  174. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/validators/dns_name.py +0 -0
  175. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/validators/dns_value.py +0 -0
  176. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/validators/rfc2317.py +0 -0
  177. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/views/nameserver.py +0 -0
  178. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/views/record.py +0 -0
  179. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/views/record_template.py +0 -0
  180. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/views/registrar.py +0 -0
  181. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/views/registration_contact.py +0 -0
  182. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/views/view.py +0 -0
  183. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_dns/views/zone_template.py +0 -0
  184. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_plugin_dns.egg-info/dependency_links.txt +0 -0
  185. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_plugin_dns.egg-info/requires.txt +0 -0
  186. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/netbox_plugin_dns.egg-info/top_level.txt +0 -0
  187. {netbox_plugin_dns-1.2.5 → netbox_plugin_dns-1.2.7}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: netbox-plugin-dns
3
- Version: 1.2.5
3
+ Version: 1.2.7
4
4
  Summary: NetBox DNS is a NetBox plugin for managing DNS data.
5
5
  Author-email: Peter Eckel <pete@netbox-dns.org>
6
6
  Project-URL: Homepage, https://github.com/peteeckel/netbox-plugin-dns
@@ -13,6 +13,7 @@ Requires-Python: >=3.10
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
15
  Requires-Dist: dnspython
16
+ Dynamic: license-file
16
17
 
17
18
  # NetBox DNS
18
19
  The NetBox DNS plugin enables NetBox to manage operational DNS data such as name servers, zones, records and views, as well as registration data for domains. It can automate tasks like creating PTR records, generating zone serial numbers, NS and SOA records, as well as validate names and values values for resource records to ensure zone data is consistent, up-to-date and compliant with to the relevant RFCs.
@@ -7,7 +7,7 @@ from ipam.choices import IPAddressStatusChoices
7
7
 
8
8
  from netbox_dns.choices import RecordTypeChoices, RecordStatusChoices, ZoneStatusChoices
9
9
 
10
- __version__ = "1.2.5"
10
+ __version__ = "1.2.7"
11
11
 
12
12
 
13
13
  def _check_list(setting):
@@ -36,6 +36,7 @@ class DNSConfig(PluginConfig):
36
36
  ZoneStatusChoices.STATUS_ACTIVE,
37
37
  ZoneStatusChoices.STATUS_DYNAMIC,
38
38
  ],
39
+ "zone_expiration_warning_days": 30,
39
40
  "filter_record_types": [],
40
41
  "record_active_status": [
41
42
  RecordStatusChoices.STATUS_ACTIVE,
@@ -65,12 +66,26 @@ class DNSConfig(PluginConfig):
65
66
  "menu_name": "DNS",
66
67
  "top_level_menu": True,
67
68
  "convert_names_to_lowercase": False,
69
+ "dnssec_purge_keys": 7776000, # P90D
70
+ "dnssec_publish_safety": 3600, # PT1H
71
+ "dnssec_retire_safety": 3600, # PT1H
72
+ "dnssec_signatures_jitter": 43200, # PT12H
73
+ "dnssec_signatures_refresh": 432000, # P5D
74
+ "dnssec_signatures_validity": 1209600, # P14D
75
+ "dnssec_signatures_validity_dnskey": 1209600, # P14D
76
+ "dnssec_max_zone_ttl": 86400, # P1D
77
+ "dnssec_zone_propagation_delay": 300, # PT5M
78
+ "dnssec_parent_ds_ttl": 86400, # P1D
79
+ "dnssec_parent_propagation_delay": 3600, # PT1H
80
+ "dnssec_dnskey_ttl": 3600, # PT1H
68
81
  }
69
82
  base_url = "netbox-dns"
70
83
 
71
84
  def ready(self):
72
85
  super().ready()
73
86
 
87
+ import netbox_dns.signals.dnssec # noqa: F401
88
+
74
89
  if not get_plugin_config("netbox_dns", "dnssync_disabled"):
75
90
  import netbox_dns.signals.ipam_dnssync # noqa: F401
76
91
  import netbox_dns.tables.ipam_dnssync # noqa: F401
@@ -83,13 +98,6 @@ class DNSConfig(PluginConfig):
83
98
  ):
84
99
  _check_list(setting)
85
100
 
86
- # +
87
- # TODO: Remove this workaround as soon as it's no longer required
88
- #
89
- # Force loading views so the register_model_view is run for all views
90
- # -
91
- import netbox_dns.views # noqa: F401
92
-
93
101
 
94
102
  #
95
103
  # Initialize plugin config
@@ -0,0 +1,25 @@
1
+ from django.utils.translation import gettext_lazy as _
2
+ from rest_framework import serializers
3
+
4
+ from netbox_dns.utilities import iso8601_to_int
5
+
6
+ __all__ = ("TimePeriodField",)
7
+
8
+
9
+ class TimePeriodField(serializers.IntegerField):
10
+ default_error_messages = {
11
+ "invalid": _(
12
+ "Enter a positive integer or an ISO8601 duration (W, M and Y are not supported)."
13
+ ),
14
+ }
15
+
16
+ def to_internal_value(self, data):
17
+ try:
18
+ return iso8601_to_int(data)
19
+ except TypeError:
20
+ raise serializers.ValidationError(
21
+ "Enter a valid integer or ISO 8601 duration (W, M and Y are not supported)."
22
+ )
23
+
24
+ def to_representation(self, value):
25
+ return value
@@ -3,7 +3,7 @@ from rest_framework import serializers
3
3
 
4
4
  from netbox.api.serializers import WritableNestedSerializer
5
5
 
6
- from netbox_dns.models import Zone, Record, ZoneTemplate, RecordTemplate
6
+ from netbox_dns.models import Zone, Record, ZoneTemplate, RecordTemplate, DNSSECPolicy
7
7
  from netbox_dns.api.serializers_.view import ViewSerializer
8
8
 
9
9
 
@@ -12,6 +12,7 @@ __all__ = (
12
12
  "NestedRecordSerializer",
13
13
  "NestedZoneTemplateSerializer",
14
14
  "NestedRecordTemplateSerializer",
15
+ "NestedDNSSECPolicySerializer",
15
16
  )
16
17
 
17
18
 
@@ -127,3 +128,20 @@ class NestedRecordTemplateSerializer(WritableNestedSerializer):
127
128
  "ttl",
128
129
  "description",
129
130
  )
131
+
132
+
133
+ class NestedDNSSECPolicySerializer(WritableNestedSerializer):
134
+ url = serializers.HyperlinkedIdentityField(
135
+ view_name="plugins-api:netbox_dns-api:dnssecpolicy-detail"
136
+ )
137
+
138
+ class Meta:
139
+ model = DNSSECPolicy
140
+ fields = (
141
+ "id",
142
+ "url",
143
+ "display",
144
+ "name",
145
+ "description",
146
+ "status",
147
+ )
@@ -6,6 +6,9 @@ from .serializers_.view import *
6
6
  from .serializers_.zone import *
7
7
  from .serializers_.zone_template import *
8
8
  from .serializers_.record_template import *
9
+ from .serializers_.dnssec_key_template import *
10
+ from .serializers_.dnssec_policy import *
11
+
9
12
  from .serializers_.prefix import *
10
13
 
11
14
  from .nested_serializers import *
@@ -0,0 +1,59 @@
1
+ from django.utils.translation import gettext as _
2
+ from rest_framework import serializers
3
+
4
+ from netbox.api.serializers import NetBoxModelSerializer
5
+ from tenancy.api.serializers_.tenants import TenantSerializer
6
+
7
+ from netbox_dns.models import DNSSECKeyTemplate
8
+
9
+ from ..nested_serializers import NestedDNSSECPolicySerializer
10
+ from ..field_serializers import TimePeriodField
11
+
12
+
13
+ __all__ = ("DNSSECKeyTemplateSerializer",)
14
+
15
+
16
+ class DNSSECKeyTemplateSerializer(NetBoxModelSerializer):
17
+ url = serializers.HyperlinkedIdentityField(
18
+ view_name="plugins-api:netbox_dns-api:dnsseckeytemplate-detail"
19
+ )
20
+ lifetime = TimePeriodField(required=False, allow_null=True)
21
+ policies = NestedDNSSECPolicySerializer(
22
+ many=True,
23
+ read_only=True,
24
+ required=False,
25
+ default=None,
26
+ help_text=_("Policies using this Key Template"),
27
+ )
28
+ tenant = TenantSerializer(required=False, allow_null=True)
29
+
30
+ class Meta:
31
+ model = DNSSECKeyTemplate
32
+ fields = (
33
+ "id",
34
+ "url",
35
+ "display",
36
+ "name",
37
+ "description",
38
+ "policies",
39
+ "tags",
40
+ "type",
41
+ "lifetime",
42
+ "algorithm",
43
+ "key_size",
44
+ "created",
45
+ "last_updated",
46
+ "custom_fields",
47
+ "tenant",
48
+ )
49
+ brief_fields = (
50
+ "id",
51
+ "url",
52
+ "display",
53
+ "name",
54
+ "type",
55
+ "lifetime",
56
+ "algorithm",
57
+ "key_size",
58
+ "description",
59
+ )
@@ -0,0 +1,113 @@
1
+ from django.utils.translation import gettext as _
2
+ from rest_framework import serializers
3
+
4
+ from netbox.api.serializers import NetBoxModelSerializer
5
+ from tenancy.api.serializers_.tenants import TenantSerializer
6
+
7
+ from netbox_dns.models import DNSSECPolicy
8
+
9
+ from .dnssec_key_template import DNSSECKeyTemplateSerializer
10
+ from ..nested_serializers import NestedZoneSerializer, NestedZoneTemplateSerializer
11
+ from ..field_serializers import TimePeriodField
12
+
13
+
14
+ __all__ = ("DNSSECPolicySerializer",)
15
+
16
+
17
+ class DNSSECPolicySerializer(NetBoxModelSerializer):
18
+ url = serializers.HyperlinkedIdentityField(
19
+ view_name="plugins-api:netbox_dns-api:dnssecpolicy-detail"
20
+ )
21
+ key_templates = DNSSECKeyTemplateSerializer(
22
+ nested=True,
23
+ many=True,
24
+ read_only=False,
25
+ required=False,
26
+ default=None,
27
+ help_text=_("Key templates assigned to the policy"),
28
+ )
29
+ dnskey_ttl = TimePeriodField(required=False, allow_null=True)
30
+ purge_keys = TimePeriodField(required=False, allow_null=True)
31
+ publish_safety = TimePeriodField(required=False, allow_null=True)
32
+ retire_safety = TimePeriodField(required=False, allow_null=True)
33
+ signatures_jitter = TimePeriodField(required=False, allow_null=True)
34
+ signatures_refresh = TimePeriodField(required=False, allow_null=True)
35
+ signatures_validity = TimePeriodField(required=False, allow_null=True)
36
+ signatures_validity_dnskey = TimePeriodField(required=False, allow_null=True)
37
+ max_zone_ttl = TimePeriodField(required=False, allow_null=True)
38
+ zone_propagation_delay = TimePeriodField(required=False, allow_null=True)
39
+ parent_ds_ttl = TimePeriodField(required=False, allow_null=True)
40
+ parent_propagation_delay = TimePeriodField(required=False, allow_null=True)
41
+ zones = NestedZoneSerializer(
42
+ many=True,
43
+ read_only=True,
44
+ required=False,
45
+ default=None,
46
+ help_text=_("Zones this policy is assigned to"),
47
+ )
48
+ zone_templates = NestedZoneTemplateSerializer(
49
+ many=True,
50
+ read_only=True,
51
+ required=False,
52
+ default=None,
53
+ help_text=_("Zone templates this policy is assigned to"),
54
+ )
55
+ tenant = TenantSerializer(required=False, allow_null=True)
56
+
57
+ class Meta:
58
+ model = DNSSECPolicy
59
+ fields = (
60
+ "id",
61
+ "url",
62
+ "display",
63
+ "name",
64
+ "description",
65
+ "status",
66
+ "tags",
67
+ "key_templates",
68
+ "zones",
69
+ "zone_templates",
70
+ "dnskey_ttl",
71
+ "purge_keys",
72
+ "publish_safety",
73
+ "retire_safety",
74
+ "signatures_jitter",
75
+ "signatures_refresh",
76
+ "signatures_validity",
77
+ "signatures_validity_dnskey",
78
+ "max_zone_ttl",
79
+ "zone_propagation_delay",
80
+ "create_cdnskey",
81
+ "cds_digest_types",
82
+ "parent_ds_ttl",
83
+ "parent_propagation_delay",
84
+ "use_nsec3",
85
+ "nsec3_iterations",
86
+ "nsec3_opt_out",
87
+ "nsec3_salt_size",
88
+ "created",
89
+ "last_updated",
90
+ "custom_fields",
91
+ "tenant",
92
+ )
93
+ brief_fields = ("id", "url", "display", "name", "description", "status")
94
+
95
+ def create(self, validated_data):
96
+ dnssec_key_templates = validated_data.pop("key_templates", None)
97
+
98
+ dnssec_policy = super().create(validated_data)
99
+
100
+ if dnssec_key_templates is not None:
101
+ dnssec_policy.key_templates.set(dnssec_key_templates)
102
+
103
+ return dnssec_policy
104
+
105
+ def update(self, instance, validated_data):
106
+ dnssec_key_templates = validated_data.pop("key_templates", None)
107
+
108
+ dnssec_policy = super().update(instance, validated_data)
109
+
110
+ if dnssec_key_templates is not None:
111
+ dnssec_policy.key_templates.set(dnssec_key_templates)
112
+
113
+ return dnssec_policy
@@ -8,6 +8,7 @@ from tenancy.api.serializers import TenantSerializer
8
8
  from netbox_dns.models import Record
9
9
 
10
10
  from ..nested_serializers import NestedZoneSerializer, NestedRecordSerializer
11
+ from ..field_serializers import TimePeriodField
11
12
 
12
13
 
13
14
  __all__ = ("RecordSerializer",)
@@ -17,6 +18,7 @@ class RecordSerializer(NetBoxModelSerializer):
17
18
  url = serializers.HyperlinkedIdentityField(
18
19
  view_name="plugins-api:netbox_dns-api:record-detail"
19
20
  )
21
+ ttl = TimePeriodField(required=False, allow_null=True)
20
22
  ptr_record = NestedRecordSerializer(
21
23
  many=False,
22
24
  read_only=True,
@@ -7,6 +7,7 @@ from tenancy.api.serializers import TenantSerializer
7
7
  from netbox_dns.models import RecordTemplate
8
8
 
9
9
  from ..nested_serializers import NestedZoneTemplateSerializer
10
+ from ..field_serializers import TimePeriodField
10
11
 
11
12
 
12
13
  __all__ = ("RecordTemplateSerializer",)
@@ -16,6 +17,7 @@ class RecordTemplateSerializer(NetBoxModelSerializer):
16
17
  url = serializers.HyperlinkedIdentityField(
17
18
  view_name="plugins-api:netbox_dns-api:recordtemplate-detail"
18
19
  )
20
+ ttl = TimePeriodField(required=False, allow_null=True)
19
21
  tenant = TenantSerializer(nested=True, required=False, allow_null=True)
20
22
  zone_templates = NestedZoneTemplateSerializer(
21
23
  many=True,
@@ -9,8 +9,10 @@ from .nameserver import NameServerSerializer
9
9
  from .registrar import RegistrarSerializer
10
10
  from .registration_contact import RegistrationContactSerializer
11
11
  from .zone_template import ZoneTemplateSerializer
12
+ from .dnssec_policy import DNSSECPolicySerializer
12
13
 
13
14
  from ..nested_serializers import NestedZoneSerializer
15
+ from ..field_serializers import TimePeriodField
14
16
 
15
17
  from netbox_dns.models import Zone
16
18
 
@@ -37,6 +39,8 @@ class ZoneSerializer(NetBoxModelSerializer):
37
39
  required=False,
38
40
  help_text=_("Nameservers for the zone"),
39
41
  )
42
+ default_ttl = TimePeriodField(required=False, allow_null=True)
43
+ soa_ttl = TimePeriodField(required=False, allow_null=True)
40
44
  soa_mname = NameServerSerializer(
41
45
  nested=True,
42
46
  many=False,
@@ -50,6 +54,10 @@ class ZoneSerializer(NetBoxModelSerializer):
50
54
  required=False,
51
55
  help_text=_("Contact email for the zone"),
52
56
  )
57
+ soa_refresh = TimePeriodField(required=False, allow_null=True)
58
+ soa_retry = TimePeriodField(required=False, allow_null=True)
59
+ soa_expire = TimePeriodField(required=False, allow_null=True)
60
+ soa_minimum = TimePeriodField(required=False, allow_null=True)
53
61
  rfc2317_parent_zone = NestedZoneSerializer(
54
62
  many=False,
55
63
  read_only=True,
@@ -62,6 +70,13 @@ class ZoneSerializer(NetBoxModelSerializer):
62
70
  required=False,
63
71
  help_text=_("RFC2317 child zones of the zone"),
64
72
  )
73
+ dnssec_policy = DNSSECPolicySerializer(
74
+ nested=True,
75
+ many=False,
76
+ read_only=False,
77
+ required=False,
78
+ help_text=_("DNSSEC policy to apply to the zone"),
79
+ )
65
80
  registrar = RegistrarSerializer(
66
81
  nested=True,
67
82
  many=False,
@@ -112,7 +127,7 @@ class ZoneSerializer(NetBoxModelSerializer):
112
127
  tenant = TenantSerializer(nested=True, required=False, allow_null=True)
113
128
 
114
129
  def validate(self, data):
115
- if (template := data.get("template")) is not None:
130
+ if isinstance(data, dict) and (template := data.get("template")) is not None:
116
131
  template.apply_to_zone_data(data)
117
132
 
118
133
  return super().validate(data)
@@ -173,8 +188,12 @@ class ZoneSerializer(NetBoxModelSerializer):
173
188
  "rfc2317_parent_managed",
174
189
  "rfc2317_parent_zone",
175
190
  "rfc2317_child_zones",
191
+ "dnssec_policy",
192
+ "inline_signing",
176
193
  "registrar",
177
194
  "registry_domain_id",
195
+ "expiration_date",
196
+ "domain_status",
178
197
  "registrant",
179
198
  "tech_c",
180
199
  "admin_c",
@@ -10,6 +10,7 @@ from netbox_dns.api.nested_serializers import NestedRecordTemplateSerializer
10
10
  from .nameserver import NameServerSerializer
11
11
  from .registrar import RegistrarSerializer
12
12
  from .registration_contact import RegistrationContactSerializer
13
+ from .dnssec_policy import DNSSECPolicySerializer
13
14
 
14
15
 
15
16
  __all__ = ("ZoneTemplateSerializer",)
@@ -39,6 +40,13 @@ class ZoneTemplateSerializer(NetBoxModelSerializer):
39
40
  required=False,
40
41
  help_text=_("Record templates assigned to the zone template"),
41
42
  )
43
+ dnssec_policy = DNSSECPolicySerializer(
44
+ nested=True,
45
+ many=False,
46
+ read_only=False,
47
+ required=False,
48
+ help_text=_("DNSSEC policy assigned to the zone template"),
49
+ )
42
50
  registrar = RegistrarSerializer(
43
51
  nested=True,
44
52
  many=False,
@@ -113,20 +121,21 @@ class ZoneTemplateSerializer(NetBoxModelSerializer):
113
121
  "id",
114
122
  "url",
115
123
  "name",
124
+ "description",
116
125
  "display",
117
126
  "nameservers",
118
127
  "soa_mname",
119
128
  "soa_rname",
120
- "description",
121
- "tags",
122
- "created",
123
- "last_updated",
129
+ "dnssec_policy",
124
130
  "registrar",
125
131
  "registrant",
126
132
  "tech_c",
127
133
  "admin_c",
128
134
  "billing_c",
129
135
  "active",
136
+ "tags",
137
+ "created",
138
+ "last_updated",
130
139
  "custom_fields",
131
140
  "tenant",
132
141
  "record_templates",
@@ -10,6 +10,8 @@ from netbox_dns.api.views import (
10
10
  RegistrationContactViewSet,
11
11
  ZoneTemplateViewSet,
12
12
  RecordTemplateViewSet,
13
+ DNSSECKeyTemplateViewSet,
14
+ DNSSECPolicyViewSet,
13
15
  PrefixViewSet,
14
16
  )
15
17
 
@@ -24,6 +26,8 @@ router.register("registrars", RegistrarViewSet)
24
26
  router.register("contacts", RegistrationContactViewSet)
25
27
  router.register("zonetemplates", ZoneTemplateViewSet)
26
28
  router.register("recordtemplates", RecordTemplateViewSet)
29
+ router.register("dnsseckeytemplates", DNSSECKeyTemplateViewSet)
30
+ router.register("dnssecpolicies", DNSSECPolicyViewSet)
27
31
 
28
32
  router.register("prefixes", PrefixViewSet)
29
33
 
@@ -16,6 +16,8 @@ from netbox_dns.api.serializers import (
16
16
  RegistrationContactSerializer,
17
17
  ZoneTemplateSerializer,
18
18
  RecordTemplateSerializer,
19
+ DNSSECKeyTemplateSerializer,
20
+ DNSSECPolicySerializer,
19
21
  PrefixSerializer,
20
22
  )
21
23
  from netbox_dns.filtersets import (
@@ -27,6 +29,8 @@ from netbox_dns.filtersets import (
27
29
  RegistrationContactFilterSet,
28
30
  ZoneTemplateFilterSet,
29
31
  RecordTemplateFilterSet,
32
+ DNSSECKeyTemplateFilterSet,
33
+ DNSSECPolicyFilterSet,
30
34
  )
31
35
  from netbox_dns.models import (
32
36
  View,
@@ -37,6 +41,8 @@ from netbox_dns.models import (
37
41
  RegistrationContact,
38
42
  ZoneTemplate,
39
43
  RecordTemplate,
44
+ DNSSECKeyTemplate,
45
+ DNSSECPolicy,
40
46
  )
41
47
 
42
48
 
@@ -135,6 +141,18 @@ class RecordTemplateViewSet(NetBoxModelViewSet):
135
141
  filterset_class = RecordTemplateFilterSet
136
142
 
137
143
 
144
+ class DNSSECKeyTemplateViewSet(NetBoxModelViewSet):
145
+ queryset = DNSSECKeyTemplate.objects.all()
146
+ serializer_class = DNSSECKeyTemplateSerializer
147
+ filterset_class = DNSSECKeyTemplateFilterSet
148
+
149
+
150
+ class DNSSECPolicyViewSet(NetBoxModelViewSet):
151
+ queryset = DNSSECPolicy.objects.all()
152
+ serializer_class = DNSSECPolicySerializer
153
+ filterset_class = DNSSECPolicyFilterSet
154
+
155
+
138
156
  class PrefixViewSet(NetBoxModelViewSet):
139
157
  queryset = Prefix.objects.all()
140
158
  serializer_class = PrefixSerializer
@@ -0,0 +1,4 @@
1
+ from .record import *
2
+ from .zone import *
3
+ from .dnssec_key_template import *
4
+ from .dnssec_policy import *
@@ -0,0 +1,63 @@
1
+ from dns.dnssectypes import Algorithm
2
+
3
+ from django.utils.translation import gettext_lazy as _
4
+
5
+ from utilities.choices import ChoiceSet
6
+
7
+ from .utilities import define_choice_attributes
8
+
9
+ DEPRECATED_ALGORITHMS = (
10
+ Algorithm.RSAMD5,
11
+ Algorithm.DH,
12
+ Algorithm.DSA,
13
+ Algorithm.ECC,
14
+ Algorithm.RSASHA1,
15
+ Algorithm.DSANSEC3SHA1,
16
+ Algorithm.RSASHA1NSEC3SHA1,
17
+ Algorithm.RSASHA512,
18
+ Algorithm.ECCGOST,
19
+ )
20
+
21
+
22
+ __all__ = (
23
+ "DNSSECKeyTemplateTypeChoices",
24
+ "DNSSECKeyTemplateAlgorithmChoices",
25
+ "DNSSECKeyTemplateKeySizeChoices",
26
+ )
27
+
28
+
29
+ class DNSSECKeyTemplateTypeChoices(ChoiceSet):
30
+ TYPE_CSK = "CSK"
31
+ TYPE_KSK = "KSK"
32
+ TYPE_ZSK = "ZSK"
33
+
34
+ CHOICES = [
35
+ (TYPE_CSK, _("CSK"), "purple"),
36
+ (TYPE_KSK, _("KSK"), "blue"),
37
+ (TYPE_ZSK, _("ZSK"), "green"),
38
+ ]
39
+
40
+
41
+ class DNSSECKeyTemplateKeySizeChoices(ChoiceSet):
42
+ SIZE_512 = 512
43
+ SIZE_1024 = 1024
44
+ SIZE_2048 = 2048
45
+ SIZE_3072 = 3072
46
+ SIZE_4096 = 4096
47
+
48
+ CHOICES = [
49
+ (SIZE_512, 512),
50
+ (SIZE_1024, 1024),
51
+ (SIZE_2048, 2048),
52
+ (SIZE_3072, 3072),
53
+ (SIZE_4096, 4096),
54
+ ]
55
+
56
+
57
+ @define_choice_attributes()
58
+ class DNSSECKeyTemplateAlgorithmChoices(ChoiceSet):
59
+ CHOICES = [
60
+ (algorithm.name, f"{algorithm.name} ({algorithm.value})")
61
+ for algorithm in sorted(Algorithm, key=lambda a: a.value)
62
+ if algorithm.value < 252 and algorithm not in DEPRECATED_ALGORITHMS
63
+ ]
@@ -0,0 +1,40 @@
1
+ from dns.dnssectypes import DSDigest
2
+
3
+ from django.utils.translation import gettext_lazy as _
4
+
5
+ from utilities.choices import ChoiceSet
6
+
7
+ from .utilities import define_choice_attributes
8
+
9
+ DEPRECATED_DIGESTS = (
10
+ DSDigest.NULL,
11
+ DSDigest.SHA1,
12
+ DSDigest.GOST,
13
+ )
14
+
15
+
16
+ __all__ = (
17
+ "DNSSECPolicyDigestChoices",
18
+ "DNSSECPolicyStatusChoices",
19
+ )
20
+
21
+
22
+ @define_choice_attributes()
23
+ class DNSSECPolicyDigestChoices(ChoiceSet):
24
+ CHOICES = [
25
+ (digest.name, digest.name)
26
+ for digest in sorted(DSDigest, key=lambda a: a.name)
27
+ if digest not in DEPRECATED_DIGESTS
28
+ ]
29
+
30
+
31
+ class DNSSECPolicyStatusChoices(ChoiceSet):
32
+ key = "DNSSECPolicy.status"
33
+
34
+ STATUS_ACTIVE = "active"
35
+ STATUS_INACTIVE = "inactive"
36
+
37
+ CHOICES = [
38
+ (STATUS_ACTIVE, _("Active"), "blue"),
39
+ (STATUS_INACTIVE, _("Inactive"), "red"),
40
+ ]
@@ -1,11 +1,11 @@
1
1
  from dns import rdatatype, rdataclass
2
2
 
3
3
  from django.utils.translation import gettext_lazy as _
4
- from django.core.exceptions import ImproperlyConfigured
5
4
 
6
- from netbox.plugins.utils import get_plugin_config
7
5
  from utilities.choices import ChoiceSet
8
6
 
7
+ from .utilities import define_choice_attributes
8
+
9
9
 
10
10
  __all__ = (
11
11
  "RecordTypeChoices",
@@ -15,29 +15,6 @@ __all__ = (
15
15
  )
16
16
 
17
17
 
18
- def define_choice_attributes(filter_name=None):
19
- try:
20
- if filter_name is not None:
21
- filter_choices = get_plugin_config("netbox_dns", filter_name, [])
22
- else:
23
- filter_choices = []
24
- except ImproperlyConfigured:
25
- filter_choices = []
26
-
27
- def decorator(cls):
28
- choices = []
29
- for choice in cls._choices:
30
- if choice[0] not in filter_choices:
31
- setattr(cls, choice[0], choice[0])
32
- choices.append(choice)
33
- cls._choices = choices
34
- cls.CHOICES = choices
35
-
36
- return cls
37
-
38
- return decorator
39
-
40
-
41
18
  @define_choice_attributes()
42
19
  class RecordTypeChoices(ChoiceSet):
43
20
  CHOICES = [