devices.viewsΒΆ

This module contains all views concerning the devices application.

AttributesΒΆ

ClassesΒΆ

AbstractDeviceTableView

Device Table View.

DeviceTableView

Device Table View.

OpcUaGdsTableView

Table View for devices where opc_ua_gds is True.

AbstractCreateChooseOnboaringView

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

DeviceCreateChooseOnboardingView

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

OpcUaGdsCreateChooseOnboardingView

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

AbstractCreateNoOnboardingView

asdfds.

DeviceCreateNoOnboardingView

Create form view for the devices section.

OpcUaGdsCreateNoOnboardingView

Create form view for the devices section.

AbstractCreateOnboardingView

asdfds.

DeviceCreateOnboardingView

Create form view for the devices section.

OpcUaGdsCreateOnboardingView

Create form view for the devices section.

AbstractCertificateLifecycleManagementSummaryView

This is the CLM summary view in the devices section.

DeviceCertificateLifecycleManagementSummaryView

Certificate Lifecycle Management Summary View for devices.

OpcUaGdsCertificateLifecycleManagementSummaryView

Certificate Lifecycle Management Summary View for OPC UA Devcies.

AbstractNoOnboardingIssueNewApplicationCredentialView

abc.

DeviceNoOnboardingIssueNewApplicationCredentialView

abc.

OpcUaGdsNoOnboardingIssueNewApplicationCredentialView

abc.

AbstractSelectCertificateProfileNewApplicationCredentialView

abc.

DeviceSelectCertificateProfileNewApplicationCredentialView

abc.

OpcUaGdsSelectCertificateProfileNewApplicationCredentialView

abc.

AbstractOnboardingIssueNewApplicationCredentialView

abc.

DeviceOnboardingIssueNewApplicationCredentialView

abc.

OpcUaGdsOnboardingIssueNewApplicationCredentialView

abc.

AbstractIssueCredentialView

Base view for all credential issuance views.

AbstractIssueDomainCredentialView

Base view for issuing domain credentials.

DeviceIssueDomainCredentialView

View for issuing domain credentials for devices.

OpcUaGdsIssueDomainCredentialView

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

AbstractIssueTlsClientCredentialView

View to issue a new TLS client credential.

DeviceIssueTlsClientCredentialView

Issue a new TLS client credential within the devices section.

OpcUaGdsIssueTlsClientCredentialView

Issue a new TLS client credential within the devices section.

AbstractIssueTlsServerCredentialView

View to issue a new TLS server credential.

DeviceIssueTlsServerCredentialView

Issues a TLS server credenital within the devices section.

OpcUaGdsIssueTlsServerCredentialView

Issues a TLS server credenital within the devices section.

AbstractIssueOpcUaClientCredentialView

View to issue a new OPC UA client credential.

DeviceIssueOpcUaClientCredentialView

Issues an OPC UA client credential within the devices section.

OpcUaGdsIssueOpcUaClientCredentialView

Issues an OPC UA client credential within the devices section.

AbstractIssueOpcUaServerCredentialView

View to issue a new OPC UA server credential.

DeviceIssueOpcUaServerCredentialView

Issues an OPC UA server credential within the devices section.

OpcUaGdsIssueOpcUaServerCredentialView

Issues an OPC UA server credential within the devices section.

DownloadTokenRequiredAuthenticationMixin

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

AbstractDownloadPageDispatcherView

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

DeviceDownloadPageDispatcherView

Download dispatcher view for the device pages.

OpcUaGdsDownloadPageDispatcherView

Download dispatcher view for the OPC UA GDS pages.

AbstractCertificateDownloadView

View for downloading certificates.

DeviceCertificateDownloadView

Certificate download view for the device pages.

OpcUaGdsCertificateDownloadView

Certificate download view for the OPC UA GDS pages.

AbstractDeviceBaseCredentialDownloadView

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

DeviceManualCredentialDownloadView

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

DeviceBrowserCredentialDownloadView

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

AbstractBrowserOnboardingOTPView

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

DeviceBrowserOnboardingOTPView

The browser onboarding OTP view for the devices section.

OpcUaGdsBrowserOnboardingOTPView

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

AbstractBrowserOnboardingCancelView

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

DeviceBrowserOnboardingCancelView

Cancels the browser onboarding for the devices section.

OpcUaGdsBrowserOnboardingCancelView

Cancels the browser onboarding for the OPC UA GDS section.

DeviceOnboardingBrowserLoginView

View to handle certificate download requests.

AbstractIssuedCredentialRevocationView

Revokes a specific issued credential.

DeviceIssuedCredentialRevocationView

abc.

OpcUaGdsIssuedCredentialRevocationView

abc.

AbstractBulkRevokeView

View to confirm the deletion of multiple Devices.

DeviceBulkRevokeView

abc.

OpcUaGdsBulkRevokeView

abc.

AbstractBulkDeleteView

View to confirm the deletion of multiple Devices.

