notifications.modelsΒΆ

Module that contains all models corresponding to the devices app.

AttributesΒΆ

log

ClassesΒΆ

NotificationStatus

Model representing a status a notification can have.

NotificationMessageModel

Message Model for Notifications with Short and Optional Long Descriptions.

NotificationMessage

Class for notification content with short and optional long descriptions.

NotificationModel

Notifications Model.

WeakECCCurve

Represents a weak or deprecated ECC curve.

WeakSignatureAlgorithm

Represents a weak or deprecated signature algorithm.

NotificationConfig

Stores global configuration for notification thresholds and behaviors.

Module ContentsΒΆ

notifications.models.log[source]ΒΆ
class notifications.models.NotificationStatus(*args, **kwargs)[source]ΒΆ

Bases: django.db.models.Model

Model representing a status a notification can have.

class StatusChoices(*args, **kwds)[source]ΒΆ

Bases: django.db.models.TextChoices

Status Types.

NEW[source]ΒΆ
CONFIRMED[source]ΒΆ
IN_PROGRESS[source]ΒΆ
SOLVED[source]ΒΆ
NOT_SOLVED[source]ΒΆ
ESCALATED[source]ΒΆ
SUSPENDED[source]ΒΆ
REJECTED[source]ΒΆ
DELETED[source]ΒΆ
CLOSED[source]ΒΆ
ACKNOWLEDGED[source]ΒΆ
FAILED[source]ΒΆ
EXPIRED[source]ΒΆ
PENDING[source]ΒΆ
status[source]ΒΆ
get_status_display()[source]ΒΆ

Gets the status as human-readable string for displaying in the front-end.

Returns:

Human-readable string for displaying in the front-end.

Return type:

str

class Meta[source]ΒΆ

Bases: django_stubs_ext.db.models.TypedModelMeta

Meta class configuration.

__str__()[source]ΒΆ

Returns a human-readable string.

Returns:

The status.

Return type:

str

class notifications.models.NotificationMessageModel(*args, **kwargs)[source]ΒΆ

Bases: django.db.models.Model

Message Model for Notifications with Short and Optional Long Descriptions.

short_description[source]ΒΆ
long_description[source]ΒΆ
class Meta[source]ΒΆ

Bases: django_stubs_ext.db.models.TypedModelMeta

Meta class configuration.

__str__()[source]ΒΆ

Returns a human-readable string.

Returns:

The short description.

Return type:

str

class notifications.models.NotificationMessage(short_description, long_description='No description provided')[source]ΒΆ

Class for notification content with short and optional long descriptions.

Parameters:
  • short_description (django_stubs_ext.StrOrPromise)

  • long_description (django_stubs_ext.StrOrPromise)

short_description: str[source]ΒΆ
long_description: str = 'No description provided'[source]ΒΆ
__str__()[source]ΒΆ

Returns a human-readable string.

Returns:

The short description.

Return type:

str

property short: str[source]ΒΆ

Returns the short description.

Returns:

The short description.

Return type:

str

property long: str[source]ΒΆ

Returns the long description.

Returns:

The long description.

Return type:

str

class notifications.models.NotificationModel(*args, **kwargs)[source]ΒΆ

Bases: django.db.models.Model

Notifications Model.

class NotificationTypes(*args, **kwds)[source]ΒΆ

Bases: django.db.models.TextChoices

Supported Notification Types.

SETUP[source]ΒΆ
INFO[source]ΒΆ
WARNING[source]ΒΆ
CRITICAL[source]ΒΆ
class NotificationSource(*args, **kwds)[source]ΒΆ

Bases: django.db.models.TextChoices

Origin of the Notification.

SYSTEM[source]ΒΆ
DOMAIN[source]ΒΆ
DEVICE[source]ΒΆ
ISSUING_CA[source]ΒΆ
CERTIFICATE[source]ΒΆ
class NotificationMessageType(*args, **kwds)[source]ΒΆ

Bases: django.db.models.TextChoices

Types of messages (aka. unique strings to that particular notification).

