Merge pull request #7530 from jumpserver/pr@dev@ssh_passphrase_bug

fix: 修改 修改ssh密钥时报500问题
pull/7533/head
feng626 3 years ago committed by GitHub
commit 2beec1a03b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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…
Cancel
Save