perf: input_secret (#9542)

Co-authored-by: feng <1304903146@qq.com>
pull/9543/head
fit2bot 2023-02-14 16:53:10 +08:00 committed by GitHub
parent bd7e9ce4b9
commit 306193ca5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 2 deletions

View File

@ -0,0 +1,19 @@
# Generated by Django 3.2.16 on 2023-02-14 08:49
import common.db.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('authentication', '0017_auto_20230105_1743'),
]
operations = [
migrations.AlterField(
model_name='connectiontoken',
name='input_secret',
field=common.db.fields.EncryptTextField(blank=True, default='', max_length=64, verbose_name='Input secret'),
),
]

View File

@ -10,7 +10,7 @@ from django.utils.translation import ugettext_lazy as _
from rest_framework.exceptions import PermissionDenied from rest_framework.exceptions import PermissionDenied
from assets.const import Protocol from assets.const import Protocol
from common.db.fields import EncryptCharField from common.db.fields import EncryptTextField
from common.exceptions import JMSException from common.exceptions import JMSException
from common.utils import lazyproperty, pretty_string, bulk_get from common.utils import lazyproperty, pretty_string, bulk_get
from common.utils.timezone import as_current_tz from common.utils.timezone import as_current_tz
@ -34,7 +34,7 @@ class ConnectionToken(JMSOrgBaseModel):
) )
account = models.CharField(max_length=128, verbose_name=_("Account name")) # 登录账号Name account = models.CharField(max_length=128, verbose_name=_("Account name")) # 登录账号Name
input_username = models.CharField(max_length=128, default='', blank=True, verbose_name=_("Input username")) input_username = models.CharField(max_length=128, default='', blank=True, verbose_name=_("Input username"))
input_secret = EncryptCharField(max_length=64, default='', blank=True, verbose_name=_("Input secret")) input_secret = EncryptTextField(max_length=64, default='', blank=True, verbose_name=_("Input secret"))
protocol = models.CharField(max_length=16, default=Protocol.ssh, verbose_name=_("Protocol")) protocol = models.CharField(max_length=16, default=Protocol.ssh, verbose_name=_("Protocol"))
connect_method = models.CharField(max_length=32, verbose_name=_("Connect method")) connect_method = models.CharField(max_length=32, verbose_name=_("Connect method"))
user_display = models.CharField(max_length=128, default='', verbose_name=_("User display")) user_display = models.CharField(max_length=128, default='', verbose_name=_("User display"))