devices.views

This module contains all views concerning the devices application.

Module Contents

devices.views.DeviceWithoutDomainErrorMsg[source]
devices.views.NamedCurveMissingForEccErrorMsg[source]
devices.views.ActiveTrustpointTlsServerCredentialModelMissingErrorMsg[source]
devices.views.PublicKeyInfoMissingErrorMsg[source]
class devices.views.AbstractDeviceTableView[source]

Bases: trustpoint.page_context.PageContextMixin, django.views.generic.list.ListView[devices.models.DeviceModel], abc.ABC

Device Table View.

http_method_names = ('get',)[source]
model[source]
context_object_name = 'devices'[source]
paginate_by = 50[source]
default_sort_param = 'common_name'[source]
filterset_class[source]
page_category = 'devices'[source]
page_name: str[source]
apply_filters(qs)[source]

Applies the DeviceFilter to the given queryset.

Parameters:

qs (django.db.models.QuerySet[devices.models.DeviceModel]) – The base queryset to filter.

Returns:

The filtered queryset according to GET parameters.

Return type:

django.db.models.QuerySet[devices.models.DeviceModel]

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

Adds the object model to the instance and forwards to super().get().

Parameters:
  • request (django.http.request.HttpRequest) – The Django request object.

  • *args (Any) – Positional arguments passed to super().get().

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

Returns:

The HttpResponse object returned by super().get().

Return type:

django.http.HttpResponse

abstractmethod get_queryset()[source]

Filter queryset to only include devices which are of generic type.

Returns:

Returns a queryset of all DeviceModels which are of generic type.

Return type:

django.db.models.QuerySet[devices.models.DeviceModel]

get_context_data(**kwargs)[source]

Adds the clm and revoke buttons to the context.

Parameters:

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

Returns:

The context to use for rendering the devices page.

Return type:

dict[str, Any]

get_ordering()[source]

Returns the sort parameters as a list.

Returns:

The sort parameters, if any. Otherwise the default sort parameter.

Return type:

str | collections.abc.Sequence[str] | None

class devices.views.DeviceTableView[source]

Bases: AbstractDeviceTableView

Device Table View.

template_name = 'devices/devices.html'[source]
page_name = 'devices'[source]
get_queryset()[source]

Filter queryset to include all device types (Generic, OPC UA GDS Push) and filtered by UI filters.

Returns:

Returns a queryset of all DeviceModels (excluding OPC UA GDS), filtered by UI filters.

Return type:

django.db.models.QuerySet[devices.models.DeviceModel]

class devices.views.OpcUaGdsTableView[source]

Bases: DeviceTableView

Table View for devices where opc_ua_gds is True.

template_name = 'devices/opc_ua_gds.html'[source]
page_name = 'opc_ua_gds'[source]
get_queryset()[source]

Filter queryset to only include devices which are of OPC-UA GDS type and filtered by UI filters.

Returns:

Returns a queryset of all DeviceModels which are of OPC-UA GDS type, filtered by UI filters.

Return type:

django.db.models.QuerySet[devices.models.DeviceModel]

class devices.views.AbstractCreateChooseOnboaringView(**kwargs)[source]

Bases: trustpoint.page_context.PageContextMixin, django.views.generic.base.TemplateView

Abstract view for choosing if the new device shall be onboarded or not.

http_method_names = ('get',)[source]
template_name = 'devices/create_choose_onboarding.html'[source]
page_category = 'devices'[source]
page_name: str[source]
get_context_data(**kwargs)[source]

Adds the cancel url href according to the subcategory.

Parameters:

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

Returns:

The context to use for rendering the devices page.

Return type:

dict[str, Any]

class devices.views.DeviceCreateChooseOnboardingView(**kwargs)[source]

Bases: AbstractCreateChooseOnboaringView

View for choosing if the new device shall be onboarded or not.

page_name = 'devices'[source]
get_context_data(**kwargs)[source]

Adds the cancel url href according to the subcategory.

Parameters:

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

Returns:

The context to use for rendering the devices page.

Return type:

dict[str, Any]

class devices.views.OpcUaGdsCreateChooseOnboardingView(**kwargs)[source]

Bases: AbstractCreateChooseOnboaringView

View for choosing if the new OPC UA GDS shall be onboarded or not.

page_name = 'opc_ua_gds'[source]
get_context_data(**kwargs)[source]

Adds the cancel url href according to the subcategory.

Parameters:

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

Returns:

The context to use for rendering the devices page.

Return type:

dict[str, Any]

class devices.views.OpcUaGdsPushCreateChooseOnboardingView(**kwargs)[source]

Bases: django.views.generic.base.RedirectView

Deprecated: Redirects to standard devices create page.

permanent = True[source]
pattern_name = 'devices:devices_create'[source]
class devices.views.AbstractCreateAddOnboardingTypeView(**kwargs)[source]

Bases: trustpoint.page_context.PageContextMixin, django.views.generic.base.TemplateView

Abstract view for choosing how new device shall be added.

http_method_names = ('get',)[source]
template_name = 'devices/add_onboarding_type.html'[source]
page_category = 'devices'[source]
page_name: str[source]
get_context_data(**kwargs)[source]

Adds the cancel url href according to the subcategory.

Parameters:

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

Returns:

The context to use for rendering the devices page.

Return type:

dict[str, Any]

class devices.views.DeviceCreateAddOnboardingTypeView(**kwargs)[source]

Bases: AbstractCreateAddOnboardingTypeView

View for choosing how new device shall be added.

page_name = 'devices'[source]
class devices.views.AbstractCreateNoOnboardingView[source]