DeviceBulkDeleteView

abc.

OpcUaGdsBulkDeleteView

abc.

Module ContentsΒΆ

devices.views.DeviceWithoutDomainErrorMsg[source]ΒΆ
devices.views.NamedCurveMissingForEccErrorMsg[source]ΒΆ
devices.views.ActiveTrustpointTlsServerCredentialModelMissingErrorMsg[source]ΒΆ
devices.views.PublicKeyInfoMissingErrorMsg[source]ΒΆ
devices.views.ALLOWED_APP_CRED_PROFILES[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

_get_clm_button_html(record)[source]ΒΆ

Gets the HTML for the CLM button in the devices table.

Parameters:

record (devices.models.DeviceModel) – The corresponding DeviceModel.

Returns:

The HTML of the hyperlink for the CLM button.

Return type:

django.utils.safestring.SafeString

_get_pki_protocols(record)[source]ΒΆ
Parameters:

record (devices.models.DeviceModel)

Return type:

str

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 only include devices which are of generic type and filtered by filtered by UI filters.

Returns:

Returns a queryset of all DeviceModels, 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]ΒΆ
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]ΒΆ
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[devices.forms.OnboardingCreateForm]

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.OnboardingCreateForm) – 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.OpcUaGdsCreateOnboardingView[source]ΒΆ

Bases: AbstractCreateOnboardingView

Create form view for the devices section.

