diff --git a/apps/assets/serializers/base.py b/apps/assets/serializers/base.py index 7c8760562..841ebeaae 100644 --- a/apps/assets/serializers/base.py +++ b/apps/assets/serializers/base.py @@ -32,8 +32,12 @@ class AuthSerializer(serializers.ModelSerializer): class AuthSerializerMixin(serializers.ModelSerializer): - password = EncryptedField(required=False, allow_blank=True, allow_null=True, max_length=1024) - private_key = EncryptedField(required=False, allow_blank=True, allow_null=True, max_length=4096) + password = EncryptedField( + label=_('Password'), required=False, allow_blank=True, allow_null=True, max_length=1024 + ) + private_key = EncryptedField( + label=_('SSH private key'), required=False, allow_blank=True, allow_null=True, max_length=4096 + ) passphrase = serializers.CharField( allow_blank=True, allow_null=True, required=False, max_length=512, write_only=True, label=_('Key password') diff --git a/apps/users/serializers/user.py b/apps/users/serializers/user.py index b1a9cf1d4..98abb47a6 100644 --- a/apps/users/serializers/user.py +++ b/apps/users/serializers/user.py @@ -88,7 +88,9 @@ class UserSerializer(RolesSerializerMixin, CommonBulkSerializerMixin, serializer can_public_key_auth = serializers.ReadOnlyField( source='can_use_ssh_key_login', label=_('Can public key authentication') ) - password = EncryptedField(required=False, allow_blank=True, allow_null=True, max_length=1024) + password = EncryptedField( + label=_('Password'), required=False, allow_blank=True, allow_null=True, max_length=1024 + ) # Todo: 这里看看该怎么搞 # can_update = serializers.SerializerMethodField(label=_('Can update')) # can_delete = serializers.SerializerMethodField(label=_('Can delete'))