Bases: trustpoint.page_context.PageContextMixin, django.views.generic.edit.FormView[devices.forms.NoOnboardingCreateForm]

asdfds.

http_method_names = ('get', 'post')[source]
form_class[source]
template_name = 'devices/create.html'[source]
page_category = 'devices'[source]
page_name: str[source]
get_context_data(**kwargs)[source]

Adds the cancel url href according to the subcategory.

Parameters:

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

Returns:

The context to use for rendering the devices page.

Return type:

dict[str, Any]

form_valid(form)[source]

Saves the form / creates the device model object.

Parameters:

form (devices.forms.NoOnboardingCreateForm) – The valid form.

Returns:

The HTTP Response to be returned.

Return type:

django.http.HttpResponse

get_success_url()[source]

Gets the success url to redirect to after successful processing of the POST data following a form submit.

Returns:

The success url to redirect to after successful processing of the POST data following a form submit.

Return type:

str

class devices.views.DeviceCreateNoOnboardingView[source]

Bases: AbstractCreateNoOnboardingView

Create form view for the devices section.

page_name = 'devices'[source]
class devices.views.OpcUaGdsCreateNoOnboardingView[source]

Bases: AbstractCreateNoOnboardingView

Create form view for the devices section.

page_name = 'opc_ua_gds'[source]
class devices.views.AbstractCreateOnboardingView[source]

Bases: trustpoint.page_context.PageContextMixin, django.views.generic.edit.FormView[django.forms.Form]

asdfds.

http_method_names = ('get', 'post')[source]
form_class: type[django.forms.Form][source]
template_name = 'devices/create.html'[source]
page_category = 'devices'[source]
page_name: str[source]
get_context_data(**kwargs)[source]

Adds the cancel url href according to the subcategory.

Parameters:

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

Returns:

The context to use for rendering the devices page.

Return type:

dict[str, Any]

form_valid(form)[source]

Saves the form / creates the device model object.

Parameters:

form (django.forms.Form) – The valid form.

Returns:

The HTTP Response to be returned.

Return type:

django.http.HttpResponse

get_success_url()[source]

Gets the success url to redirect to after successful processing of the POST data following a form submit.

Returns:

The success url to redirect to after successful processing of the POST data following a form submit.

Return type:

str

class devices.views.DeviceCreateOnboardingView[source]

Bases: AbstractCreateOnboardingView

Create form view for the devices section.

page_name = 'devices'[source]
class devices.views.DeviceCreateOpcUaGdsPushView[source]

Bases: AbstractCreateOnboardingView

Create form view for OPC UA GDS Push devices in the devices section.

form_class[source]
page_name = 'devices'[source]
dispatch(request, *args, **kwargs)[source]

Check if SOFTWARE storage is configured before allowing GDS Push creation.

Parameters:
  • request (django.http.request.HttpRequest) – The HTTP request object.

  • *args (Any) – Variable length argument list.

  • **kwargs (Any) – Arbitrary keyword arguments.

Returns:

The response object.

Return type:

HttpResponseBase

form_valid(form)[source]

Saves the form / creates the device model object as OPC UA GDS Push type.

Parameters:

form (django.forms.Form) – The valid form.

Returns:

The HTTP Response to be returned.

Return type:

django.http.HttpResponse

class devices.views.OpcUaGdsCreateOnboardingView[source]

Bases: AbstractCreateOnboardingView

Create form view for the devices section.

page_name = 'opc_ua_gds'[source]
class devices.views.OpcUaGdsPushCreateOnboardingView(**kwargs)[source]

Bases: django.views.generic.base.RedirectView

Deprecated: Redirects to standard devices OPC UA GDS Push create page.

permanent = True[source]
pattern_name = 'devices:devices_create_opc_ua_gds_push'[source]
class devices.views.AbstractCertificateLifecycleManagementSummaryView[source]

Bases: trustpoint.page_context.PageContextMixin, django.views.generic.detail.DetailView[devices.models.DeviceModel], abc.ABC

This is the CLM summary view in the devices section.

http_method_names = ('get', 'post')[source]
model[source]
template_name = 'devices/credentials/certificate_lifecycle_management.html'[source]
context_object_name = 'device'[source]
default_sort_param = 'common_name'[source]
issued_creds_qs: django.db.models.QuerySet[pki.models.IssuedCredentialModel][source]
remote_issued_creds_qs: django.db.models.QuerySet[pki.models.RemoteIssuedCredentialModel][source]
domain_credentials_qs: django.db.models.QuerySet[pki.models.IssuedCredentialModel] | django.db.models.QuerySet[pki.models.RemoteIssuedCredentialModel][source]
application_credentials_qs: django.db.models.QuerySet[pki.models.IssuedCredentialModel] | django.db.models.QuerySet[pki.models.RemoteIssuedCredentialModel][source]
page_category = 'devices'[source]
page_name: str[source]
get_issued_creds_qs()[source]

Gets a sorted queryset of all IssuedCredentialModels.

Returns:

Sorted queryset of all IssuedCredentialModels.

Return type:

django.db.models.QuerySet[pki.models.IssuedCredentialModel]

get_remote_issued_creds_qs()[source]

Gets a sorted queryset of all RemoteIssuedCredentialModels for RA-issued certs.

Return type:

django.db.models.QuerySet[pki.models.RemoteIssuedCredentialModel]

get_domain_credentials_qs()[source]

Gets domain credentials — from RemoteIssuedCredentialModel for RA domains, otherwise IssuedCredentialModel.

