management.modelsΒΆ

Models concerning the Trustpoint settings.

ClassesΒΆ

SecurityConfig

Security Configuration model.

TlsSettings

TLS settings model

AppVersion

Make subclasses preserve the alters_data attribute on overridden methods.

BackupOptions

A singleton model (we always operate with pk=1) for backup settings.

LoggingConfig

Logging Configuration model.

Module ContentsΒΆ

class management.models.SecurityConfig(*args, **kwargs)[source]ΒΆ

Bases: django.db.models.Model

Security Configuration model.

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

Bases: django.db.models.TextChoices

Types of security modes.

DEV[source]ΒΆ
LOW[source]ΒΆ
MEDIUM[source]ΒΆ
HIGH[source]ΒΆ
HIGHEST[source]ΒΆ
security_mode[source]ΒΆ
auto_gen_pki[source]ΒΆ
auto_gen_pki_key_algorithm[source]ΒΆ
NOTIFICATION_CONFIGURATIONS: ClassVar[dict][source]ΒΆ
notification_config[source]ΒΆ
__str__()[source]ΒΆ

Output as string.

Return type:

str

apply_security_settings()[source]ΒΆ

Apply appropriate configuration values based on the security mode.

Return type:

None

class management.models.TlsSettings(*args, **kwargs)[source]ΒΆ

Bases: django.db.models.Model

TLS settings model

ipv4_address[source]ΒΆ
classmethod get_first_ipv4_address()[source]ΒΆ

Get the first IPv4 address or a default value.

Return type:

str

class management.models.AppVersion(*args, **kwargs)[source]ΒΆ

Bases: django.db.models.Model

Make subclasses preserve the alters_data attribute on overridden methods.

objects: django.db.models.Manager[AppVersion][source]ΒΆ
version[source]ΒΆ
last_updated[source]ΒΆ
class Meta[source]ΒΆ
verbose_name = 'App Version'[source]ΒΆ
__str__()[source]ΒΆ
Return type:

str

class management.models.BackupOptions(*args, **kwargs)[source]ΒΆ

Bases: django.db.models.Model

A singleton model (we always operate with pk=1) for backup settings. We store host/port/user/local_storage, plus either a password or an SSH key.

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

Bases: django.db.models.TextChoices

Class for creating enumerated string choices.

PASSWORD = ('password', 'Password')[source]ΒΆ
SSH_KEY = ('ssh_key', 'SSH Key')[source]ΒΆ
local_storage[source]ΒΆ
sftp_storage[source]ΒΆ
host[source]ΒΆ
port[source]ΒΆ
user[source]ΒΆ
auth_method[source]ΒΆ
password[source]ΒΆ
private_key[source]ΒΆ
key_passphrase[source]ΒΆ
remote_directory[source]ΒΆ
save(*args, **kwargs)[source]ΒΆ

Ensure only one instance exists (singleton pattern).

clean()[source]ΒΆ

Prevent the creation of more than one instance.

class Meta[source]ΒΆ
verbose_name = 'Backup Option'[source]ΒΆ
__str__()[source]ΒΆ
Return type:

str

class management.models.LoggingConfig(*args, **kwargs)[source]ΒΆ

Bases: django.db.models.Model

Logging Configuration model.

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

Bases: django.db.models.TextChoices

Types of log levels.

DEBUG[source]ΒΆ
INFO[source]ΒΆ
WARNING[source]ΒΆ
ERROR[source]ΒΆ
CRITICAL[source]ΒΆ
log_level[source]ΒΆ
last_updated[source]ΒΆ
__str__()[source]ΒΆ

Output as string.

Return type:

str