CUSTOM = ('C', 'custom')[source]ΒΆ
ISSUING_CA_TEST = 'TEST_CA'[source]ΒΆ
DOMAIN_TEST = 'TEST_DOMAIN'[source]ΒΆ
CERT_TEST = 'TEST_CERT'[source]ΒΆ
DEVICE_TEST = 'TEST_DEVICE'[source]ΒΆ
WELCOME_POPULATE_TEST_DATA = 'POP_TEST_DATA'[source]ΒΆ
TRUSTPOINT_DOCUMENTATION = 'TP_DOCS'[source]ΒΆ
TRUSTPOINT_PROJECT_INFO = 'TP_INFO'[source]ΒΆ
WELCOME_MESSAGE = 'WELCOME'[source]ΒΆ
SYSTEM_NOT_HEALTHY = 'SYS_NOT_HEALTHY'[source]ΒΆ
VULNERABILITY = 'VULNERABILITY'[source]ΒΆ
CERT_EXPIRING = 'CERT_EXPIRING'[source]ΒΆ
CERT_EXPIRED = 'CERT_EXPIRED'[source]ΒΆ
ISSUING_CA_EXPIRING = 'CA_EXPIRING'[source]ΒΆ
ISSUING_CA_EXPIRED = 'CA_EXPIRED'[source]ΒΆ
DOMAIN_NO_ISSUING_CA = 'DOMAIN_NO_CA'[source]ΒΆ
DEVICE_NOT_ONBOARDED = 'DEV_NOT_ONBRD'[source]ΒΆ
DEVICE_ONBOARDING_FAILED = 'DEV_ONBRD_FAIL'[source]ΒΆ
DEVICE_CERT_REVOKED = 'DEV_CERT_REV'[source]ΒΆ
WEAK_SIGNATURE_ALGORITHM = 'WEAK_SIG_ALGO'[source]ΒΆ
INSUFFICIENT_KEY_LENGTH = 'INSUFF_KEY_LEN'[source]ΒΆ
WEAK_ECC_CURVE = 'WEAK_ECC_CURVE'[source]ΒΆ
get_message()[source]ΒΆ

Returns the message for the given type.

Returns:

The notification message.

Return type:

NotificationMessage

notification_type[source]ΒΆ
notification_source[source]ΒΆ
message_type[source]ΒΆ
message_data[source]ΒΆ
domain[source]ΒΆ
certificate[source]ΒΆ
device[source]ΒΆ
issuing_ca[source]ΒΆ
event[source]ΒΆ
message[source]ΒΆ
statuses[source]ΒΆ
created_at[source]ΒΆ
get_notification_type_display()[source]ΒΆ

Gets the notification type as human-readable string for displaying in the front-end.

Returns:

Human-readable string for displaying in the front-end.

Return type:

str

class Meta[source]ΒΆ

Bases: django_stubs_ext.db.models.TypedModelMeta

Meta class configuration.

__str__()[source]ΒΆ

Returns a human-readable string.

Returns:

The notification type to display with message description if available.

Return type:

str

property short_translated: Any[source]ΒΆ

Returns the translated short description.

Returns:

The translated short description.

Return type:

Any

property long_translated: Any[source]ΒΆ

Returns the translated long description.

Returns:

The translated long description.

Return type:

Any

class notifications.models.WeakECCCurve(*args, **kwargs)[source]ΒΆ

Bases: django.db.models.Model

Represents a weak or deprecated ECC curve.

objects: django.db.models.Manager[WeakECCCurve][source]ΒΆ
class ECCCurveChoices(*args, **kwds)[source]ΒΆ

Bases: django.db.models.TextChoices

Enumeration of weak or deprecated ECC curve OIDs.

SECP160R1[source]ΒΆ
SECP192R1[source]ΒΆ
SECP224R1[source]ΒΆ
SECP256K1[source]ΒΆ
SECT163K1[source]ΒΆ
SECT163R2[source]ΒΆ
SECT233K1[source]ΒΆ
SECT233R1[source]ΒΆ
SECT283K1[source]ΒΆ
oid[source]ΒΆ
__str__()[source]ΒΆ

Return the human-readable name for the ECC curve.

Return type:

str

class notifications.models.WeakSignatureAlgorithm(*args, **kwargs)[source]ΒΆ

Bases: django.db.models.Model

Represents a weak or deprecated signature algorithm.

objects: django.db.models.Manager[WeakSignatureAlgorithm][source]ΒΆ
class SignatureChoices(*args, **kwds)[source]ΒΆ

Bases: django.db.models.TextChoices

Enumeration of weak or deprecated signature algorithm OIDs.

MD5[source]ΒΆ
SHA1[source]ΒΆ
SHA224[source]ΒΆ
oid[source]ΒΆ
__str__()[source]ΒΆ

Return the human-readable name for the weak signature algorithm.

Return type:

str

class notifications.models.NotificationConfig(*args, **kwargs)[source]ΒΆ

Bases: django.db.models.Model

Stores global configuration for notification thresholds and behaviors.

objects: django.db.models.Manager[NotificationConfig][source]ΒΆ
cert_expiry_warning_days[source]ΒΆ
issuing_ca_expiry_warning_days[source]ΒΆ
rsa_minimum_key_size[source]ΒΆ
weak_ecc_curves[source]ΒΆ
weak_signature_algorithms[source]ΒΆ
class Meta[source]ΒΆ

Meta class configuration.

verbose_name[source]ΒΆ
__str__()[source]ΒΆ

Return the human-readable name for the notification configuration.

Return type:

str

classmethod get()[source]ΒΆ

Ensure there’s always one settings object to use.

Return type:

NotificationConfig