self.get_issued_creds_qs() or self.get_remote_issued_creds_qs() must be called first!

Returns:

Sorted queryset of domain credentials.

Return type:

django.db.models.QuerySet[pki.models.IssuedCredentialModel] | django.db.models.QuerySet[pki.models.RemoteIssuedCredentialModel]

get_application_credentials_qs()[source]

Gets application credentials — from RemoteIssuedCredentialModel for RA domains.

self.get_issued_creds_qs() or self.get_remote_issued_creds_qs() must be called first!

Returns:

Sorted queryset of application credentials.

Return type:

django.db.models.QuerySet[pki.models.IssuedCredentialModel] | django.db.models.QuerySet[pki.models.RemoteIssuedCredentialModel]

get_context_data(**kwargs)[source]

Adds the paginator and credential details to the context.

Parameters:

kwargs (Any)

Return type:

dict[str, Any]

get_onboarding_initial()[source]

Gets the initial values for onboarding.

Returns:

Initial values for onboarding.

Return type:

dict[str, Any]

get_no_onboarding_initial()[source]

Gets the initial values for no onboarding.

Returns:

Initial values for no onboarding.

Return type:

dict[str, Any]

get_onboarding_form()[source]

Gets the form for onboarding.

Returns:

The onboarding form.

Return type:

django.forms.Form

get_no_onboarding_form()[source]

Gets the form for no onboarding.

Returns:

The no onboarding form.

Return type:

devices.forms.ClmDeviceModelNoOnboardingForm

get_device_form()[source]

Gets the device Form for onboarding or no onboarding.

Returns:

The required form.

Return type:

django.forms.Form

post(request, *_args, **kwargs)[source]

Handles the POST request used for device form submission.

Parameters:
  • request (django.http.request.HttpRequest) – The django request object.

  • _args (Any) – Positional arguments are discarded.

  • kwargs (Any) – Keyword arguments are passed to get_context_data.

Returns:

The HttpResponse.

Return type:

django.http.HttpResponse

class devices.views.DeviceCertificateLifecycleManagementSummaryView[source]

Bases: AbstractCertificateLifecycleManagementSummaryView

Certificate Lifecycle Management Summary View for devices.

page_name = 'devices'[source]
dispatch(request, *args, **kwargs)[source]

Redirect OPC UA GDS Push devices to their specific view if GDS Push is the only protocol.

Parameters:
  • request (django.http.request.HttpRequest)

  • args (Any)

  • kwargs (Any)

Return type:

django.http.HttpResponseBase

class devices.views.OpcUaGdsCertificateLifecycleManagementSummaryView[source]

Bases: AbstractCertificateLifecycleManagementSummaryView

Certificate Lifecycle Management Summary View for OPC UA Devcies.

page_name = 'opc_ua_gds'[source]
class devices.views.OpcUaGdsPushCertificateLifecycleManagementSummaryView[source]

Bases: AbstractCertificateLifecycleManagementSummaryView

Certificate Lifecycle Management Summary View for OPC UA GDS Push devices.

page_name = 'devices'[source]
get_context_data(**kwargs)[source]

Add OPC UA GDS Push specific context.

Parameters:

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

Returns:

The context data for the view.

Return type:

dict[str, Any]

get_onboarding_initial()[source]

Gets the initial values for onboarding for GDS Push.

Returns:

Initial values for onboarding.

Return type:

dict[str, Any]

get_onboarding_form()[source]

Gets the form for GDS Push onboarding.

Returns:

The GDS Push onboarding form.

Return type:

devices.forms.ClmDeviceModelOpcUaGdsPushOnboardingForm

post(request, *_args, **kwargs)[source]

Handles the POST request used for device form submission.

Parameters:
  • request (django.http.request.HttpRequest) – The django request object.

  • _args (Any) – Positional arguments are discarded.

  • kwargs (Any) – Keyword arguments are passed to get_context_data.

Returns:

The HttpResponse.

Return type:

django.http.HttpResponse

class devices.views.AbstractNoOnboardingIssueNewApplicationCredentialView[source]

Bases: trustpoint.page_context.PageContextMixin, django.views.generic.detail.DetailView[devices.models.DeviceModel]

abc.

http_method_names = ('get',)[source]
model[source]
context_object_name = 'device'[source]
template_name = 'devices/credentials/issue_credential.html'[source]
page_category = 'devices'[source]
page_name: str[source]
get_context_data(**kwargs)[source]

Add the sections to the context.

Parameters:

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

Returns:

The context data for the view.

Return type:

dict[str, Any]

get(request, *_args, **_kwargs)[source]

Adds checks if the device is configured for no-onboarding and has a domain set.

Parameters:
  • request (django.http.request.HttpRequest) – The django request object.

  • *_args (Any) – Positional arguments are discarded.

  • **_kwargs (Any) – Keyword arguments are discarded.

Returns:

The HttpResponse Or HttpRedirect to the CLM page.

Return type:

django.http.HttpResponse

class devices.views.DeviceNoOnboardingIssueNewApplicationCredentialView[source]

Bases: AbstractNoOnboardingIssueNewApplicationCredentialView

abc.

page_name = 'devices'[source]
class devices.views.OpcUaGdsNoOnboardingIssueNewApplicationCredentialView[source]

Bases: AbstractNoOnboardingIssueNewApplicationCredentialView

abc.

page_name = 'opc_ua_gds'[source]
class devices.views.AbstractSelectCertificateProfileNewApplicationCredentialView[source]

Bases: trustpoint.page_context.PageContextMixin, django.views.generic.detail.DetailView[devices.models.DeviceModel]

