devices.views¶
This module contains all views concerning the devices application.
Attributes¶
Classes¶
Device Table View. |
|
Device Table View. |
|
Table View for devices where opc_ua_gds is True. |
|
Abstract view for choosing if the new device shall be onboarded or not. |
|
View for choosing if the new device shall be onboarded or not. |
|
View for choosing if the new OPC UA GDS shall be onboarded or not. |
|
Deprecated: Redirects to standard devices create page. |
|
Abstract view for choosing how new device shall be added. |
|
View for choosing how new device shall be added. |
|
asdfds. |
|
Create form view for the devices section. |
|
Create form view for the devices section. |
|
asdfds. |
|
Create form view for the devices section. |
|
Create form view for OPC UA GDS Push devices in the devices section. |
|
Create form view for the devices section. |
|
Deprecated: Redirects to standard devices OPC UA GDS Push create page. |
|
This is the CLM summary view in the devices section. |
|
Certificate Lifecycle Management Summary View for devices. |
|
Certificate Lifecycle Management Summary View for OPC UA Devcies. |
|
Certificate Lifecycle Management Summary View for OPC UA GDS Push devices. |
|
abc. |
|
abc. |
|
abc. |
|
|
abc. |
abc. |
|
|
abc. |
abc. |
|
abc. |
|
abc. |
|
View for issuing application credentials for OPC UA GDS Push devices - redirects directly to help page. |
|
Base view for all credential issuance views. |
|
Base view for issuing domain credentials. |
|
View for issuing domain credentials for devices. |
|
View for issuing domain credentials for OPC-UA GDS devices. |
|
View for issuing domain credentials for OPC-UA GDS Push devices. |
|
View to discover OPC UA server information without authentication. |
|
View for associating a truststore with an OPC UA GDS Push device's onboarding configuration. |
|
View to issue a new TLS client credential. |
|
Issue a new TLS client credential within the devices section. |
|
Issue a new TLS client credential within the devices section. |
|
View to issue a new TLS server credential. |
|
Issues a TLS server credenital within the devices section. |
|
Issues a TLS server credenital within the devices section. |
|
View to issue a new OPC UA client credential. |
|
Issues an OPC UA client credential within the devices section. |
|
Issues an OPC UA client credential within the devices section. |
|
View to issue a new OPC UA server credential. |
|
Issues an OPC UA server credential within the devices section. |
|
Issues an OPC UA server credential within the devices section. |
|
Mixin which checks the token included in the URL for browser download views. |
|
Redirects depending on the type of credential, that is if a private key is available or not. |
|
Download dispatcher view for the device pages. |
|
Download dispatcher view for the OPC UA GDS pages. |
|
Download dispatcher view for the OPC UA GDS Push pages. |
|
View for downloading certificates. |
|
Certificate download view for the device pages. |
|
Certificate download view for the OPC UA GDS pages. |
|
Certificate download view for the OPC UA GDS Push pages. |
|
View to update the trustlist on an OPC UA GDS Push device. |
|
View to update the server certificate on an OPC UA GDS Push device. |
|
View to download the trust bundle (CA certificates and CRLs) for a given Issuing CA. |
|
View to download a password protected application credential in the desired format. |
|
View to download a password protected domain or application credential in the desired format. |
|
View to download a password protected domain or app credential in the desired format from a remote client. |
|
View to display the OTP for remote credential download (aka. browser onboarding). |
|
The browser onboarding OTP view for the devices section. |
|
The browser onboarding OTP view for the OPC UA GDS section. |
|
View to cancel the browser onboarding process and delete the associated RemoteDeviceCredentialDownloadModel. |
|
Cancels the browser onboarding for the devices section. |
|
Cancels the browser onboarding for the OPC UA GDS section. |
|
View to handle certificate download requests. |
|
Revokes a specific issued credential. |
|
abc. |
|
abc. |
|
abc. |
|
View to confirm the deletion of multiple Devices. |
|
abc. |
|
abc. |
|
abc. |
|
View to confirm the deletion of multiple Devices. |
|
abc. |
|
abc. |
|
abc. |
|
ViewSet for managing Device instances. |
Module Contents¶
- class devices.views.AbstractDeviceTableView[source]¶
Bases:
trustpoint.page_context.PageContextMixin,django.views.generic.list.ListView[devices.models.DeviceModel],abc.ABCDevice Table View.
- 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:
AbstractDeviceTableViewDevice Table View.
- 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:
DeviceTableViewTable View for devices where opc_ua_gds is True.
- 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.TemplateViewAbstract view for choosing if the new device shall be onboarded or not.
- class devices.views.DeviceCreateChooseOnboardingView(**kwargs)[source]¶
Bases:
AbstractCreateChooseOnboaringViewView for choosing if the new device shall be onboarded or not.
- class devices.views.OpcUaGdsCreateChooseOnboardingView(**kwargs)[source]¶
Bases:
AbstractCreateChooseOnboaringViewView for choosing if the new OPC UA GDS shall be onboarded or not.
- class devices.views.OpcUaGdsPushCreateChooseOnboardingView(**kwargs)[source]¶
Bases:
django.views.generic.base.RedirectViewDeprecated: Redirects to standard devices create page.
- class devices.views.AbstractCreateAddOnboardingTypeView(**kwargs)[source]¶
Bases:
trustpoint.page_context.PageContextMixin,django.views.generic.base.TemplateViewAbstract view for choosing how new device shall be added.
- class devices.views.DeviceCreateAddOnboardingTypeView(**kwargs)[source]¶
Bases:
AbstractCreateAddOnboardingTypeViewView for choosing how new device shall be added.
- class devices.views.AbstractCreateNoOnboardingView[source]¶
Bases:
trustpoint.page_context.PageContextMixin,django.views.generic.edit.FormView[devices.forms.NoOnboardingCreateForm]asdfds.
- 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
- class devices.views.DeviceCreateNoOnboardingView[source]¶
Bases:
AbstractCreateNoOnboardingViewCreate form view for the devices section.
- class devices.views.OpcUaGdsCreateNoOnboardingView[source]¶
Bases:
AbstractCreateNoOnboardingViewCreate form view for the devices section.
- class devices.views.AbstractCreateOnboardingView[source]¶
Bases:
trustpoint.page_context.PageContextMixin,django.views.generic.edit.FormView[django.forms.Form]asdfds.
- 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.DeviceCreateOnboardingView[source]¶
Bases:
AbstractCreateOnboardingViewCreate form view for the devices section.
- class devices.views.DeviceCreateOpcUaGdsPushView[source]¶
Bases:
AbstractCreateOnboardingViewCreate form view for OPC UA GDS Push devices in the devices section.
- 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
- class devices.views.OpcUaGdsCreateOnboardingView[source]¶
Bases:
AbstractCreateOnboardingViewCreate form view for the devices section.
- class devices.views.OpcUaGdsPushCreateOnboardingView(**kwargs)[source]¶
Bases:
django.views.generic.base.RedirectViewDeprecated: Redirects to standard devices OPC UA GDS Push create page.
- class devices.views.AbstractCertificateLifecycleManagementSummaryView[source]¶
Bases:
trustpoint.page_context.PageContextMixin,django.views.generic.detail.DetailView[devices.models.DeviceModel],abc.ABCThis is the CLM summary view in the devices section.
- 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]¶
- 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:
django.forms.Form
- get_no_onboarding_form()[source]¶
Gets the form for no onboarding.
- Returns:
The no onboarding form.
- Return type:
- get_device_form()[source]¶
Gets the device Form for onboarding or no onboarding.
- Returns:
The required form.
- Return type:
django.forms.Form
- 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:
AbstractCertificateLifecycleManagementSummaryViewCertificate Lifecycle Management Summary View for devices.
- dispatch(request, *args, **kwargs)[source]¶
Check device type and redirect OPC UA GDS Push devices to their specific view.
- 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
- class devices.views.OpcUaGdsCertificateLifecycleManagementSummaryView[source]¶
Bases:
AbstractCertificateLifecycleManagementSummaryViewCertificate Lifecycle Management Summary View for OPC UA Devcies.
- class devices.views.OpcUaGdsPushCertificateLifecycleManagementSummaryView[source]¶
Bases:
AbstractCertificateLifecycleManagementSummaryViewCertificate Lifecycle Management Summary View for OPC UA GDS Push devices.
- 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:
- 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.
- 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:
AbstractNoOnboardingIssueNewApplicationCredentialViewabc.
- class devices.views.OpcUaGdsNoOnboardingIssueNewApplicationCredentialView[source]¶
Bases:
AbstractNoOnboardingIssueNewApplicationCredentialViewabc.
- class devices.views.AbstractSelectCertificateProfileNewApplicationCredentialView[source]¶
Bases:
trustpoint.page_context.PageContextMixin,django.views.generic.detail.DetailView[devices.models.DeviceModel]abc.
- class devices.views.DeviceSelectCertificateProfileNewApplicationCredentialView[source]¶
Bases:
AbstractSelectCertificateProfileNewApplicationCredentialViewabc.
- class devices.views.OpcUaGdsSelectCertificateProfileNewApplicationCredentialView[source]¶
Bases:
AbstractSelectCertificateProfileNewApplicationCredentialViewabc.
- class devices.views.AbstractOnboardingIssueNewApplicationCredentialView[source]¶
Bases:
trustpoint.page_context.PageContextMixin,django.views.generic.detail.DetailView[devices.models.DeviceModel]abc.
- class devices.views.DeviceOnboardingIssueNewApplicationCredentialView[source]¶
Bases:
AbstractOnboardingIssueNewApplicationCredentialViewabc.
- class devices.views.OpcUaGdsOnboardingIssueNewApplicationCredentialView[source]¶
Bases:
AbstractOnboardingIssueNewApplicationCredentialViewabc.
- class devices.views.OpcUaGdsPushOnboardingIssueNewApplicationCredentialView[source]¶
Bases:
AbstractOnboardingIssueNewApplicationCredentialViewView for issuing application credentials for OPC UA GDS Push devices - redirects directly to help page.
- 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.
- form_class: type[devices.forms.BaseCredentialForm][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:
- 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]¶
- 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:
- class devices.views.DeviceIssueDomainCredentialView[source]¶
Bases:
AbstractIssueDomainCredentialViewView for issuing domain credentials for devices.
- class devices.views.OpcUaGdsIssueDomainCredentialView[source]¶
Bases:
AbstractIssueDomainCredentialViewView for issuing domain credentials for OPC-UA GDS devices.
- class devices.views.OpcUaGdsPushIssueDomainCredentialView[source]¶
Bases:
AbstractIssueDomainCredentialViewView for issuing domain credentials for OPC-UA GDS Push devices.
- issue_credential(device, cleaned_data)[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.
cleaned_data (dict[str, Any]) – The validated form data.
- Returns:
The IssuedCredentialModel object that was created and saved.
- Return type:
- 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.
- class devices.views.OpcUaGdsPushTruststoreAssociationView[source]¶
Bases:
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.
- 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
- _handle_import(request)[source]¶
Handle truststore import from modal.
- Parameters:
request (django.http.request.HttpRequest)
- Return type:
django.http.HttpResponse
- class devices.views.AbstractIssueTlsClientCredentialView[source]¶
Bases:
AbstractIssueCredentialView[devices.forms.IssueTlsClientCredentialForm,devices.issuer.LocalTlsClientCredentialIssuer]View to issue a new TLS client credential.
- 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:
- class devices.views.DeviceIssueTlsClientCredentialView[source]¶
Bases:
AbstractIssueTlsClientCredentialViewIssue a new TLS client credential within the devices section.
- class devices.views.OpcUaGdsIssueTlsClientCredentialView[source]¶
Bases:
AbstractIssueTlsClientCredentialViewIssue a new TLS client credential within the devices section.
- class devices.views.AbstractIssueTlsServerCredentialView[source]¶
Bases:
AbstractIssueCredentialView[devices.forms.IssueTlsServerCredentialForm,devices.issuer.LocalTlsServerCredentialIssuer]View to issue a new TLS server credential.
- 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:
- class devices.views.DeviceIssueTlsServerCredentialView[source]¶
Bases:
AbstractIssueTlsServerCredentialViewIssues a TLS server credenital within the devices section.
- class devices.views.OpcUaGdsIssueTlsServerCredentialView[source]¶
Bases:
AbstractIssueTlsServerCredentialViewIssues a TLS server credenital within the devices section.
- class devices.views.AbstractIssueOpcUaClientCredentialView[source]¶
Bases:
AbstractIssueCredentialView[devices.forms.IssueOpcUaClientCredentialForm,devices.issuer.OpcUaClientCredentialIssuer]View to issue a new OPC UA client credential.
- 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:
- class devices.views.DeviceIssueOpcUaClientCredentialView[source]¶
Bases:
AbstractIssueOpcUaClientCredentialViewIssues an OPC UA client credential within the devices section.
- class devices.views.OpcUaGdsIssueOpcUaClientCredentialView[source]¶
Bases:
AbstractIssueOpcUaClientCredentialViewIssues an OPC UA client credential within the devices section.
- class devices.views.AbstractIssueOpcUaServerCredentialView[source]¶
Bases:
AbstractIssueCredentialView[devices.forms.IssueOpcUaServerCredentialForm,devices.issuer.OpcUaServerCredentialIssuer]View to issue a new OPC UA server credential.
- 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:
- class devices.views.DeviceIssueOpcUaServerCredentialView[source]¶
Bases:
AbstractIssueOpcUaServerCredentialViewIssues an OPC UA server credential within the devices section.
- class devices.views.OpcUaGdsIssueOpcUaServerCredentialView[source]¶
Bases:
AbstractIssueOpcUaServerCredentialViewIssues an OPC UA server credential within the devices section.
- 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.RedirectViewRedirects depending on the type of credential, that is if a private key is available or not.
- model: type[devices.models.IssuedCredentialModel][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:
AbstractDownloadPageDispatcherViewDownload dispatcher view for the device pages.
- class devices.views.OpcUaGdsDownloadPageDispatcherView(**kwargs)[source]¶
Bases:
AbstractDownloadPageDispatcherViewDownload dispatcher view for the OPC UA GDS pages.
- class devices.views.OpcUaGdsPushDownloadPageDispatcherView(**kwargs)[source]¶
Bases:
AbstractDownloadPageDispatcherViewDownload dispatcher view for the OPC UA GDS Push pages.
- class devices.views.AbstractCertificateDownloadView[source]¶
Bases:
trustpoint.page_context.PageContextMixin,django.views.generic.detail.DetailView[devices.models.IssuedCredentialModel]View for downloading certificates.
- model: type[devices.models.IssuedCredentialModel][source]¶
- class devices.views.DeviceCertificateDownloadView[source]¶
Bases:
AbstractCertificateDownloadViewCertificate download view for the device pages.
- class devices.views.OpcUaGdsCertificateDownloadView[source]¶
Bases:
AbstractCertificateDownloadViewCertificate download view for the OPC UA GDS pages.
- class devices.views.OpcUaGdsPushCertificateDownloadView[source]¶
Bases:
AbstractCertificateDownloadViewCertificate download view for the OPC UA GDS Push pages.
- 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.
- 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.
- 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
- _update_truststore_with_certificate(certificate_bytes)[source]¶
Update or create truststore with the new server certificate.
This method adds the new server certificate to the truststore WITHOUT removing the old one immediately. This ensures that if something goes wrong, the old certificate is still available for recovery.
- Parameters:
certificate_bytes (bytes) – DER-encoded certificate bytes
- Return type:
None
- 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.
- 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[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.
- 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:
AbstractDeviceBaseCredentialDownloadViewView to download a password protected domain or application credential in the desired format.
- class devices.views.DeviceBrowserCredentialDownloadView[source]¶
Bases:
DownloadTokenRequiredAuthenticationMixin,AbstractDeviceBaseCredentialDownloadViewView to download a password protected domain or app credential in the desired format from a remote client.
- 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).
- class devices.views.DeviceBrowserOnboardingOTPView[source]¶
Bases:
AbstractBrowserOnboardingOTPViewThe browser onboarding OTP view for the devices section.
- class devices.views.OpcUaGdsBrowserOnboardingOTPView[source]¶
Bases:
AbstractBrowserOnboardingOTPViewThe browser onboarding OTP view for the OPC UA GDS section.
- 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.
- 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:
AbstractBrowserOnboardingCancelViewCancels the browser onboarding for the devices section.
- class devices.views.OpcUaGdsBrowserOnboardingCancelView[source]¶
Bases:
AbstractBrowserOnboardingCancelViewCancels the browser onboarding for the OPC UA GDS section.
- class devices.views.DeviceOnboardingBrowserLoginView[source]¶
Bases:
django.views.generic.edit.FormView[devices.forms.BrowserLoginForm]View to handle certificate download requests.
- 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.
- 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:
AbstractIssuedCredentialRevocationViewabc.
- class devices.views.OpcUaGdsIssuedCredentialRevocationView[source]¶
Bases:
AbstractIssuedCredentialRevocationViewabc.
- class devices.views.OpcUaGdsPushIssuedCredentialRevocationView[source]¶
Bases:
AbstractIssuedCredentialRevocationViewabc.
- 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.
- queryset: django.db.models.QuerySet[devices.models.DeviceModel][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:
AbstractBulkRevokeViewabc.
- class devices.views.OpcUaGdsBulkRevokeView[source]¶
Bases:
AbstractBulkRevokeViewabc.
- class devices.views.OpcUaGdsPushBulkRevokeView[source]¶
Bases:
AbstractBulkRevokeViewabc.
- 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.
- queryset: django.db.models.QuerySet[devices.models.DeviceModel][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:
AbstractBulkDeleteViewabc.
- class devices.views.OpcUaGdsBulkDeleteView[source]¶
Bases:
AbstractBulkDeleteViewabc.
- class devices.views.OpcUaGdsPushBulkDeleteView[source]¶
Bases:
AbstractBulkDeleteViewabc.
- 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.