Source code for onboarding.enums

"""Onboarding protocol and status enumerations."""

from __future__ import annotations

from django.db import models
from django.utils.translation import gettext_lazy as _

__all__ = [
    'NoOnboardingPkiProtocol',
    'OnboardingPkiProtocol',
    'OnboardingProtocol',
    'OnboardingStatus',
]


[docs] class OnboardingStatus(models.IntegerChoices): """The onboarding status."""
[docs] PENDING = 1, _('Pending')
[docs] ONBOARDED = 2, _('Onboarded')
[docs] class OnboardingProtocol(models.IntegerChoices): """Choices of onboarding protocols."""
[docs] MANUAL = 0, _('Manual Onboarding')
[docs] CMP_IDEVID = 1, _('CMP - IDevID')
[docs] CMP_SHARED_SECRET = 2, _('CMP - Shared Secret')
[docs] EST_IDEVID = 3, _('EST - IDevID')
[docs] EST_USERNAME_PASSWORD = 4, _('EST - Username & Password')
[docs] AOKI = 5, _('AOKI')
[docs] BRSKI = 6, _('BRSKI')
[docs] OPC_GDS_PUSH = 7, _('OPC - GDS Push')
[docs] class OnboardingPkiProtocol(models.IntegerChoices): """Choices for onboarding pki protocols.""" # Bitmask: Only use powers of 2: 1, 2, 4, 8, 16 ...
[docs] CMP = 1, _('CMP')
[docs] EST = 2, _('EST')
[docs] OPC_GDS_PUSH = 4, _('OPC - GDS Push')
[docs] class NoOnboardingPkiProtocol(models.IntegerChoices): """Choices for no onboarding pki protocols.""" # Bitmask: Only use powers of 2: 1, 2, 4, 8, 16 ...
[docs] CMP_SHARED_SECRET = 1, _('CMP - Shared Secret (HMAC)')
# 2 reserved for CMP Client Certificate
[docs] EST_USERNAME_PASSWORD = 4, _('EST - Username & Password')
# 8 reserved for EST Client Certificate
[docs] MANUAL = 16, _('Manual')