abc.

http_method_names = ('get',)[source]
model[source]
context_object_name = 'device'[source]
template_name = 'devices/credentials/profile_select.html'[source]
page_category = 'devices'[source]
page_name: str[source]
get_context_data(**kwargs)[source]

Add the sections to the context.

Parameters:

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

Returns:

The context data for the view.

Return type:

dict[str, Any]

class devices.views.DeviceSelectCertificateProfileNewApplicationCredentialView[source]

Bases: AbstractSelectCertificateProfileNewApplicationCredentialView

abc.

page_name = 'devices'[source]
class devices.views.OpcUaGdsSelectCertificateProfileNewApplicationCredentialView[source]

Bases: AbstractSelectCertificateProfileNewApplicationCredentialView

abc.

page_name = 'opc_ua_gds'[source]
class devices.views.AbstractOnboardingIssueNewApplicationCredentialView[source]

Bases: trustpoint.page_context.PageContextMixin, django.views.generic.detail.DetailView[devices.models.DeviceModel]

abc.

http_method_names = ('get',)[source]
model[source]
context_object_name = 'device'[source]
template_name = 'devices/credentials/issue_credential.html'[source]
page_category = 'devices'[source]
page_name: str[source]
get_context_data(**kwargs)[source]

Add the sections to the context.

Parameters:

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

Returns:

The context data for the view.

Return type:

dict[str, Any]

class devices.views.DeviceOnboardingIssueNewApplicationCredentialView[source]

Bases: AbstractOnboardingIssueNewApplicationCredentialView

abc.

page_name = 'devices'[source]
class devices.views.OpcUaGdsOnboardingIssueNewApplicationCredentialView[source]

Bases: AbstractOnboardingIssueNewApplicationCredentialView

abc.

page_name = 'opc_ua_gds'[source]
class devices.views.OpcUaGdsPushOnboardingIssueNewApplicationCredentialView[source]

Bases: AbstractOnboardingIssueNewApplicationCredentialView

View for issuing application credentials for OPC UA GDS Push devices - redirects directly to help page.

page_name = 'devices'[source]
get(request, *_args, **_kwargs)[source]

Redirect directly to the GDS Push application certificate help page if GDS Push is the only protocol.

Parameters:
  • request (django.http.request.HttpRequest)

  • _args (Any)

  • _kwargs (Any)

Return type:

django.http.HttpResponse

class devices.views.AbstractIssueCredentialView[source]

Bases: trustpoint.page_context.PageContextMixin, django.views.generic.edit.FormMixin[django.forms.Form], django.views.generic.detail.DetailView[devices.models.DeviceModel]

Base view for all credential issuance views.

http_method_names = ('get', 'post')[source]
model[source]
context_object_name = 'device'[source]
template_name = 'devices/credentials/issue_application_credential.html'[source]
form_class: type[django.forms.Form][source]
issuer_class: type[AbstractIssueCredentialView.IssuerClass][source]
friendly_name: str[source]
page_category = 'devices'[source]
page_name: str[source]
get_context_data(**kwargs)[source]

Add the form to the context.

Parameters:

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

Returns:

The context data for the view.

Return type:

dict[str, Any]

get_form_kwargs()[source]

This method adds the concerning device model to the form kwargs and returns them.

Returns:

The form kwargs including the concerning device model.

Return type:

dict[str, Any]

abstractmethod issue_credential(device, form)[source]

Abstract method to issue a credential.

Parameters:
  • device (devices.models.DeviceModel) – The device to be associated with the new credential.

  • form (django.forms.Form) – The form instance containing the validated data.

Returns:

The IssuedCredentialModel object that was created and saved.

Return type:

pki.models.IssuedCredentialModel

post(request, *_args, **_kwargs)[source]

Adds the object model to the instance and forwards to super().post().

Parameters:
  • request (django.http.request.HttpRequest) – The Django request object is only used implicitly through self.

  • *_args (Any) – Positional arguments are discarded.

  • **_kwargs (Any) – Keyword arguments are discarded.

Returns:

The HttpResponseBase object returned by super().post().

Return type:

django.http.HttpResponse

class devices.views.AbstractIssueDomainCredentialView[source]

Bases: AbstractIssueCredentialView[devices.forms.IssueDomainCredentialForm, devices.issuer.LocalDomainCredentialIssuer]

Base view for issuing domain credentials.

form_class: type[devices.forms.BaseCredentialForm][source]
template_name = 'devices/credentials/issue_domain_credential.html'[source]
issuer_class[source]
friendly_name = 'Domain Credential'[source]
issue_credential(device, _form)[source]

Issue a domain credential for the device.

Parameters:
  • device (devices.models.DeviceModel) – The device to issue the credential for.

  • _form (django.forms.Form) – The form instance containing the validated data.

Returns:

The issued credential model.

Return type:

pki.models.IssuedCredentialModel

class devices.views.DeviceIssueDomainCredentialView[source]

Bases: AbstractIssueDomainCredentialView

View for issuing domain credentials for devices.

page_name = 'devices'[source]
class devices.views.OpcUaGdsIssueDomainCredentialView[source]

Bases: AbstractIssueDomainCredentialView

View for issuing domain credentials for OPC-UA GDS devices.

page_name = 'opc_ua_gds'[source]
class devices.views.OpcUaGdsPushIssueDomainCredentialView[source]

Bases: AbstractIssueDomainCredentialView

View for issuing domain credentials for OPC-UA GDS Push devices.

form_class[source]
page_name = 'devices'[source]
issue_credential(device, form)[source]

