mirror of
https://github.com/ansible/awx.git
synced 2026-03-29 06:45:09 -02:30
Merge pull request #4807 from ryanpetrello/cred-plugins-with-promptable-passphrase
fix a bug that prevents launch-time passphrases w/ cred plugins Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
@@ -151,7 +151,7 @@ class Credential(PasswordFieldsModel, CommonModelNameNotUnique, ResourceMixin):
|
|||||||
@property
|
@property
|
||||||
def has_encrypted_ssh_key_data(self):
|
def has_encrypted_ssh_key_data(self):
|
||||||
try:
|
try:
|
||||||
ssh_key_data = decrypt_field(self, 'ssh_key_data')
|
ssh_key_data = self.get_input('ssh_key_data')
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@@ -633,9 +633,6 @@ ManagedCredentialType(
|
|||||||
'secret': True,
|
'secret': True,
|
||||||
'ask_at_runtime': True
|
'ask_at_runtime': True
|
||||||
}],
|
}],
|
||||||
'dependencies': {
|
|
||||||
'ssh_key_unlock': ['ssh_key_data'],
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -667,9 +664,6 @@ ManagedCredentialType(
|
|||||||
'type': 'string',
|
'type': 'string',
|
||||||
'secret': True
|
'secret': True
|
||||||
}],
|
}],
|
||||||
'dependencies': {
|
|
||||||
'ssh_key_unlock': ['ssh_key_data'],
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -738,7 +732,6 @@ ManagedCredentialType(
|
|||||||
'secret': True,
|
'secret': True,
|
||||||
}],
|
}],
|
||||||
'dependencies': {
|
'dependencies': {
|
||||||
'ssh_key_unlock': ['ssh_key_data'],
|
|
||||||
'authorize_password': ['authorize'],
|
'authorize_password': ['authorize'],
|
||||||
},
|
},
|
||||||
'required': ['username'],
|
'required': ['username'],
|
||||||
|
|||||||
@@ -496,9 +496,6 @@ def test_falsey_field_data(get, post, organization, admin, field_value):
|
|||||||
|
|
||||||
@pytest.mark.django_db
|
@pytest.mark.django_db
|
||||||
@pytest.mark.parametrize('kind, extraneous', [
|
@pytest.mark.parametrize('kind, extraneous', [
|
||||||
['ssh', 'ssh_key_unlock'],
|
|
||||||
['scm', 'ssh_key_unlock'],
|
|
||||||
['net', 'ssh_key_unlock'],
|
|
||||||
['net', 'authorize_password'],
|
['net', 'authorize_password'],
|
||||||
])
|
])
|
||||||
def test_field_dependencies(get, post, organization, admin, kind, extraneous):
|
def test_field_dependencies(get, post, organization, admin, kind, extraneous):
|
||||||
|
|||||||
@@ -137,7 +137,6 @@ def test_credential_creation(organization_factory):
|
|||||||
[PKCS8_PRIVATE_KEY, None, True], # unencrypted PKCS8 key, no unlock pass
|
[PKCS8_PRIVATE_KEY, None, True], # unencrypted PKCS8 key, no unlock pass
|
||||||
[PKCS8_PRIVATE_KEY, 'passme', False], # unencrypted PKCS8 key, unlock pass
|
[PKCS8_PRIVATE_KEY, 'passme', False], # unencrypted PKCS8 key, unlock pass
|
||||||
[None, None, True], # no key, no unlock pass
|
[None, None, True], # no key, no unlock pass
|
||||||
[None, 'super-secret', False], # no key, unlock pass
|
|
||||||
['INVALID-KEY-DATA', None, False], # invalid key data
|
['INVALID-KEY-DATA', None, False], # invalid key data
|
||||||
[EXAMPLE_PRIVATE_KEY.replace('=', '\u003d'), None, True], # automatically fix JSON-encoded GCE keys
|
[EXAMPLE_PRIVATE_KEY.replace('=', '\u003d'), None, True], # automatically fix JSON-encoded GCE keys
|
||||||
])
|
])
|
||||||
|
|||||||
Reference in New Issue
Block a user