mirror of https://github.com/jumpserver/jumpserver
fix: 修复密码密钥翻译问题
parent
2a8f8dd709
commit
525538e775
|
@ -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')
|
||||
|
|
|
@ -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'))
|
||||
|
|
Loading…
Reference in New Issue