full_access_group and cisa_analysts_group`. These

This commit is contained in:
Rachid Mrad 2023-10-04 14:29:15 -04:00
commit 3ae411d464
No known key found for this signature in database
GPG key ID: EF38E4CEC4A8F3CF
2 changed files with 40 additions and 26 deletions

View file

@ -1,28 +1,37 @@
# common.py # common.py
#
# ALGORITHM_CHOICES are options for alg attribute in DS Data and Key Data
# reference: https://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml # reference: https://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml
ALGORITHM_CHOICES = [ ALGORITHM_CHOICES = [
(1, "ERSA/MD5 [RSAMD5]"), (1, "(1) ERSA/MD5 [RSAMD5]"),
(2 , "Diffie-Hellman [DH]"), (2, "(2) Diffie-Hellman [DH]"),
(3 ,"DSA/SHA-1 [DSA]"), (3, "(3) DSA/SHA-1 [DSA]"),
(5 ,"RSA/SHA-1 [RSASHA1]"), (5, "(5) RSA/SHA-1 [RSASHA1]"),
(6 ,"DSA-NSEC3-SHA1"), (6, "(6) DSA-NSEC3-SHA1"),
(7 ,"RSASHA1-NSEC3-SHA1"), (7, "(7) RSASHA1-NSEC3-SHA1"),
(8 ,"RSA/SHA-256 [RSASHA256]"), (8, "(8) RSA/SHA-256 [RSASHA256]"),
(10 ,"RSA/SHA-512 [RSASHA512]"), (10, "(10) RSA/SHA-512 [RSASHA512]"),
(12 ,"GOST R 34.10-2001 [ECC-GOST]"), (12, "(12) GOST R 34.10-2001 [ECC-GOST]"),
(13 ,"ECDSA Curve P-256 with SHA-256 [ECDSAP256SHA256]"), (13, "(13) ECDSA Curve P-256 with SHA-256 [ECDSAP256SHA256]"),
(14 ,"ECDSA Curve P-384 with SHA-384 [ECDSAP384SHA384]"), (14, "(14) ECDSA Curve P-384 with SHA-384 [ECDSAP384SHA384]"),
(15 ,"Ed25519"), (15, "(15) Ed25519"),
(16 ,"Ed448"), (16, "(16) Ed448"),
] ]
# Q: What are the options? # DIGEST_TYPE_CHOICES are options for digestType attribute in DS Data
# reference: https://datatracker.ietf.org/doc/html/rfc4034#appendix-A.2
DIGEST_TYPE_CHOICES = [ DIGEST_TYPE_CHOICES = [
(0, "Reserved"), (0, "(0) Reserved"),
(1, "SHA-256"), (1, "(1) SHA-256"),
] ]
# Flag choices # PROTOCOL_CHOICES are options for protocol attribute in Key Data
# reference: https://datatracker.ietf.org/doc/html/rfc4034#section-2.1.2
PROTOCOL_CHOICES = [
(3, "(3) DNSSEC"),
]
# FLAG_CHOICES are options for flags attribute in Key Data
# reference: https://datatracker.ietf.org/doc/html/rfc4034#section-2.1.1
FLAG_CHOICES = [ FLAG_CHOICES = [
(0, "0"), (0, "(0)"),
(256, "256"), (256, "(256) ZSK"),
(257, "257"), (257, "(257) KSK"),
] ]

View file

@ -7,7 +7,7 @@ from django.forms import formset_factory
from phonenumber_field.widgets import RegionalPhoneNumberWidget from phonenumber_field.widgets import RegionalPhoneNumberWidget
from ..models import Contact, DomainInformation from ..models import Contact, DomainInformation
from .common import ALGORITHM_CHOICES, DIGEST_TYPE_CHOICES, FLAG_CHOICES from .common import ALGORITHM_CHOICES, DIGEST_TYPE_CHOICES, FLAG_CHOICES, PROTOCOL_CHOICES
class DomainAddUserForm(forms.Form): class DomainAddUserForm(forms.Form):
@ -230,13 +230,18 @@ class DomainKeydataForm(forms.Form):
choices=FLAG_CHOICES, choices=FLAG_CHOICES,
) )
protocol = forms.IntegerField( protocol = forms.TypedChoiceField(
max_value=3,
min_value=3,
initial=3,
required=True, required=True,
disabled=True, label="Protocol",
choices=PROTOCOL_CHOICES,
) )
# protocol = forms.IntegerField(
# max_value=3,
# min_value=3,
# initial=3,
# required=True,
# disabled=True,
# )
algorithm = forms.TypedChoiceField( algorithm = forms.TypedChoiceField(
required=True, required=True,