notifications.models
Module that contains all models corresponding to the devices app.
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: 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