pki.views.domainsΒΆ

Views for managing Domains.

ClassesΒΆ

DomainContextMixin

Mixin which adds context_data for the PKI -> Issuing CAs pages.

DomainTableView

Domain Table View.

DomainCreateView

View to create a new domain.

DomainDevIdRegistrationTableMixin

Mixin to add a table of DevID Registrations to the domain config view.

DomainConfigView

View to configure a domain, allows adding DevID registration patterns.

DomainDetailView

View to display domain details.

DomainCaBulkDeleteConfirmView

View to confirm the deletion of multiple Domains.

DevIdRegistrationCreateView

View to create a new DevID Registration.

DevIdRegistrationDeleteView

View to delete a DevID Registration.

DevIdMethodSelectView

View to select the method to add a DevID Registration pattern.

IssuedCertificatesView

View to list certificates issued by a specific Issuing CA for a Domain.

OnboardingMethodSelectIdevidHelpView

View to select the protocol for IDevID enrollment.

Module ContentsΒΆ

class pki.views.domains.DomainContextMixin[source]ΒΆ

Bases: trustpoint.views.base.ContextDataMixin

Mixin which adds context_data for the PKI -> Issuing CAs pages.

context_page_category = 'pki'[source]ΒΆ
context_page_name = 'domains'[source]ΒΆ
class pki.views.domains.DomainTableView[source]ΒΆ

Bases: DomainContextMixin, trustpoint.views.base.SortableTableMixin[pki.models.DomainModel], django.views.generic.list.ListView[pki.models.DomainModel]

Domain Table View.

model[source]ΒΆ
template_name = 'pki/domains/domain.html'[source]ΒΆ
context_object_name = 'domain-new'[source]ΒΆ
paginate_by = 50[source]ΒΆ
default_sort_param = 'unique_name'[source]ΒΆ
class pki.views.domains.DomainCreateView[source]ΒΆ

Bases: DomainContextMixin, django.views.generic.edit.CreateView[pki.models.DomainModel, django.forms.BaseModelForm[pki.models.DomainModel]]

View to create a new domain.

model[source]ΒΆ
fields = '__all__'[source]ΒΆ
template_name = 'pki/domains/add.html'[source]ΒΆ
success_url[source]ΒΆ
ignore_url[source]ΒΆ
get_form(_form_class=None)[source]ΒΆ

Override get_form to filter out autogen root CAs.

Parameters:

_form_class (Any)

Return type:

Any

form_valid(form)[source]ΒΆ

Handle the case where the form is valid.

Parameters:

form (django.forms.BaseModelForm[pki.models.DomainModel])

Return type:

django.http.HttpResponse

class pki.views.domains.DomainDevIdRegistrationTableMixin[source]ΒΆ

Bases: trustpoint.views.base.SortableTableMixin[pki.models.DevIdRegistration], trustpoint.views.base.ListInDetailView

Mixin to add a table of DevID Registrations to the domain config view.

model[source]ΒΆ
paginate_by = 50[source]ΒΆ
context_object_name = 'devid_registrations'[source]ΒΆ
default_sort_param = 'unique_name'[source]ΒΆ
get_queryset()[source]ΒΆ

Gets the queryset for the DevID Registration table.

Return type:

django.db.models.QuerySet[pki.models.DevIdRegistration]

class pki.views.domains.DomainConfigView[source]ΒΆ

Bases: DomainContextMixin, DomainDevIdRegistrationTableMixin, trustpoint.views.base.ListInDetailView

View to configure a domain, allows adding DevID registration patterns.

detail_model[source]ΒΆ
template_name = 'pki/domains/config.html'[source]ΒΆ
detail_context_object_name = 'domain'[source]ΒΆ
success_url[source]ΒΆ
get_context_data(**kwargs)[source]ΒΆ

Adds additional context data.

Parameters:

kwargs (Any)

Return type:

dict[str, Any]

post(request, *args, **kwargs)[source]ΒΆ

Handle config form submission.

Parameters:
  • request (django.http.HttpRequest)

  • args (Any)

  • kwargs (Any)

Return type:

django.http.HttpResponse

class pki.views.domains.DomainDetailView[source]ΒΆ

Bases: DomainContextMixin, DomainDevIdRegistrationTableMixin, trustpoint.views.base.ListInDetailView

View to display domain details.

detail_model[source]ΒΆ
template_name = 'pki/domains/details.html'[source]ΒΆ
detail_context_object_name = 'domain'[source]ΒΆ
class pki.views.domains.DomainCaBulkDeleteConfirmView[source]ΒΆ

Bases: DomainContextMixin, trustpoint.views.base.BulkDeleteView

View to confirm the deletion of multiple Domains.

