pki.models.domain ================= .. py:module:: pki.models.domain .. autoapi-nested-parse:: Module that contains the DomainModel. Module Contents --------------- .. py:class:: DomainModel(*args, **kwargs) Bases: :py:obj:`django.db.models.Model` Domain Model. .. py:attribute:: unique_name .. py:attribute:: issuing_ca .. py:attribute:: is_active .. py:attribute:: created_at .. py:attribute:: updated_at .. py:method:: save(**kwargs) Save the Domain model and add default certificate profiles. .. py:property:: signature_suite :type: trustpoint_core.oid.SignatureSuite | None Get the signature suite for the domain (based on its Issuing CA). Returns None if the issuing CA doesn't have a certificate yet. .. py:property:: public_key_info :type: trustpoint_core.oid.PublicKeyInfo | None Get the public key info for the domain (based on its Issuing CA). Returns None if the issuing CA doesn't have a certificate yet. .. py:method:: clean() Validate that the issuing CA is not an auto-generated root CA. .. py:method:: get_issuing_ca_or_value_error() Gets the corresponding Issuing CA. :returns: The corresponding Issuing CA. :raises ValueError: If no Issuing CA is set. .. py:method:: get_allowed_cert_profiles() Gets the allowed certificate profiles for this domain. :returns: QuerySet of allowed DomainAllowedCertificateProfileModel instances. .. py:method:: get_allowed_cert_profile_names() Gets the set of allowed certificate profile names for this domain. :returns: Set of allowed certificate profile names. .. py:method:: get_allowed_cert_profile(cert_profile_str) Gets the requested certificate profile if it is allowed for this domain. Else, raises a ValueError. :param cert_profile_str: The name of the certificate profile to check. :returns: The requested CertificateProfileModel (if allowed). .. py:method:: set_allowed_cert_profiles(allowed_profile_data) Sets the certificate profiles allowed in the domain. :param allowed_profile_data: Dict where key is allowed certificate profile ID (str) and value is optional alias :returns: Set of rejected aliases due to duplication in the form of (alias, profile unique name) .. py:class:: DomainAllowedCertificateProfileModel(*args, **kwargs) Bases: :py:obj:`django.db.models.Model` Model representing allowed certificate profiles for a domain. .. py:attribute:: domain .. py:attribute:: certificate_profile .. py:attribute:: alias .. py:class:: Meta Bases: :py:obj:`django_stubs_ext.db.models.TypedModelMeta` Meta information. .. py:attribute:: constraints :type: ClassVar .. py:method:: get_list_of_display_names(allowed_profiles) :staticmethod: Get display names for the allowed certificate profiles, ensuring uniqueness. Returns a list of tuples containing (profile_id, display_name, unique_name). If multiple profiles share the same display name, the unique name will be appended to the display name for disambiguation.