page_name = 'opc_ua_gds'[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[devices.models.IssuedCredentialModel][source]ΒΆ
domain_credentials_qs: django.db.models.QuerySet[devices.models.IssuedCredentialModel][source]ΒΆ
application_credentials_qs: django.db.models.QuerySet[devices.models.IssuedCredentialModel][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[devices.models.IssuedCredentialModel]

get_domain_credentials_qs()[source]ΒΆ

Gets a sorted queryset of all IssuedCredentialModels that are domain credentials.

self.get_issued_creds_qs() must be called first!

Returns:

Sorted queryset of all IssuedCredentialModels that are domain credentials

Return type:

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

get_application_credentials_qs()[source]ΒΆ

Gets a sorted queryset of all IssuedCredentialModels that are application credentials.

self.get_issued_creds_qs() must be called first!

Returns:

Sorted queryset of all IssuedCredentialModels that are application credentials.

Return type:

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

get_context_data(**kwargs)[source]ΒΆ

Adds the paginator and credential details to the context.

Parameters:

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

Returns:

The context to use for rendering the clm summary page.

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:

devices.forms.ClmDeviceModelOnboardingForm

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:

devices.forms.ClmDeviceModelOnboardingForm | devices.forms.ClmDeviceModelNoOnboardingForm

static _get_expires_in(record)[source]ΒΆ

Gets the remaining time until the credential expires as human-readable string.

Parameters:

record (devices.models.IssuedCredentialModel) – The corresponding IssuedCredentialModel.

Returns:

The remaining time until the credential expires as human-readable string.

Return type:

str

_get_revoke_button_html(record)[source]ΒΆ

Gets the HTML for the revoke button in the devices table.

Parameters:

record (devices.models.IssuedCredentialModel) – The corresponding DeviceModel.

Returns:

The HTML of the hyperlink for the revoke button.

Return type:

str

_get_pki_protocols(record)[source]ΒΆ
Parameters:

record (devices.models.DeviceModel)

Return type:

str

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]ΒΆ
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.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_redirect_url()[source]ΒΆ
Return type:

django.http.HttpResponseRedirect

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.AbstractIssueCredentialView[source]ΒΆ

Bases: trustpoint.page_context.PageContextMixin, 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[AbstractIssueCredentialView.FormClass][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 ads 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, cleaned_data)[source]ΒΆ

Abstract method to issue a credential.

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

  • cleaned_data (dict[str, Any]) – The validated form data.

Returns:

The IssuedCredentialModel object that was created and saved.

Return type:

devices.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[source]ΒΆ
template_name = 'devices/credentials/issue_domain_credential.html'[source]ΒΆ
issuer_class[source]ΒΆ
friendly_name = 'Domain Credential'[source]ΒΆ
issue_credential(device, _cleaned_data)[source]ΒΆ

Issue a domain credential for the device.

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

  • _cleaned_data (dict[str, Any]) – The validated form data is discarded.

Returns:

The issued credential model.

Return type:

devices.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.AbstractIssueTlsClientCredentialView[source]ΒΆ

Bases: AbstractIssueCredentialView[devices.forms.IssueTlsClientCredentialForm, devices.issuer.LocalTlsClientCredentialIssuer]

View to issue a new TLS client credential.

form_class[source]ΒΆ
issuer_class[source]ΒΆ
friendly_name = 'TLS client credential'[source]ΒΆ
page_name: str[source]ΒΆ
issue_credential(device, cleaned_data)[source]ΒΆ

Issues an TLS client credential.

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

  • cleaned_data (dict[str, Any]) – The validated form data.

Returns:

The IssuedCredentialModel object that was created and saved.

Return type:

devices.models.IssuedCredentialModel

class devices.views.DeviceIssueTlsClientCredentialView[source]ΒΆ

Bases: AbstractIssueTlsClientCredentialView

Issue a new TLS client credential within the devices section.

page_name = 'devices'[source]ΒΆ
class devices.views.OpcUaGdsIssueTlsClientCredentialView[source]ΒΆ

Bases: AbstractIssueTlsClientCredentialView

Issue a new TLS client credential within the devices section.

page_name = 'opc_ua_gds'[source]ΒΆ
class devices.views.AbstractIssueTlsServerCredentialView[source]ΒΆ

Bases: AbstractIssueCredentialView[devices.forms.IssueTlsServerCredentialForm, devices.issuer.LocalTlsServerCredentialIssuer]

View to issue a new TLS server credential.

form_class[source]ΒΆ
issuer_class[source]ΒΆ
friendly_name = 'TLS server credential'[source]ΒΆ
issue_credential(device, cleaned_data)[source]ΒΆ

Issues an TLS server credential.

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

  • cleaned_data (dict[str, Any]) – The validated form data.

Returns:

The IssuedCredentialModel object that was created and saved.

Return type:

devices.models.IssuedCredentialModel

class devices.views.DeviceIssueTlsServerCredentialView[source]ΒΆ

Bases: AbstractIssueTlsServerCredentialView

Issues a TLS server credenital within the devices section.

page_name = 'devices'[source]ΒΆ
class devices.views.OpcUaGdsIssueTlsServerCredentialView[source]ΒΆ

Bases: AbstractIssueTlsServerCredentialView

Issues a TLS server credenital within the devices section.

page_name = 'opc_ua_gds'[source]ΒΆ
class devices.views.AbstractIssueOpcUaClientCredentialView[source]ΒΆ

Bases: AbstractIssueCredentialView[devices.forms.IssueOpcUaClientCredentialForm, devices.issuer.OpcUaClientCredentialIssuer]

View to issue a new OPC UA client credential.

form_class[source]ΒΆ
issuer_class[source]ΒΆ
friendly_name = 'OPC UA client credential'[source]ΒΆ
issue_credential(device, cleaned_data)[source]ΒΆ

Issues an OPC UA client credential.

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

  • cleaned_data (dict[str, Any]) – The validated form data.

Returns:

The IssuedCredentialModel object that was created and saved.

Return type:

devices.models.IssuedCredentialModel

class devices.views.DeviceIssueOpcUaClientCredentialView[source]ΒΆ

Bases: AbstractIssueOpcUaClientCredentialView

Issues an OPC UA client credential within the devices section.

page_name = 'devices'[source]ΒΆ
class devices.views.OpcUaGdsIssueOpcUaClientCredentialView[source]ΒΆ

Bases: AbstractIssueOpcUaClientCredentialView

Issues an OPC UA client credential within the devices section.

page_name = 'opc_ua_gds'[source]ΒΆ
class devices.views.AbstractIssueOpcUaServerCredentialView[source]ΒΆ

Bases: AbstractIssueCredentialView[devices.forms.IssueOpcUaServerCredentialForm, devices.issuer.OpcUaServerCredentialIssuer]

View to issue a new OPC UA server credential.

form_class[source]ΒΆ
issuer_class[source]ΒΆ
friendly_name = 'OPC UA server credential'[source]ΒΆ
issue_credential(device, cleaned_data)[source]ΒΆ

Issues an OPC UA server credential.

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

  • cleaned_data (dict[str, Any]) – The validated form data.

Returns:

The IssuedCredentialModel object that was created and saved.

Return type:

devices.models.IssuedCredentialModel

class devices.views.DeviceIssueOpcUaServerCredentialView[source]ΒΆ

Bases: AbstractIssueOpcUaServerCredentialView

Issues an OPC UA server credential within the devices section.

page_name = 'devices'[source]ΒΆ
class devices.views.OpcUaGdsIssueOpcUaServerCredentialView[source]ΒΆ

Bases: AbstractIssueOpcUaServerCredentialView

Issues an OPC UA server 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[devices.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.AbstractCertificateDownloadView[source]ΒΆ

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

View for downloading certificates.

http_method_names = ('get',)[source]ΒΆ
model: type[devices.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.AbstractDeviceBaseCredentialDownloadView[source]ΒΆ

Bases: trustpoint.page_context.PageContextMixin, django.views.generic.detail.DetailView[devices.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[devices.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[devices.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[devices.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.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]

_set_queryset(request)[source]ΒΆ
Parameters:

request (django.http.request.HttpRequest)

Return type:

str | None

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.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]

_set_queryset(request)[source]ΒΆ
Parameters:

request (django.http.request.HttpRequest)

Return type:

str | None

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]ΒΆ