pki.views.issuing_casΒΆ

Views for Issuing CA management.

ClassesΒΆ

IssuingCaContextMixin

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

KeylessCaContextMixin

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

IssuingCaTableView

Issuing CA Table View.

IssuingCaAddMethodSelectView

View to select the method to add an Issuing CA.

IssuingCaAddFileImportPkcs12View

View to import an Issuing CA from a PKCS12 file.

IssuingCaAddFileImportSeparateFilesView

View to import an Issuing CA from separate PEM files.

IssuingCaConfigView

View to display the details of an Issuing CA.

KeylessCaConfigView

View to display the details of a Keyless CA.

IssuedCertificatesListView

View to display all certificates issued by a specific Issuing CA.

IssuingCaDetailView

Detail view for an Issuing CA.

IssuingCaBulkDeleteConfirmView

View to confirm the deletion of multiple Issuing CAs.

IssuingCaCrlGenerationView

View to manually generate a CRL for an Issuing CA.

CrlDownloadView

Unauthenticated view to download the certificate revocation list of any CA.

IssuingCaViewSet

ViewSet for managing Issuing CA instances via REST API.

Module ContentsΒΆ

class pki.views.issuing_cas.IssuingCaContextMixin[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 = 'cas'[source]ΒΆ
class pki.views.issuing_cas.KeylessCaContextMixin[source]ΒΆ

Bases: trustpoint.views.base.ContextDataMixin

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

context_page_category = 'pki'[source]ΒΆ
context_page_name = 'cas'[source]ΒΆ
class pki.views.issuing_cas.IssuingCaTableView[source]ΒΆ

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

Issuing CA Table View.

model[source]ΒΆ
template_name = 'pki/issuing_cas/issuing_cas.html'[source]ΒΆ
context_object_name = 'issuing_ca'[source]ΒΆ
paginate_by = 50[source]ΒΆ
default_sort_param = 'created_at'[source]ΒΆ
get_queryset()[source]ΒΆ

Return only issuing CAs.

Return type:

django.db.models.QuerySet[pki.models.CaModel, pki.models.CaModel]

get_context_data(*args, **kwargs)[source]ΒΆ

Add sorting information to the context.

Parameters:
  • args (Any)

  • kwargs (Any)

Return type:

dict[str, Any]

class pki.views.issuing_cas.IssuingCaAddMethodSelectView[source]ΒΆ

Bases: IssuingCaContextMixin, django.views.generic.edit.FormView[pki.forms.IssuingCaAddMethodSelectForm]

View to select the method to add an Issuing CA.

template_name = 'pki/issuing_cas/add/method_select.html'[source]ΒΆ
form_class[source]ΒΆ
form_valid(form)[source]ΒΆ

Redirect to the next step based on the selected method.

Parameters:

form (pki.forms.IssuingCaAddMethodSelectForm)

Return type:

django.http.HttpResponseRedirect

class pki.views.issuing_cas.IssuingCaAddFileImportPkcs12View[source]ΒΆ

Bases: IssuingCaContextMixin, django.views.generic.edit.FormView[pki.forms.IssuingCaAddFileImportPkcs12Form]

View to import an Issuing CA from a PKCS12 file.

template_name = 'pki/issuing_cas/add/file_import.html'[source]ΒΆ
form_class[source]ΒΆ
success_url[source]ΒΆ
form_valid(form)[source]ΒΆ

Handle the case where the form is valid.

Parameters:

form (pki.forms.IssuingCaAddFileImportPkcs12Form)

Return type:

django.http.HttpResponse

class pki.views.issuing_cas.IssuingCaAddFileImportSeparateFilesView[source]ΒΆ

Bases: IssuingCaContextMixin, django.views.generic.edit.FormView[pki.forms.IssuingCaAddFileImportSeparateFilesForm]

View to import an Issuing CA from separate PEM files.

template_name = 'pki/issuing_cas/add/file_import.html'[source]ΒΆ
form_class[source]ΒΆ
success_url[source]ΒΆ
form_valid(form)[source]ΒΆ

Handle the case where the form is valid.

Parameters:

form (pki.forms.IssuingCaAddFileImportSeparateFilesForm)

Return type:

django.http.HttpResponse

class pki.views.issuing_cas.IssuingCaConfigView[source]ΒΆ

Bases: trustpoint.logger.LoggerMixin, IssuingCaContextMixin, django.views.generic.detail.DetailView[pki.models.CaModel]

View to display the details of an Issuing CA.

http_method_names = ('get',)[source]ΒΆ
model[source]ΒΆ
success_url[source]ΒΆ
ignore_url[source]ΒΆ
template_name = 'pki/issuing_cas/config.html'[source]ΒΆ
context_object_name = 'issuing_ca'[source]ΒΆ
get_queryset()[source]ΒΆ

Return only issuing CAs.

Return type:

django.db.models.QuerySet[pki.models.CaModel, pki.models.CaModel]

get_context_data(**kwargs)[source]ΒΆ

Adds the issued certificates to the context.

Parameters:

**kwargs (Any) – Keyword arguments passed to super().get_context_data()

Returns:

The context to render the page.

Return type:

dict[str, Any]

class pki.views.issuing_cas.KeylessCaConfigView[source]ΒΆ

Bases: trustpoint.logger.LoggerMixin, KeylessCaContextMixin, django.views.generic.detail.DetailView[pki.models.CaModel]

View to display the details of a Keyless CA.

http_method_names = ('get',)[source]ΒΆ
model[source]ΒΆ
success_url[source]ΒΆ
ignore_url[source]ΒΆ
template_name = 'pki/keyless_cas/config.html'[source]ΒΆ
context_object_name = 'keyless_ca'[source]ΒΆ
get_queryset()[source]ΒΆ

Return only keyless CAs.

Return type:

django.db.models.QuerySet[pki.models.CaModel, pki.models.CaModel]

get_context_data(**kwargs)[source]ΒΆ

Add active CRL information to the context.

Parameters:

kwargs (Any)

Return type:

dict[str, Any]

class pki.views.issuing_cas.IssuedCertificatesListView[source]ΒΆ

Bases: IssuingCaContextMixin, django.views.generic.list.ListView[pki.models.CertificateModel]

View to display all certificates issued by a specific Issuing CA.

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

Gets the required and filtered QuerySet.

Returns:

The filtered QuerySet.

Return type:

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

get_context_data(**kwargs)[source]ΒΆ

Adds the issuing ca model object to the context.

Parameters:

**kwargs (Any) – Keyword arguments passed to super().get_context_data()

Returns:

The context to render the page.

Return type:

dict[str, Any]

class pki.views.issuing_cas.IssuingCaDetailView[source]ΒΆ

Bases: IssuingCaContextMixin, django.views.generic.detail.DetailView[pki.models.CaModel]

Detail view for an Issuing CA.

model[source]ΒΆ
success_url[source]ΒΆ
ignore_url[source]ΒΆ
template_name = 'pki/issuing_cas/details.html'[source]ΒΆ
context_object_name = 'issuing_ca'[source]ΒΆ
get_queryset()[source]ΒΆ

Return only issuing CAs.

Return type:

django.db.models.QuerySet[pki.models.CaModel, pki.models.CaModel]

class pki.views.issuing_cas.IssuingCaBulkDeleteConfirmView[source]ΒΆ

Bases: IssuingCaContextMixin, trustpoint.views.base.BulkDeleteView

View to confirm the deletion of multiple Issuing CAs.

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

Handle GET requests.

Parameters:
  • request (django.http.HttpRequest)

  • args (Any)

  • kwargs (Any)

Return type:

django.http.HttpResponse

get_queryset()[source]ΒΆ

Return only issuing CAs.

Return type:

django.db.models.QuerySet[pki.models.CaModel, pki.models.CaModel]

form_valid(form)[source]ΒΆ

Delete the selected Issuing CAs on valid form.

Parameters:

form (django.forms.Form)

Return type:

django.http.HttpResponse

class pki.views.issuing_cas.IssuingCaCrlGenerationView[source]ΒΆ

Bases: IssuingCaContextMixin, django.views.generic.detail.DetailView[pki.models.CaModel]

View to manually generate a CRL for an Issuing CA.

model[source]ΒΆ
success_url[source]ΒΆ
ignore_url[source]ΒΆ
context_object_name = 'issuing_ca'[source]ΒΆ
http_method_names = ('get',)[source]ΒΆ
get_queryset()[source]ΒΆ

Return only issuing CAs.

Return type:

django.db.models.QuerySet[pki.models.CaModel, pki.models.CaModel]

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

Generate a CRL for the Issuing CA (should be POST!).

Parameters:
  • request (django.http.HttpRequest)

  • args (Any)

  • kwargs (Any)

Return type:

django.http.HttpResponse

class pki.views.issuing_cas.CrlDownloadView[source]ΒΆ

Bases: IssuingCaContextMixin, django.views.generic.detail.DetailView[pki.models.CaModel]

Unauthenticated view to download the certificate revocation list of any CA.

http_method_names = ('get',)[source]ΒΆ
model[source]ΒΆ
success_url[source]ΒΆ
ignore_url[source]ΒΆ
context_object_name = 'ca'[source]ΒΆ
get_queryset()[source]ΒΆ

Return all CAs.

Return type:

django.db.models.QuerySet[pki.models.CaModel, pki.models.CaModel]

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

Download the CRL of the CA.

Parameters:
  • request (django.http.HttpRequest)

  • args (Any)

  • kwargs (Any)

Return type:

django.http.HttpResponse

class pki.views.issuing_cas.IssuingCaViewSet(**kwargs)[source]ΒΆ

Bases: trustpoint.logger.LoggerMixin, rest_framework.viewsets.ReadOnlyModelViewSet[pki.models.CaModel]

ViewSet for managing Issuing CA instances via REST API.

queryset[source]ΒΆ
serializer_class[source]ΒΆ
permission_classes[source]ΒΆ
filter_backends[source]ΒΆ
filterset_fields: ClassVar = ['unique_name', 'is_active'][source]ΒΆ
search_fields: ClassVar = ['unique_name', 'credential__certificate__common_name'][source]ΒΆ
ordering_fields: ClassVar = ['unique_name', 'created_at', 'updated_at'][source]ΒΆ
list(_request, *_args, **_kwargs)[source]ΒΆ

API endpoint to get all Issuing CAs.

Parameters:
  • _request (django.http.HttpRequest)

  • _args (Any)

  • _kwargs (Any)

Return type:

rest_framework.response.Response

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

API endpoint to get a single Issuing CA by ID.

Parameters:
  • request (django.http.HttpRequest)

  • args (Any)

  • kwargs (Any)

Return type:

rest_framework.response.Response

generate_crl(_request, **_kwargs)[source]ΒΆ

Generate a new CRL for this Issuing CA.

Parameters:
  • _request (django.http.HttpRequest)

  • _kwargs (Any)

Return type:

rest_framework.response.Response

crl(request, **_kwargs)[source]ΒΆ

Download the CRL for this Issuing CA.

Parameters:
  • request (django.http.HttpRequest)

  • _kwargs (Any)

Return type:

django.http.HttpResponse