2022-10-19 09:05:21 +00:00
|
|
|
from django.db.models import TextChoices
|
2023-07-24 03:52:25 +00:00
|
|
|
from django.utils.translation import gettext_lazy as _
|
2022-10-19 09:05:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
class SecretType(TextChoices):
|
2022-11-08 09:54:51 +00:00
|
|
|
PASSWORD = 'password', _('Password')
|
|
|
|
SSH_KEY = 'ssh_key', _('SSH key')
|
|
|
|
ACCESS_KEY = 'access_key', _('Access key')
|
|
|
|
TOKEN = 'token', _('Token')
|
2023-06-30 10:33:18 +00:00
|
|
|
API_KEY = 'api_key', _("API key")
|
2022-12-27 09:45:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
class AliasAccount(TextChoices):
|
|
|
|
ALL = '@ALL', _('All')
|
|
|
|
INPUT = '@INPUT', _('Manual input')
|
|
|
|
USER = '@USER', _('Dynamic user')
|
2023-06-27 06:31:20 +00:00
|
|
|
ANON = '@ANON', _('Anonymous account')
|
2024-04-12 02:34:54 +00:00
|
|
|
SPEC = '@SPEC', _('Specified account')
|
2022-12-27 09:45:41 +00:00
|
|
|
|
2023-08-08 02:16:23 +00:00
|
|
|
@classmethod
|
|
|
|
def virtual_choices(cls):
|
|
|
|
return [(k, v) for k, v in cls.choices if k not in (cls.ALL,)]
|
|
|
|
|
2022-12-27 09:45:41 +00:00
|
|
|
|
|
|
|
class Source(TextChoices):
|
|
|
|
LOCAL = 'local', _('Local')
|
|
|
|
COLLECTED = 'collected', _('Collected')
|
2023-04-12 09:59:13 +00:00
|
|
|
TEMPLATE = 'template', _('Template')
|
2023-03-22 03:09:48 +00:00
|
|
|
|
|
|
|
|
2023-04-03 10:18:31 +00:00
|
|
|
class AccountInvalidPolicy(TextChoices):
|
2023-03-22 03:09:48 +00:00
|
|
|
SKIP = 'skip', _('Skip')
|
|
|
|
UPDATE = 'update', _('Update')
|
|
|
|
ERROR = 'error', _('Failed')
|