mirror of https://github.com/jumpserver/jumpserver
Merge pull request #7530 from jumpserver/pr@dev@ssh_passphrase_bug
fix: 修改 修改ssh密钥时报500问题pull/7533/head
commit
2beec1a03b
|
@ -43,6 +43,7 @@ class AuthSerializerMixin(serializers.ModelSerializer):
|
|||
if not private_key:
|
||||
return
|
||||
passphrase = self.initial_data.get('passphrase')
|
||||
passphrase = passphrase if passphrase else None
|
||||
valid = validate_ssh_private_key(private_key, password=passphrase)
|
||||
if not valid:
|
||||
raise serializers.ValidationError(_("private key invalid or passphrase error"))
|
||||
|
|
Loading…
Reference in New Issue