pki.views.truststoresΒΆ
This module contains all views concerning the PKI -> Truststore section.
AttributesΒΆ
ClassesΒΆ
View that redirects to the index of the PKI Truststores application: Truststores. |
|
Mixin which adds some extra context for the PKI Views. |
|
Truststore Table View. |
|
View for creating a new Truststore. |
|
The truststore detail view. |
|
View for downloading a single truststore. |
|
View for downloading multiple truststores at once as archived files. |
|
View for confirming the deletion of multiple truststores. |
|
ViewSet for managing Truststore instances. |
Module ContentsΒΆ
- class pki.views.truststores.TruststoresRedirectView(**kwargs)[source]ΒΆ
Bases:
django.views.generic.base.RedirectViewView that redirects to the index of the PKI Truststores application: Truststores.
- class pki.views.truststores.TruststoresContextMixin[source]ΒΆ
Bases:
trustpoint.page_context.PageContextMixinMixin which adds some extra context for the PKI Views.
- class pki.views.truststores.TruststoreTableView[source]ΒΆ
Bases:
TruststoresContextMixin,trustpoint.views.base.SortableTableMixin[pki.models.truststore.TruststoreModel],django.views.generic.list.ListView[pki.models.truststore.TruststoreModel]Truststore Table View.
- apply_filters(qs)[source]ΒΆ
Applies the TruststoreFilter to the given queryset.
- Parameters:
qs (django.db.models.QuerySet[pki.models.truststore.TruststoreModel]) β The base queryset to filter.
- Returns:
The filtered queryset according to GET parameters.
- Return type:
django.db.models.QuerySet[pki.models.truststore.TruststoreModel]
- get_queryset()[source]ΒΆ
Filter queryset to only include truststores filtered by UI filters.
- Returns:
Returns a queryset of all TruststoreModels, filtered by UI filters.
- Return type:
django.db.models.QuerySet[pki.models.truststore.TruststoreModel]
- class pki.views.truststores.TruststoreCreateView[source]ΒΆ
Bases:
TruststoresContextMixin,django.views.generic.edit.FormView[pki.forms.TruststoreAddForm]View for creating a new Truststore.
- dispatch(request, *args, **kwargs)[source]ΒΆ
Set context flags based on URL.
- Parameters:
request (django.http.HttpRequest)
args (Any)
kwargs (Any)
- Return type:
django.http.HttpResponse
- form_valid(form)[source]ΒΆ
If the form is valid, redirect to Truststore overview.
- Parameters:
form (pki.forms.TruststoreAddForm)
- Return type:
django.http.HttpResponseRedirect
- class pki.views.truststores.TruststoreDetailView[source]ΒΆ
Bases:
TruststoresContextMixin,django.views.generic.detail.DetailView[pki.models.truststore.TruststoreModel]The truststore detail view.
- class pki.views.truststores.TruststoreDownloadView[source]ΒΆ
Bases:
TruststoresContextMixin,django.views.generic.detail.DetailView[pki.models.truststore.TruststoreModel]View for downloading a single truststore.
- get(request, pk=None, file_format=None, *args, **kwargs)[source]ΒΆ
HTTP GET Method.
If only the certificate 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.
Compare the re_path regex in the pki.urls package.
- Parameters:
request (django.http.HttpRequest) β The HttpRequest object.
pk (str | None) β A string containing the certificate primary key.
file_format (str | None) β The format of the certificate 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.truststores.TruststoreMultipleDownloadView[source]ΒΆ
Bases:
TruststoresContextMixin,trustpoint.views.base.PrimaryKeyListFromPrimaryKeyString,django.views.generic.list.ListView[pki.models.truststore.TruststoreModel]View for downloading multiple truststores at once as archived files.
- get_context_data(*args, **kwargs)[source]ΒΆ
Adding the part of the url to the context, that contains the truststores primary keys.
This is used for the {% url }% tags in the template to download files.
- Parameters:
*args (Any) β Positional arguments, unused.
**kwargs (dict[str, Any]) β Keyword arguments passed to super().get_context_data().
- Returns:
The context data.
- Return type:
dict
- get(request, pks=None, file_format=None, archive_format=None, *args, **kwargs)[source]ΒΆ
HTTP GET Method.
If only certificate primary keys are passed in the url, the download summary will be displayed. If value for file_format and archive_format are also provided, a file download will be performed.
Compare the re_path regex in the pki.urls package.
- Parameters:
request (django.http.HttpRequest) β The HttpRequest object.
pks (str | None) β A string containing the certificate primary keys, e.g. 1/2/3/4/5
file_format (None | str) β The format of the archived certificate files.
archive_format (None | str) β The archive format that will be provided as 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.truststores.TruststoreBulkDeleteConfirmView[source]ΒΆ
Bases:
TruststoresContextMixin,trustpoint.views.base.BulkDeleteViewView for confirming the deletion of multiple truststores.
- class pki.views.truststores.TruststoreViewSet(**kwargs)[source]ΒΆ
Bases:
rest_framework.viewsets.ModelViewSet[pki.models.truststore.TruststoreModel]ViewSet for managing Truststore instances.
Supports standard CRUD operations such as list, retrieve, create, update, and delete.