Issues a domain credential for the device with OPC UA specific extensions.

Parameters:
  • device (devices.models.DeviceModel) – The device to be associated with the new credential.

  • form (django.forms.Form) – The form instance containing the validated data.

Returns:

The IssuedCredentialModel object that was created and saved.

Return type:

pki.models.IssuedCredentialModel

post(request, *_args, **_kwargs)[source]

Handle the POST request with custom redirect to truststore association.

Parameters:
  • request (django.http.request.HttpRequest)

  • _args (Any)

  • _kwargs (Any)

Return type:

django.http.HttpResponse

class devices.views.OpcUaGdsPushDiscoverServerView[source]

Bases: trustpoint.page_context.PageContextMixin, django.views.generic.detail.DetailView[devices.models.DeviceModel]

View to discover OPC UA server information without authentication.

http_method_names = ('post',)[source]
model[source]
context_object_name = 'device'[source]
page_name = 'devices'[source]
post(request, *_args, **_kwargs)[source]

Handle the POST request to discover server information.

Parameters:
  • request (django.http.request.HttpRequest)

  • _args (Any)

  • _kwargs (Any)

Return type:

django.http.HttpResponse

class devices.views.OpcUaGdsPushTruststoreAssociationView[source]

Bases: trustpoint.logger.LoggerMixin, trustpoint.page_context.PageContextMixin, django.views.generic.edit.FormView[devices.forms.OpcUaGdsPushTruststoreAssociationForm]

View for associating a truststore with an OPC UA GDS Push device’s onboarding configuration.

form_class[source]
template_name = 'devices/truststore_association.html'[source]
page_name = 'devices'[source]
get_form_kwargs()[source]

Add the device instance to the form kwargs.

Return type:

dict[str, Any]

get_device()[source]

Get the device from the URL parameters.

Return type:

devices.models.DeviceModel

get_context_data(**kwargs)[source]

Add the device and import form to the context.

Parameters:

kwargs (Any)

Return type:

dict[str, Any]

post(request, *args, **kwargs)[source]

Handle both association and import form submissions.

Parameters:
  • request (django.http.request.HttpRequest)

  • args (Any)

  • kwargs (Any)

Return type:

django.http.HttpResponse

form_valid(form)[source]

Handle successful form submission.

Parameters:

form (devices.forms.OpcUaGdsPushTruststoreAssociationForm)

Return type:

django.http.HttpResponseRedirect

class devices.views.AbstractIssueProfileCredentialView[source]

Bases: AbstractIssueCredentialView[pki.forms.cert_profiles.CertificateIssuanceForm, devices.issuer.BaseTlsCredentialIssuer]

View to issue a new certificate profile credential.

issuer_class[source]
friendly_name = 'Certificate Profile Credential'[source]
page_name: str[source]
template_name = 'pki/cert_profiles/issuance.html'[source]
form_class[source]
dispatch(request, *args, **kwargs)[source]

Dispatch the request, ensuring the profile exists.

Parameters:
  • request (django.http.request.HttpRequest)

  • args (Any)

  • kwargs (Any)

Return type:

django.http.HttpResponse

get_form_kwargs()[source]

Get form kwargs, including the profile.

Return type:

dict[str, Any]

get_context_data(**kwargs)[source]

Add additional context data.

Parameters:

kwargs (Any)

Return type:

dict[str, Any]

form_invalid(form)[source]

Handle the case where the form is invalid.

Parameters:

form (django.forms.Form)

Return type:

django.http.HttpResponse

form_valid(form)[source]

Handle the case where the form is valid.

Parameters:

form (django.forms.Form)

Return type:

django.http.HttpResponse

issue_credential(device, form)[source]

Issues a credential based on the selected certificate profile.

Parameters:
  • device (devices.models.DeviceModel) – The device to be associated with the new credential.

  • form (django.forms.Form) – The form instance containing the validated data.

Returns:

The IssuedCredentialModel object that was created and saved.

Return type:

pki.models.IssuedCredentialModel

class devices.views.DeviceIssueProfileCredentialView[source]

Bases: AbstractIssueProfileCredentialView

Issue a new certificate profile credential within the devices section.

page_name = 'devices'[source]
class devices.views.OpcUaGdsIssueProfileCredentialView[source]

Bases: AbstractIssueProfileCredentialView

Issue a new certificate profile credential within the devices section.

page_name = 'opc_ua_gds'[source]
class devices.views.DownloadTokenRequiredAuthenticationMixin[source]

Mixin which checks the token included in the URL for browser download views.

credential_download: devices.models.RemoteDeviceCredentialDownloadModel[source]
dispatch(request, *args, **kwargs)[source]

Checks the validity of the token included in the URL for browser download views and redirects if invalid.

Parameters:
  • request (django.http.request.HttpRequest) – The django request object.

  • *args (Any) – Positional arguments passed to super().dispatch().

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

Returns:

A Django HttpResponseBase object.

Return type:

django.http.HttpResponseBase

class devices.views.AbstractDownloadPageDispatcherView(**kwargs)[source]

Bases: trustpoint.page_context.PageContextMixin, django.views.generic.base.RedirectView

Redirects depending on the type of credential, that is if a private key is available or not.

http_method_names = ('get',)[source]
model: type[pki.models.IssuedCredentialModel][source]
permanent = False[source]
page_category = 'devices'[source]
page_name: str[source]
get_redirect_url(*_args, **kwargs)[source]

Gets the redirection URL depending on the type credential, that is if a private key is available or not.

