onboarding.modelsΒΆ

This module contains models related to onboarding configurations.

ClassesΒΆ

OnboardingStatus

The onboarding status.

OnboardingProtocol

Choices of onboarding protocols.

OnboardingPkiProtocol

Choices for onboarding pki protocols.

NoOnboardingPkiProtocol

Choices for no onboarding pki protocols.

AbstractPkiProtocolModel

Extends a model for IntegerChoices stored as bitwise flags.

OnboardingConfigModel

Onboarding Configuration Model.

NoOnboardingConfigModel

No Onboarding Configuration Model.

Module ContentsΒΆ

class onboarding.models.OnboardingStatus(*args, **kwds)[source]ΒΆ

Bases: django.db.models.IntegerChoices

The onboarding status.

PENDING[source]ΒΆ
ONBOARDED[source]ΒΆ
class onboarding.models.OnboardingProtocol(*args, **kwds)[source]ΒΆ

Bases: django.db.models.IntegerChoices

Choices of onboarding protocols.

MANUAL[source]ΒΆ
CMP_IDEVID[source]ΒΆ
CMP_SHARED_SECRET[source]ΒΆ
EST_IDEVID[source]ΒΆ
EST_USERNAME_PASSWORD[source]ΒΆ
AOKI[source]ΒΆ
BRSKI[source]ΒΆ
OPC_GDS_PUSH[source]ΒΆ
class onboarding.models.OnboardingPkiProtocol(*args, **kwds)[source]ΒΆ

Bases: django.db.models.IntegerChoices

Choices for onboarding pki protocols.

CMP[source]ΒΆ
EST[source]ΒΆ
OPC_GDS_PUSH[source]ΒΆ
class onboarding.models.NoOnboardingPkiProtocol(*args, **kwds)[source]ΒΆ

Bases: django.db.models.IntegerChoices

Choices for no onboarding pki protocols.

CMP_SHARED_SECRET[source]ΒΆ
EST_USERNAME_PASSWORD[source]ΒΆ
MANUAL[source]ΒΆ
class onboarding.models.AbstractPkiProtocolModel[source]ΒΆ

Extends a model for IntegerChoices stored as bitwise flags.

pki_protocol_class: type[AbstractPkiProtocolModel.T][source]ΒΆ
add_pki_protocol(pki_protocol)[source]ΒΆ

Adds the provided PkiProtocol to the allowed protocols for onboarded devices.

Parameters:

pki_protocol (T) – The PkiProtocol to allow.

Return type:

None

remove_pki_protocol(pki_protocol)[source]ΒΆ

Removes the provided PkiProtocol from the allowed protocols if it is allowed..

Parameters:

pki_protocol (T) – The PkiProtocol to forbid.

Return type:

None

clear_pki_protocols()[source]ΒΆ

Clears all allowed PkiProtocols, that is, it deactivates application certificate issuance.

Return type:

None

has_pki_protocol(pki_protocol)[source]ΒΆ

Checks if the provided PkiProtocol is allowed.

Parameters:

pki_protocol (T) – The PkiProtocol that is checked against the allowed ones.

Returns:

Returns True if the provided PkiProtocol is allowed, False otherwise.

Return type:

bool

get_pki_protocols()[source]ΒΆ

Gets all allowed PkiProtocols.

Returns:

Retruns the allowed PkiProtocols as list.

Return type:

list[T]

set_pki_protocols(pki_protocols)[source]ΒΆ

Sets all allowed PkiProtocols exactly matching the provided list.

Parameters:

pki_protocols (list[T])

Return type:

None

class onboarding.models.OnboardingConfigModel(*args, **kwargs)[source]ΒΆ

Bases: AbstractPkiProtocolModel[OnboardingPkiProtocol], django.db.models.Model

Onboarding Configuration Model.

pki_protocol_class[source]ΒΆ
pki_protocols[source]ΒΆ
onboarding_status[source]ΒΆ
onboarding_protocol[source]ΒΆ
est_password[source]ΒΆ
cmp_shared_secret[source]ΒΆ
opc_user[source]ΒΆ
opc_password[source]ΒΆ
idevid_trust_store[source]ΒΆ
opc_trust_store[source]ΒΆ
__str__()[source]ΒΆ

Gets the model instance as human-readable string.

Return type:

str

save(*args, **kwargs)[source]ΒΆ

Executes full_clean() before saving.

Parameters:
  • *args (Any) – Positional arguments are passed to super().save().

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

Return type:

None

clean()[source]ΒΆ

Validation before saving the model.

Return type:

None

_validate_case_opc_gds_push_onboarding()[source]ΒΆ

Validates case OnboardingProtocol.OPC_GDS_PUSH.

Parameters:

error_messages – The container that gathers all error messages.

Returns:

The error_messages gathered.

Return type:

dict[str, str]

_validate_case_manual_onboarding()[source]ΒΆ

Validates case OnboardingProtocol.MANUAL.

Parameters:

error_messages – The container that gathers all error messages.

Returns:

The error_messages gathered.

Return type:

dict[str, str]

_validate_case_cmp_idevid_onboarding()[source]ΒΆ

Validates case OnboardingProtocol.CMP_IDEVID.

Parameters:

error_messages – The container that gathers all error messages.

Returns:

The error_messages gathered.

Return type:

dict[str, str]

_validate_case_cmp_shared_secret_onboarding()[source]ΒΆ

Validates case OnboardingProtocol.CMP_SHARED_SECRET.

Parameters:

error_messages – The container that gathers all error messages.

Returns:

The error_messages gathered.

Return type:

dict[str, str]

_validate_case_est_idevid_onboarding()[source]ΒΆ

Validates case OnboardingProtocol.EST_IDEVID.

Parameters:

error_messages – The container that gathers all error messages.

Returns:

The error_messages gathered.

Return type:

dict[str, str]

_validate_case_est_username_password_onboarding()[source]ΒΆ

Validates case OnboardingProtocol.EST_USERNAME_PASSWORD.

Parameters:

error_messages – The container that gathers all error messages.

Returns:

The error_messages gathered.

Return type:

dict[str, str]

class onboarding.models.NoOnboardingConfigModel(*args, **kwargs)[source]ΒΆ

Bases: AbstractPkiProtocolModel[NoOnboardingPkiProtocol], django.db.models.Model

No Onboarding Configuration Model.

pki_protocol_class[source]ΒΆ
pki_protocols[source]ΒΆ
est_password[source]ΒΆ
cmp_shared_secret[source]ΒΆ
__str__()[source]ΒΆ

Gets the model instance as human-readable string.

Return type:

str

save(*args, **kwargs)[source]ΒΆ

Executes full_clean() before saving.

Parameters:
  • *args (Any) – Positional arguments are passed to super().save().

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

Return type:

None

clean()[source]ΒΆ

Validation before saving the model.

Return type:

None