jumpserver/apps/audits/const.py

75 lines
1.5 KiB
Python
Raw Normal View History

2021-09-27 11:06:26 +00:00
# -*- coding: utf-8 -*-
#
from django.utils.translation import ugettext_lazy as _
2022-11-10 06:44:23 +00:00
from django.db.models import TextChoices, IntegerChoices
2021-09-27 11:06:26 +00:00
DEFAULT_CITY = _("Unknown")
MODELS_NEED_RECORD = (
# users
2022-11-11 07:11:10 +00:00
"User",
"UserGroup",
# acls
2022-11-11 07:11:10 +00:00
"LoginACL",
"LoginAssetACL",
"LoginConfirmSetting",
# assets
2022-11-11 07:11:10 +00:00
"Asset",
"Node",
"AdminUser",
"SystemUser",
"Domain",
"Gateway",
"CommandFilterRule",
"CommandFilter",
"Platform",
"Account",
# applications
# orgs
2022-11-11 07:11:10 +00:00
"Organization",
# settings
2022-11-11 07:11:10 +00:00
"Setting",
# perms
2022-11-11 07:11:10 +00:00
"AssetPermission",
# xpack
2022-11-11 07:11:10 +00:00
"License",
"Account",
"SyncInstanceTask",
"ChangeAuthPlan",
"GatherUserTask",
)
2022-11-10 06:44:23 +00:00
class OperateChoices(TextChoices):
2022-11-11 07:11:10 +00:00
mkdir = "mkdir", _("Mkdir")
rmdir = "rmdir", _("Rmdir")
delete = "delete", _("Delete")
upload = "upload", _("Upload")
rename = "rename", _("Rename")
symlink = "symlink", _("Symlink")
download = "download", _("Download")
2022-11-10 06:44:23 +00:00
class ActionChoices(TextChoices):
2022-11-11 07:11:10 +00:00
view = "view", _("View")
update = "update", _("Update")
delete = "delete", _("Delete")
create = "create", _("Create")
2022-11-10 06:44:23 +00:00
class LoginTypeChoices(TextChoices):
2022-11-11 07:11:10 +00:00
web = "W", _("Web")
terminal = "T", _("Terminal")
unknown = "U", _("Unknown")
2022-11-10 06:44:23 +00:00
class MFAChoices(IntegerChoices):
2022-11-11 07:11:10 +00:00
disabled = 0, _("Disabled")
enabled = 1, _("Enabled")
unknown = 2, _("-")
2022-11-10 06:44:23 +00:00
class LoginStatusChoices(IntegerChoices):
2022-11-11 07:11:10 +00:00
success = True, _("Success")
failed = False, _("Failed")