Parameters:
  • *_args (Any) – Positional arguments are discarded.

  • **kwargs (Any) – The pk parameter is retrieved and expected to be there.

Returns:

The redirect URL.

Return type:

str

class devices.views.DeviceDownloadPageDispatcherView(**kwargs)[source]

Bases: AbstractDownloadPageDispatcherView

Download dispatcher view for the device pages.

page_name = 'devices'[source]
class devices.views.OpcUaGdsDownloadPageDispatcherView(**kwargs)[source]

Bases: AbstractDownloadPageDispatcherView

Download dispatcher view for the OPC UA GDS pages.

page_name = 'opc_ua_gds'[source]
class devices.views.OpcUaGdsPushDownloadPageDispatcherView(**kwargs)[source]

Bases: AbstractDownloadPageDispatcherView

Download dispatcher view for the OPC UA GDS Push pages.

page_name = 'devices'[source]
class devices.views.AbstractCertificateDownloadView[source]

Bases: trustpoint.page_context.PageContextMixin, django.views.generic.detail.DetailView[pki.models.IssuedCredentialModel]

View for downloading certificates.

http_method_names = ('get',)[source]
model: type[pki.models.IssuedCredentialModel][source]
template_name = 'devices/credentials/certificate_download.html'[source]
context_object_name = 'issued_credential'[source]
page_category = 'devices'[source]
page_name: str[source]
get_context_data(**kwargs)[source]

Add the clm_url to the context.

Parameters:

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

Returns:

The context data for the view.

Return type:

dict[str, Any]

class devices.views.DeviceCertificateDownloadView[source]

Bases: AbstractCertificateDownloadView

Certificate download view for the device pages.

page_name = 'devices'[source]
class devices.views.OpcUaGdsCertificateDownloadView[source]

Bases: AbstractCertificateDownloadView

Certificate download view for the OPC UA GDS pages.

page_name = 'opc_ua_gds'[source]
class devices.views.OpcUaGdsPushCertificateDownloadView[source]

Bases: AbstractCertificateDownloadView

Certificate download view for the OPC UA GDS Push pages.

page_name = 'devices'[source]
class devices.views.OpcUaGdsPushUpdateTrustlistView[source]

Bases: trustpoint.page_context.PageContextMixin, django.views.generic.detail.DetailView[devices.models.DeviceModel]

View to update the trustlist on an OPC UA GDS Push device.

http_method_names = ('post',)[source]
model[source]
page_name = 'devices'[source]
page_category = 'devices'[source]
post(request, *_args, **_kwargs)[source]

Handle the POST request to update the trustlist.

Parameters:
  • request (django.http.request.HttpRequest) – The Django request object.

  • _args (Any) – Positional arguments are discarded.

  • kwargs – Keyword arguments are passed to get_object().

  • _kwargs (Any)

Returns:

HttpResponse redirecting back to the help page.

Return type:

django.http.HttpResponse

class devices.views.OpcUaGdsPushUpdateServerCertificateView[source]

Bases: trustpoint.page_context.PageContextMixin, django.views.generic.detail.DetailView[devices.models.DeviceModel]

View to update the server certificate on an OPC UA GDS Push device.

http_method_names = ('post',)[source]
model[source]
page_name = 'devices'[source]
page_category = 'devices'[source]
post(request, *_args, **_kwargs)[source]

Handle the POST request to update the server certificate.

Parameters:
  • request (django.http.request.HttpRequest) – The Django request object.

  • _args (Any) – Positional arguments are discarded.

  • kwargs – Keyword arguments are passed to get_object().

  • _kwargs (Any)

Returns:

HttpResponse redirecting back to the help page.

Return type:

django.http.HttpResponse

class devices.views.OpcUaGdsPushCertRenewalSettingsView[source]

Bases: trustpoint.page_context.PageContextMixin, django.views.generic.detail.DetailView[devices.models.DeviceModel]

View to save the periodic server certificate and trustlist renewal settings for an OPC UA GDS Push device.

http_method_names = ('post',)[source]
model[source]
page_name = 'devices'[source]
page_category = 'devices'[source]
post(request, *_args, **_kwargs)[source]

Handle the POST request to update the renewal settings.

Parameters:
  • request (django.http.request.HttpRequest) – The Django request object.

  • _args (Any) – Positional arguments are discarded.

  • _kwargs (Any) – Keyword arguments are discarded.

Returns:

HttpResponse redirecting back to the help page.

Return type:

django.http.HttpResponse

class devices.views.TrustBundleDownloadView[source]

Bases: trustpoint.page_context.PageContextMixin, django.views.generic.detail.DetailView[pki.models.ca.CaModel]

View to download the trust bundle (CA certificates and CRLs) for a given Issuing CA.

http_method_names = ('get',)[source]
model[source]
get(request, *args, **kwargs)[source]

Handle the GET request to download the trust bundle.

Parameters:
  • request (django.http.request.HttpRequest) – The Django request object.

  • *args (Any) – Additional positional arguments.

  • **kwargs (Any) – Additional keyword arguments.

Returns:

FileResponse with the trust bundle zip file.

Return type:

django.http.HttpResponse

class devices.views.AbstractDeviceBaseCredentialDownloadView[source]

Bases: trustpoint.page_context.PageContextMixin, django.views.generic.detail.DetailView[pki.models.IssuedCredentialModel]

View to download a password protected application credential in the desired format.

Inherited by the domain and application credential download views. It is not intended for direct use.

http_method_names = ('get', 'post')[source]
model[source]
template_name = 'devices/credentials/credential_download.html'[source]
context_object_name = 'credential'[source]
form_class[source]
is_browser_download = False[source]
page_category = 'devices'[source]
page_name: str[source]
get_context_data(**kwargs)[source]

