1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-02 09:51:09 +03:00

Merge pull request #1304 from mabashian/1136-credential-password-prompt

1136 credential password prompt
This commit is contained in:
Michael Abashian 2018-04-11 10:10:36 -04:00 committed by GitHub
commit 9b7f9c4276
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,11 +51,14 @@ export default
} else if(cred.inputs && !_.isEmpty(cred.inputs)) {
if(cred.inputs.password && cred.inputs.password === "ASK") {
delete scope.promptData.prompts.credentials.passwords.ssh;
} else if(cred.inputs.become_password && cred.inputs.become_password === "ASK") {
}
if(cred.inputs.become_password && cred.inputs.become_password === "ASK") {
delete scope.promptData.prompts.credentials.passwords.become;
} else if(cred.inputs.ssh_key_unlock && cred.inputs.ssh_key_unlock === "ASK") {
}
if(cred.inputs.ssh_key_unlock && cred.inputs.ssh_key_unlock === "ASK") {
delete scope.promptData.prompts.credentials.passwords.ssh_key_unlock;
} else if(cred.inputs.vault_password && cred.inputs.vault_password === "ASK") {
}
if(cred.inputs.vault_password && cred.inputs.vault_password === "ASK") {
for (let i = scope.promptData.prompts.credentials.passwords.vault.length - 1; i >= 0; i--) {
if(cred.id === scope.promptData.prompts.credentials.passwords.vault[i].id) {
scope.promptData.prompts.credentials.passwords.vault.splice(i, 1);
@ -68,22 +71,33 @@ export default
let updateNeededPasswords = (cred) => {
if(cred.inputs) {
let credPassObj = {
if(cred.inputs.password && cred.inputs.password === "ASK") {
scope.promptData.prompts.credentials.passwords.ssh = {
id: cred.id,
name: cred.name
};
if(cred.inputs.password && cred.inputs.password === "ASK") {
scope.promptData.prompts.credentials.passwords.ssh = credPassObj;
} else if(cred.inputs.become_password && cred.inputs.become_password === "ASK") {
scope.promptData.prompts.credentials.passwords.become = credPassObj;
} else if(cred.inputs.ssh_key_unlock && cred.inputs.ssh_key_unlock === "ASK") {
scope.promptData.prompts.credentials.passwords.ssh_key_unlock = credPassObj;
} else if(cred.inputs.vault_password && cred.inputs.vault_password === "ASK") {
credPassObj.vault_id = cred.inputs.vault_id;
}
if(cred.inputs.become_password && cred.inputs.become_password === "ASK") {
scope.promptData.prompts.credentials.passwords.become = {
id: cred.id,
name: cred.name
};
}
if(cred.inputs.ssh_key_unlock && cred.inputs.ssh_key_unlock === "ASK") {
scope.promptData.prompts.credentials.passwords.ssh_key_unlock = {
id: cred.id,
name: cred.name
};
}
if(cred.inputs.vault_password && cred.inputs.vault_password === "ASK") {
if(!scope.promptData.prompts.credentials.passwords.vault) {
scope.promptData.prompts.credentials.passwords.vault = [];
}
scope.promptData.prompts.credentials.passwords.vault.push(credPassObj);
scope.promptData.prompts.credentials.passwords.vault.push({
id: cred.id,
name: cred.name,
vault_id: cred.inputs.vault_id
});
}
}
};