mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 01:47:35 -02:30
don't allow private key passphrases for unencrypted private ssh keys
see: #5311
This commit is contained in:
@@ -345,6 +345,9 @@ class Credential(PasswordFieldsModel, CommonModelNameNotUnique, ResourceMixin):
|
|||||||
if self.has_encrypted_ssh_key_data and not self.ssh_key_unlock:
|
if self.has_encrypted_ssh_key_data and not self.ssh_key_unlock:
|
||||||
raise ValidationError(_('SSH key unlock must be set when SSH key '
|
raise ValidationError(_('SSH key unlock must be set when SSH key '
|
||||||
'is encrypted.'))
|
'is encrypted.'))
|
||||||
|
if not self.has_encrypted_ssh_key_data and self.ssh_key_unlock:
|
||||||
|
raise ValidationError(_('SSH key unlock should not be set when '
|
||||||
|
'SSH key is not encrypted.'))
|
||||||
return self.ssh_key_unlock
|
return self.ssh_key_unlock
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user