diff --git a/apps/authentication/migrations/0018_alter_connectiontoken_input_secret.py b/apps/authentication/migrations/0018_alter_connectiontoken_input_secret.py new file mode 100644 index 000000000..b11598066 --- /dev/null +++ b/apps/authentication/migrations/0018_alter_connectiontoken_input_secret.py @@ -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'), + ), + ] diff --git a/apps/authentication/models/connection_token.py b/apps/authentication/models/connection_token.py index 958ab8fa9..99a55616e 100644 --- a/apps/authentication/models/connection_token.py +++ b/apps/authentication/models/connection_token.py @@ -10,7 +10,7 @@ from django.utils.translation import ugettext_lazy as _ from rest_framework.exceptions import PermissionDenied from assets.const import Protocol -from common.db.fields import EncryptCharField +from common.db.fields import EncryptTextField from common.exceptions import JMSException from common.utils import lazyproperty, pretty_string, bulk_get 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 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")) connect_method = models.CharField(max_length=32, verbose_name=_("Connect method")) user_display = models.CharField(max_length=128, default='', verbose_name=_("User display"))