signer.viewsΒΆ

Contains all the views of Signer App.

ClassesΒΆ

SignerContextMixin

Mixin which adds context_data for the Signer pages.

SignerTableView

Signer Table View.

SignerAddMethodSelectView

View to select the method to add a Signer.

SignerAddFileImportFileTypeSelectView

View to select the file type when importing a Signer.

SignerAddFileImportPkcs12View

View to import an Issuing CA from a PKCS12 file.

SignerAddFileImportSeparateFilesView

View to import a Signer from separate PEM files.

SignerConfigView

View to display the details of a Signer.

SignedMessagesListView

View to display all signed messages by a specific Signer.

SignerBulkDeleteConfirmView

View to confirm the deletion of multiple Signers.

SignHashView

View for signing a hash value with a selected signer.

SignHashSuccessView

View to display the signature result.

Module ContentsΒΆ

class signer.views.SignerContextMixin[source]ΒΆ

Bases: trustpoint.views.base.ContextDataMixin

Mixin which adds context_data for the Signer pages.

context_page_category = 'signer'[source]ΒΆ
class signer.views.SignerTableView[source]ΒΆ

Bases: SignerContextMixin, trustpoint.views.base.SortableTableMixin[signer.models.SignerModel], django.views.generic.ListView[signer.models.SignerModel]

Signer Table View.

model[source]ΒΆ
template_name = 'signer/signers.html'[source]ΒΆ
context_object_name = 'signers'[source]ΒΆ
paginate_by = 50[source]ΒΆ
default_sort_param = 'unique_name'[source]ΒΆ
class signer.views.SignerAddMethodSelectView[source]ΒΆ

Bases: SignerContextMixin, django.views.generic.edit.FormView[signer.forms.SignerAddMethodSelectForm]

View to select the method to add a Signer.

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

Redirect to the next step based on the selected method.

Parameters:

form (signer.forms.SignerAddMethodSelectForm)

Return type:

django.http.HttpResponseRedirect

class signer.views.SignerAddFileImportFileTypeSelectView[source]ΒΆ

Bases: SignerContextMixin, django.views.generic.edit.FormView[signer.forms.SignerAddFileTypeSelectForm]

View to select the file type when importing a Signer.

template_name = 'signer/add/file_type_select.html'[source]ΒΆ
form_class[source]ΒΆ
form_valid(form)[source]ΒΆ

Redirect to the next step based on the selected file type.

Parameters:

form (signer.forms.SignerAddFileTypeSelectForm)

Return type:

django.http.HttpResponseRedirect

class signer.views.SignerAddFileImportPkcs12View[source]ΒΆ

Bases: SignerContextMixin, django.views.generic.edit.FormView[signer.forms.SignerAddFileImportPkcs12Form]

View to import an Issuing CA from a PKCS12 file.

template_name = 'signer/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 (signer.forms.SignerAddFileImportPkcs12Form)

Return type:

django.http.HttpResponse

class signer.views.SignerAddFileImportSeparateFilesView[source]ΒΆ

Bases: SignerContextMixin, django.views.generic.edit.FormView[signer.forms.SignerAddFileImportSeparateFilesForm]

View to import a Signer from separate PEM files.

template_name = 'signer/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 (signer.forms.SignerAddFileImportSeparateFilesForm)

Return type:

django.http.HttpResponse

class signer.views.SignerConfigView[source]ΒΆ

Bases: trustpoint.logger.LoggerMixin, SignerContextMixin, django.views.generic.DetailView[signer.models.SignerModel]

View to display the details of a Signer.

http_method_names = ('get',)[source]ΒΆ
model[source]ΒΆ
success_url[source]ΒΆ
ignore_url[source]ΒΆ
template_name = 'signer/signer_config.html'[source]ΒΆ
context_object_name = 'signer'[source]ΒΆ
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 signer.views.SignedMessagesListView[source]ΒΆ

Bases: SignerContextMixin, django.views.generic.ListView[signer.models.SignedMessageModel]

View to display all signed messages by a specific Signer.

model[source]ΒΆ
template_name = 'signer/signed_messages.html'[source]ΒΆ
context_object_name = 'signed_messages'[source]ΒΆ
get_queryset()[source]ΒΆ

Gets the required and filtered QuerySet.

Returns:

The filtered QuerySet.

Return type:

django.db.models.QuerySet[signer.models.SignedMessageModel]

get_context_data(**kwargs)[source]ΒΆ

Adds the signer 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 signer.views.SignerBulkDeleteConfirmView[source]ΒΆ

Bases: SignerContextMixin, trustpoint.views.base.BulkDeleteView

View to confirm the deletion of multiple Signers.

model[source]ΒΆ
success_url[source]ΒΆ
ignore_url[source]ΒΆ
template_name = 'signer/confirm_delete.html'[source]ΒΆ
context_object_name = 'signers'[source]ΒΆ
form_valid(form)[source]ΒΆ

Delete the selected Signers on valid form.

Parameters:

form (Any)

Return type:

django.http.HttpResponse

class signer.views.SignHashView[source]ΒΆ

Bases: trustpoint.logger.LoggerMixin, SignerContextMixin, django.views.generic.edit.FormView[signer.forms.SignHashForm]

View for signing a hash value with a selected signer.

template_name = 'signer/sign_hash.html'[source]ΒΆ
form_class[source]ΒΆ
success_url[source]ΒΆ
form_valid(form)[source]ΒΆ

Sign the hash and display the signature.

Parameters:

form (signer.forms.SignHashForm)

Return type:

django.http.HttpResponse

class signer.views.SignHashSuccessView(**kwargs)[source]ΒΆ

Bases: SignerContextMixin, django.views.View

View to display the signature result.

template_name = 'signer/sign_hash_success.html'[source]ΒΆ
get(request)[source]ΒΆ

Display the signature result.

Parameters:

request (django.http.HttpRequest) – The HTTP request.

Returns:

HttpResponse with the signature result.

Return type:

django.http.HttpResponse

get_context_data(**kwargs)[source]ΒΆ

Get context data for the view.

Parameters:

kwargs (Any)

Return type:

dict[Any, Any]