pki.views.crlsΒΆ
CRL views for the PKI application.
ClassesΒΆ
Mixin which adds context_data for the PKI -> CRLs pages. |
|
Table view for all CRLs. |
|
View to confirm the deletion of multiple CRLs. |
|
View for downloading a single CRL. |
|
Detail view for a single CRL. |
|
Form for importing CRLs. |
|
View for importing CRLs. |
Module ContentsΒΆ
- class pki.views.crls.CrlContextMixin[source]ΒΆ
Bases:
trustpoint.views.base.ContextDataMixinMixin which adds context_data for the PKI -> CRLs pages.
- class pki.views.crls.CrlTableView[source]ΒΆ
Bases:
CrlContextMixin,django.views.generic.ListView[pki.models.CrlModel]Table view for all CRLs.
- get_queryset()[source]ΒΆ
Return all CRL models with related CA information.
- Return type:
django.db.models.QuerySet[pki.models.CrlModel]
- class pki.views.crls.CrlBulkDeleteConfirmView[source]ΒΆ
Bases:
trustpoint.views.base.BulkDeleteViewView to confirm the deletion of multiple CRLs.
- class pki.views.crls.CrlDownloadView[source]ΒΆ
Bases:
CrlContextMixin,django.views.generic.detail.DetailView[pki.models.CrlModel]View for downloading a single CRL.
- get_queryset()[source]ΒΆ
Return all CRL models with related CA information.
- Return type:
django.db.models.QuerySet[pki.models.CrlModel]
- get_object(queryset=None)[source]ΒΆ
Get the CRL object, handling both CRL primary keys and CA primary keys.
- Parameters:
queryset (django.db.models.QuerySet[pki.models.CrlModel] | None)
- Return type:
- get(request, pk=None, file_format=None, *args, **kwargs)[source]ΒΆ
HTTP GET Method.
If only the CRL primary key are passed in the url, the download summary will be displayed. If value for file_format is also provided, a file download will be performed.
- Parameters:
request (django.http.HttpRequest) β The HttpRequest object.
pk (str | None) β A string containing the CRL primary key.
file_format (str | None) β The format of the CRL to download.
*args (tuple[Any]) β Positional arguments.
**kwargs (dict[str, Any]) β Keyword arguments.
- Returns:
The HTTP response with either the download summary or a file download.
- Return type:
HttpResponse
- Raises:
Http404 β
- class pki.views.crls.CrlDetailView[source]ΒΆ
Bases:
CrlContextMixin,django.views.generic.detail.DetailView[pki.models.CrlModel]Detail view for a single CRL.
- get_queryset()[source]ΒΆ
Return CRL models with related CA information.
- Return type:
django.db.models.QuerySet[pki.models.CrlModel]
- get_object(queryset=None)[source]ΒΆ
Get the CRL object, handling both CRL primary keys and CA primary keys.
- Parameters:
queryset (django.db.models.QuerySet[pki.models.CrlModel] | None)
- Return type:
- class pki.views.crls.CrlImportForm(*args, **kwargs)[source]ΒΆ
Bases:
django.forms.FormForm for importing CRLs.
- Parameters:
args (Any)
kwargs (Any)
- ca: django.forms.ModelChoiceField[pki.models.CaModel][source]ΒΆ
- class pki.views.crls.CrlImportView[source]ΒΆ
Bases:
CrlContextMixin,django.views.generic.edit.FormView[CrlImportForm]View for importing CRLs.
- form_valid(form)[source]ΒΆ
Handle valid form submission.
- Parameters:
form (CrlImportForm)
- Return type:
django.http.HttpResponse
- _convert_to_pem(file_content)[source]ΒΆ
Convert file content to PEM format by automatically detecting the format.
- Parameters:
file_content (bytes) β The raw file content as bytes
- Returns:
The CRL in PEM format
- Return type:
str
- Raises:
ValidationError β If the conversion fails for all supported formats
- _try_pem(file_content)[source]ΒΆ
Try to load as PEM format.
- Parameters:
file_content (bytes)
- Return type:
str
- _try_der(file_content)[source]ΒΆ
Try to load as DER format.
- Parameters:
file_content (bytes)
- Return type:
str