Adds information about the credential to the context.

Parameters:

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

Returns:

The context data for the view.

Return type:

dict[str, Any]

post(_request, *_args, **_kwargs)[source]

Processing the valid form data.

This will use the contained form data to start the download process of the desired file.

Parameters:
  • _request (django.http.request.HttpRequest) – The django request object.

  • *_args (Any) – Positional arguments are discarded.

  • **_kwargs (Any) – Keyword arguments are discarded.

Returns:

If successful, this will start the file download. Otherwise, a Http404 will be raised and displayed.

Return type:

django.http.HttpResponse

class devices.views.DeviceManualCredentialDownloadView[source]

Bases: AbstractDeviceBaseCredentialDownloadView

View to download a password protected domain or application credential in the desired format.

page_name = 'devices'[source]
class devices.views.DeviceBrowserCredentialDownloadView[source]

Bases: DownloadTokenRequiredAuthenticationMixin, AbstractDeviceBaseCredentialDownloadView

View to download a password protected domain or app credential in the desired format from a remote client.

is_browser_download = True[source]
class devices.views.AbstractBrowserOnboardingOTPView[source]

Bases: trustpoint.page_context.PageContextMixin, django.views.generic.detail.DetailView[pki.models.IssuedCredentialModel]

View to display the OTP for remote credential download (aka. browser onboarding).

http_method_names = ('get',)[source]
model[source]
template_name = 'devices/credentials/onboarding/browser/otp_view.html'[source]
redirection_view = 'devices:devices'[source]
context_object_name = 'credential'[source]
page_category = 'devices'[source]
page_name: str[source]
get_context_data(**kwargs)[source]

Adds information about the credential and otp for the browser download process.

Parameters:

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

Returns:

The context to render the page.

Return type:

dict[str, Any]

class devices.views.DeviceBrowserOnboardingOTPView[source]

Bases: AbstractBrowserOnboardingOTPView

The browser onboarding OTP view for the devices section.

page_name = 'devices'[source]
class devices.views.OpcUaGdsBrowserOnboardingOTPView[source]

Bases: AbstractBrowserOnboardingOTPView

The browser onboarding OTP view for the OPC UA GDS section.

page_name = 'opc_ua_gds'[source]
class devices.views.AbstractBrowserOnboardingCancelView[source]

Bases: trustpoint.page_context.PageContextMixin, django.views.generic.detail.DetailView[pki.models.IssuedCredentialModel]

View to cancel the browser onboarding process and delete the associated RemoteDeviceCredentialDownloadModel.

http_method_names = ('get',)[source]
model[source]
context_object_name = 'credential'[source]
permanent = False[source]
page_category = 'devices'[source]
page_name: str[source]
get(request, *_args, **_kwargs)[source]

Cancels the browser onboarding process and deletes the associated RemoteDeviceCredentialDownloadModel.

Parameters:
  • request (django.http.request.HttpRequest) – The Django request object.

  • *_args (Any) – Positional arguments are discarded.

  • **_kwargs (Any) – Keyword arguments are discarded.

Returns:

The HttpResponseBase object with the desired redirection URL.

Return type:

django.http.HttpResponse

class devices.views.DeviceBrowserOnboardingCancelView[source]

Bases: AbstractBrowserOnboardingCancelView

Cancels the browser onboarding for the devices section.

page_name = 'devices'[source]
class devices.views.OpcUaGdsBrowserOnboardingCancelView[source]

Bases: AbstractBrowserOnboardingCancelView

Cancels the browser onboarding for the OPC UA GDS section.

page_name = 'opc_ua_gds'[source]
class devices.views.DeviceOnboardingBrowserLoginView[source]

Bases: django.views.generic.edit.FormView[devices.forms.BrowserLoginForm]

View to handle certificate download requests.

http_method_names = ('get', 'post')[source]
template_name = 'devices/credentials/onboarding/browser/login.html'[source]
form_class[source]
cleaned_data: dict[str, Any][source]
get_success_url()[source]

Gets the success url to redirect to after successful processing of the POST data following a form submit.

Returns:

The success url to redirect to after successful processing of the POST data following a form submit.

Return type:

str

form_invalid(form)[source]

Adds an error message in the case of an invalid OTP.

Parameters:

form (devices.forms.BrowserLoginForm) – The corresponding form object.

Returns:

The Django HttpResponse object.

Return type:

django.http.HttpResponse

form_valid(form)[source]

Performed if the form was validated successfully and adds the cleaned data to the instance.

Parameters:

form (devices.forms.BrowserLoginForm) – The corresponding form object.

Returns:

The Django HttpResponse object.

Return type:

django.http.HttpResponse

class devices.views.AbstractIssuedCredentialRevocationView[source]

Bases: trustpoint.page_context.PageContextMixin, django.views.generic.detail.DetailView[pki.models.IssuedCredentialModel]

Revokes a specific issued credential.

http_method_names = ('get', 'post')[source]
model[source]
template_name = 'devices/confirm_revoke.html'[source]
context_object_name = 'issued_credential'[source]
pk_url_kwarg = 'pk'[source]
form_class[source]
page_category = 'devices'[source]
page_name: str[source]
get_context_data(**kwargs)[source]

Adds the primary keys to the context.

Parameters:

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

Returns:

The context data.

Return type:

dict[str, Any]

post(_request, *_args, **_kwargs)[source]

Will try to revoke the requested issued credential.

