signer.views ============ .. py:module:: signer.views .. autoapi-nested-parse:: Contains all the views of Signer App. Module Contents --------------- .. py:class:: SignerContextMixin Bases: :py:obj:`trustpoint.views.base.ContextDataMixin` Mixin which adds context_data for the Signer pages. .. py:attribute:: context_page_category :value: 'signer' .. py:class:: SignerTableView Bases: :py:obj:`SignerContextMixin`, :py:obj:`trustpoint.views.base.SortableTableMixin`\ [\ :py:obj:`signer.models.SignerModel`\ ], :py:obj:`django.views.generic.ListView`\ [\ :py:obj:`signer.models.SignerModel`\ ] Signer Table View. .. py:attribute:: model .. py:attribute:: template_name :value: 'signer/signers.html' .. py:attribute:: context_object_name :value: 'signers' .. py:attribute:: paginate_by :value: 50 .. py:attribute:: default_sort_param :value: 'unique_name' .. py:class:: SignerAddMethodSelectView Bases: :py:obj:`SignerContextMixin`, :py:obj:`django.views.generic.edit.FormView`\ [\ :py:obj:`signer.forms.SignerAddMethodSelectForm`\ ] View to select the method to add a Signer. .. py:attribute:: template_name :value: 'signer/add/method_select.html' .. py:attribute:: form_class .. py:method:: form_valid(form) Redirect to the next step based on the selected method. .. py:class:: SignerAddFileImportFileTypeSelectView Bases: :py:obj:`SignerContextMixin`, :py:obj:`django.views.generic.edit.FormView`\ [\ :py:obj:`signer.forms.SignerAddFileTypeSelectForm`\ ] View to select the file type when importing a Signer. .. py:attribute:: template_name :value: 'signer/add/file_type_select.html' .. py:attribute:: form_class .. py:method:: form_valid(form) Redirect to the next step based on the selected file type. .. py:class:: SignerAddFileImportPkcs12View Bases: :py:obj:`SignerContextMixin`, :py:obj:`django.views.generic.edit.FormView`\ [\ :py:obj:`signer.forms.SignerAddFileImportPkcs12Form`\ ] View to import an Issuing CA from a PKCS12 file. .. py:attribute:: template_name :value: 'signer/add/file_import.html' .. py:attribute:: form_class .. py:attribute:: success_url .. py:method:: form_valid(form) Handle the case where the form is valid. .. py:class:: SignerAddFileImportSeparateFilesView Bases: :py:obj:`SignerContextMixin`, :py:obj:`django.views.generic.edit.FormView`\ [\ :py:obj:`signer.forms.SignerAddFileImportSeparateFilesForm`\ ] View to import a Signer from separate PEM files. .. py:attribute:: template_name :value: 'signer/add/file_import.html' .. py:attribute:: form_class .. py:attribute:: success_url .. py:method:: form_valid(form) Handle the case where the form is valid. .. py:class:: SignerConfigView Bases: :py:obj:`trustpoint.logger.LoggerMixin`, :py:obj:`SignerContextMixin`, :py:obj:`django.views.generic.DetailView`\ [\ :py:obj:`signer.models.SignerModel`\ ] View to display the details of a Signer. .. py:attribute:: http_method_names :value: ('get',) .. py:attribute:: model .. py:attribute:: success_url .. py:attribute:: ignore_url .. py:attribute:: template_name :value: 'signer/signer_config.html' .. py:attribute:: context_object_name :value: 'signer' .. py:method:: get_context_data(**kwargs) Adds the issued certificates to the context. :param \*\*kwargs: Keyword arguments passed to super().get_context_data() :returns: The context to render the page. .. py:class:: SignedMessagesListView Bases: :py:obj:`SignerContextMixin`, :py:obj:`django.views.generic.ListView`\ [\ :py:obj:`signer.models.SignedMessageModel`\ ] View to display all signed messages by a specific Signer. .. py:attribute:: model .. py:attribute:: template_name :value: 'signer/signed_messages.html' .. py:attribute:: context_object_name :value: 'signed_messages' .. py:method:: get_queryset() Gets the required and filtered QuerySet. :returns: The filtered QuerySet. .. py:method:: get_context_data(**kwargs) Adds the signer model object to the context. :param \*\*kwargs: Keyword arguments passed to super().get_context_data() :returns: The context to render the page. .. py:class:: SignerBulkDeleteConfirmView Bases: :py:obj:`SignerContextMixin`, :py:obj:`trustpoint.views.base.BulkDeleteView` View to confirm the deletion of multiple Signers. .. py:attribute:: model .. py:attribute:: success_url .. py:attribute:: ignore_url .. py:attribute:: template_name :value: 'signer/confirm_delete.html' .. py:attribute:: context_object_name :value: 'signers' .. py:method:: form_valid(form) Delete the selected Signers on valid form. .. py:class:: SignHashView Bases: :py:obj:`trustpoint.logger.LoggerMixin`, :py:obj:`SignerContextMixin`, :py:obj:`django.views.generic.edit.FormView`\ [\ :py:obj:`signer.forms.SignHashForm`\ ] View for signing a hash value with a selected signer. .. py:attribute:: template_name :value: 'signer/sign_hash.html' .. py:attribute:: form_class .. py:attribute:: success_url .. py:method:: form_valid(form) Sign the hash and display the signature. .. py:class:: SignHashSuccessView(**kwargs) Bases: :py:obj:`SignerContextMixin`, :py:obj:`django.views.View` View to display the signature result. .. py:attribute:: template_name :value: 'signer/sign_hash_success.html' .. py:method:: get(request) Display the signature result. :param request: The HTTP request. :returns: HttpResponse with the signature result. .. py:method:: get_context_data(**kwargs) Get context data for the view.