model[source]ΒΆ
success_url[source]ΒΆ
ignore_url[source]ΒΆ
template_name = 'pki/domains/confirm_delete.html'[source]ΒΆ
context_object_name = 'domains'[source]ΒΆ
get(request, *args, **kwargs)[source]ΒΆ

Handle GET requests.

Parameters:
  • request (django.http.HttpRequest)

  • args (Any)

  • kwargs (Any)

Return type:

django.http.HttpResponse

form_valid(form)[source]ΒΆ

Attempt to delete domains if the form is valid.

Parameters:

form (django.forms.Form)

Return type:

django.http.HttpResponse

class pki.views.domains.DevIdRegistrationCreateView[source]ΒΆ

Bases: DomainContextMixin, django.views.generic.edit.FormView[pki.forms.DevIdRegistrationForm]

View to create a new DevID Registration.

http_method_names = ('get', 'post')[source]ΒΆ
template_name = 'pki/devid_registration/add.html'[source]ΒΆ
form_class[source]ΒΆ
get_context_data(**kwargs)[source]ΒΆ

Add additional context data.

Parameters:

kwargs (Any)

Return type:

dict[str, Any]

get_initial()[source]ΒΆ

Initialize the form with default values.

Return type:

dict[str, Any]

get_form_kwargs()[source]ΒΆ

Provide additional arguments to the form.

Return type:

dict[str, Any]

get_domain()[source]ΒΆ

Get domain from URL pk (GET) or form data (POST).

Return type:

pki.models.DomainModel | None

get_truststore(truststore_id)[source]ΒΆ

Fetch the truststore based on the primary key passed in the URL.

Parameters:

truststore_id (int)

Return type:

pki.models.truststore.TruststoreModel

form_valid(form)[source]ΒΆ

Handle the case where the form is valid.

Parameters:

form (pki.forms.DevIdRegistrationForm)

Return type:

django.http.HttpResponse

get_success_url()[source]ΒΆ

Return the URL to redirect to upon successful form submission.

Return type:

str

class pki.views.domains.DevIdRegistrationDeleteView[source]ΒΆ

Bases: DomainContextMixin, django.views.generic.DeleteView[pki.models.DevIdRegistration, Any]

View to delete a DevID Registration.

model[source]ΒΆ
template_name = 'pki/devid_registration/confirm_delete.html'[source]ΒΆ
success_url[source]ΒΆ
delete(request, *args, **kwargs)[source]ΒΆ

Override delete method to add a success message.

Parameters:
  • request (django.http.HttpRequest)

  • args (Any)

  • kwargs (Any)

Return type:

django.http.HttpResponse

class pki.views.domains.DevIdMethodSelectView[source]ΒΆ

Bases: DomainContextMixin, django.views.generic.edit.FormView[pki.forms.DevIdAddMethodSelectForm]

View to select the method to add a DevID Registration pattern.

template_name = 'pki/devid_registration/method_select.html'[source]ΒΆ
form_class[source]ΒΆ
get_context_data(**kwargs)[source]ΒΆ

Add additional context data.

Parameters:

kwargs (Any)

Return type:

dict[str, Any]

form_valid(form)[source]ΒΆ

Redirect to the view for the selected method.

Parameters:

form (pki.forms.DevIdAddMethodSelectForm)

Return type:

django.http.HttpResponseRedirect

class pki.views.domains.IssuedCertificatesView[source]ΒΆ

Bases: trustpoint.views.base.ContextDataMixin, django.views.generic.list.ListView[pki.models.CertificateModel]

View to list certificates issued by a specific Issuing CA for a Domain.

model[source]ΒΆ
template_name = 'pki/domains/issued_certificates.html'[source]ΒΆ
context_object_name = 'issued_certificates'[source]ΒΆ
get_queryset()[source]ΒΆ

Return only certificates associated with the domain’s issued credentials.

Return type:

django.db.models.QuerySet[pki.models.CertificateModel]

get_domain()[source]ΒΆ

Get the domain object based on the URL parameter.

Return type:

pki.models.DomainModel

get_context_data(**kwargs)[source]ΒΆ

Pass additional context data to the template.

Parameters:

kwargs (Any)

Return type:

dict[str, Any]

class pki.views.domains.OnboardingMethodSelectIdevidHelpView[source]ΒΆ

Bases: DomainContextMixin, django.views.generic.detail.DetailView[pki.models.DevIdRegistration]

View to select the protocol for IDevID enrollment.

template_name = 'pki/domains/idevid_method_select.html'[source]ΒΆ
context_object_name = 'devid_registration'[source]ΒΆ
model[source]ΒΆ
get_context_data(**kwargs)[source]ΒΆ

Add the required context for the template.

Parameters:

kwargs (Any)

Return type:

dict[str, Any]