Parameters:
  • request – The Django request object.

  • *_args (Any) – Positional arguments are discarded.

  • **_kwargs (Any) – Keyword arguments are discarded.

  • _request (django.http.request.HttpRequest)

  • *_args

  • **_kwargs

Returns:

Redirect to the devices summary.

Return type:

django.http.HttpResponse

class devices.views.DeviceIssuedCredentialRevocationView[source]

Bases: AbstractIssuedCredentialRevocationView

abc.

page_name = 'devices'[source]
class devices.views.OpcUaGdsIssuedCredentialRevocationView[source]

Bases: AbstractIssuedCredentialRevocationView

abc.

page_name = 'opc_ua_gds'[source]
class devices.views.OpcUaGdsPushIssuedCredentialRevocationView[source]

Bases: AbstractIssuedCredentialRevocationView

abc.

page_name = 'devices'[source]
class devices.views.AbstractBulkRevokeView[source]

Bases: trustpoint.logger.LoggerMixin, trustpoint.page_context.PageContextMixin, django.views.generic.list.ListView[devices.models.DeviceModel]

View to confirm the deletion of multiple Devices.

model[source]
template_name = 'devices/confirm_bulk_revoke.html'[source]
context_object_name = 'devices'[source]
missing: str = ''[source]
pks: str = ''[source]
queryset: django.db.models.QuerySet[devices.models.DeviceModel][source]
form_class[source]
page_category = 'devices'[source]
page_name: str[source]
get_context_data(**kwargs)[source]

Adds the primary keys to the context.

Parameters:

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

Returns:

The context data.

Return type:

dict[str, Any]

get_queryset()[source]

Gets the queryset of DeviceModel objects that are requested to be revoked.

Returns:

The queryset of DeviceModel objects that are requested to be revoked.

Return type:

django.db.models.QuerySet[devices.models.DeviceModel]

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

HTTP GET processing.

Parameters:
  • request (django.http.request.HttpRequest) – The Django request object.

  • *args (Any) – Positional arguments passed to super().get().

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

Returns:

The device deletion view or a redirect to the devices view if one or more pks were not found.

Return type:

django.http.HttpResponse

post(request, *_args, **_kwargs)[source]

Will try to revoke all certificate assiciated with the requested DeviceModel records.

Parameters:
  • request (django.http.request.HttpRequest) – The Django request object.

  • *_args (Any) – Positional arguments are discarded.

  • **_kwargs (Any) – Keyword arguments are discarded.

Returns:

Redirect to the devices summary.

Return type:

django.http.HttpResponse

class devices.views.DeviceBulkRevokeView[source]

Bases: AbstractBulkRevokeView

abc.

page_name = 'devices'[source]
class devices.views.OpcUaGdsBulkRevokeView[source]

Bases: AbstractBulkRevokeView

abc.

page_name = 'devices'[source]
class devices.views.OpcUaGdsPushBulkRevokeView[source]

Bases: AbstractBulkRevokeView

abc.

page_name = 'devices'[source]
class devices.views.AbstractBulkDeleteView[source]

Bases: trustpoint.logger.LoggerMixin, trustpoint.page_context.PageContextMixin, django.views.generic.list.ListView[devices.models.DeviceModel]

View to confirm the deletion of multiple Devices.

model[source]
template_name = 'devices/confirm_delete.html'[source]
context_object_name = 'devices'[source]
missing: str = ''[source]
pks: str = ''[source]
queryset: django.db.models.QuerySet[devices.models.DeviceModel][source]
form_class[source]
page_category = 'devices'[source]
page_name: str[source]
get_context_data(**kwargs)[source]

Adds the primary keys to the context.

Parameters:

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

Returns:

The context data.

Return type:

dict[str, Any]

get_queryset()[source]

Gets the queryset of DeviceModel objects that are requested to be deleted.

Returns:

The queryset of DeviceModel objects that are requested to be deleted.

Return type:

django.db.models.QuerySet[devices.models.DeviceModel]

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

HTTP GET processing.

Parameters:
  • request (django.http.request.HttpRequest) – The Django request object.

  • *args (Any) – Positional arguments passed to super().get().

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

Returns:

The device deletion view or a redirect to the devices view if one or more pks were not found.

Return type:

django.http.HttpResponse

post(request, *_args, **_kwargs)[source]

HTTP POST processing which will try to delete all requested DeviceModel records.

Parameters:
  • request (django.http.request.HttpRequest) – The Django request object.

  • *_args (Any) – Positional arguments are discarded.

  • **_kwargs (Any) – Keyword arguments are discarded.

Returns:

Redirect to the devices summary.

Return type:

django.http.HttpResponse

class devices.views.DeviceBulkDeleteView[source]

Bases: AbstractBulkDeleteView

abc.

page_name = 'devices'[source]
class devices.views.OpcUaGdsBulkDeleteView[source]

Bases: AbstractBulkDeleteView

abc.

page_name = 'opc_ua_gds'[source]
class devices.views.OpcUaGdsPushBulkDeleteView[source]

Bases: AbstractBulkDeleteView

abc.

page_name = 'devices'[source]
class devices.views.DeviceViewSet(**kwargs)[source]

Bases: rest_framework.viewsets.ModelViewSet[devices.models.DeviceModel]

ViewSet for managing Device instances.

Supports standard CRUD operations such as list, retrieve, create, update, and delete.

queryset[source]
serializer_class[source]
action_descriptions: ClassVar[dict[str, str]][source]
get_view_description(html=False)[source]

Return a description for the given action.

Parameters:

html (bool)

Return type:

str