mirror of
https://github.com/ansible/awx.git
synced 2026-03-09 05:29:26 -02:30
Merge pull request #74 from mabashian/7299-pmrun
Fix privilege escalation password label on launch
This commit is contained in:
@@ -292,7 +292,7 @@ export default ['i18n', function(i18n) {
|
|||||||
ngChange: 'becomeMethodChange()',
|
ngChange: 'becomeMethodChange()',
|
||||||
},
|
},
|
||||||
"become_username": {
|
"become_username": {
|
||||||
labelBind: 'becomeUsernameLabel',
|
label: i18n._('Privilege Escalation Username'),
|
||||||
type: 'text',
|
type: 'text',
|
||||||
ngShow: "(kind.value == 'ssh' && (become_method && become_method.value)) ",
|
ngShow: "(kind.value == 'ssh' && (become_method && become_method.value)) ",
|
||||||
|
|
||||||
@@ -302,7 +302,7 @@ export default ['i18n', function(i18n) {
|
|||||||
ngDisabled: '!(credential_obj.summary_fields.user_capabilities.edit || canAdd)'
|
ngDisabled: '!(credential_obj.summary_fields.user_capabilities.edit || canAdd)'
|
||||||
},
|
},
|
||||||
"become_password": {
|
"become_password": {
|
||||||
labelBind: 'becomePasswordLabel',
|
label: i18n._('Privilege Escalation Password'),
|
||||||
type: 'sensitive',
|
type: 'sensitive',
|
||||||
ngShow: "(kind.value == 'ssh' && (become_method && become_method.value)) ",
|
ngShow: "(kind.value == 'ssh' && (become_method && become_method.value)) ",
|
||||||
ngDisabled: "become_password_ask || !(credential_obj.summary_fields.user_capabilities.edit || canAdd)",
|
ngDisabled: "become_password_ask || !(credential_obj.summary_fields.user_capabilities.edit || canAdd)",
|
||||||
|
|||||||
@@ -15,8 +15,6 @@ export default
|
|||||||
break;
|
break;
|
||||||
case 'ssh':
|
case 'ssh':
|
||||||
scope.usernameLabel = i18n._('Username'); //formally 'SSH Username'
|
scope.usernameLabel = i18n._('Username'); //formally 'SSH Username'
|
||||||
scope.becomeUsernameLabel = i18n._('Privilege Escalation Username');
|
|
||||||
scope.becomePasswordLabel = i18n._('Privilege Escalation Password');
|
|
||||||
break;
|
break;
|
||||||
case 'scm':
|
case 'scm':
|
||||||
scope.sshKeyDataLabel = i18n._('SCM Private Key');
|
scope.sshKeyDataLabel = i18n._('SCM Private Key');
|
||||||
|
|||||||
@@ -72,8 +72,6 @@ export default
|
|||||||
break;
|
break;
|
||||||
case 'ssh':
|
case 'ssh':
|
||||||
scope.usernameLabel = i18n._('Username'); //formally 'SSH Username'
|
scope.usernameLabel = i18n._('Username'); //formally 'SSH Username'
|
||||||
scope.becomeUsernameLabel = i18n._('Privilege Escalation Username');
|
|
||||||
scope.becomePasswordLabel = i18n._('Privilege Escalation Password');
|
|
||||||
break;
|
break;
|
||||||
case 'scm':
|
case 'scm':
|
||||||
scope.sshKeyDataLabel = i18n._('SCM Private Key');
|
scope.sshKeyDataLabel = i18n._('SCM Private Key');
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
export default
|
export default
|
||||||
function CheckPasswords(Rest, GetBasePath, ProcessErrors, Empty) {
|
function CheckPasswords(Rest, GetBasePath, ProcessErrors, Empty, credentialTypesLookup) {
|
||||||
return function(params) {
|
return function(params) {
|
||||||
var scope = params.scope,
|
var scope = params.scope,
|
||||||
callback = params.callback,
|
callback = params.callback,
|
||||||
@@ -10,21 +10,25 @@ export default
|
|||||||
Rest.setUrl(GetBasePath('credentials')+credential);
|
Rest.setUrl(GetBasePath('credentials')+credential);
|
||||||
Rest.get()
|
Rest.get()
|
||||||
.success(function (data) {
|
.success(function (data) {
|
||||||
if(data.kind === "ssh"){
|
credentialTypesLookup()
|
||||||
if(data.password === "ASK" ){
|
.then(kinds => {
|
||||||
passwords.push("ssh_password");
|
if(data.credential_type === kinds.Machine && data.inputs){console.log(data.inputs);
|
||||||
}
|
if(data.inputs.password === "ASK" ){
|
||||||
if(data.ssh_key_unlock === "ASK"){
|
passwords.push("ssh_password");
|
||||||
passwords.push("ssh_key_unlock");
|
}
|
||||||
}
|
if(data.inputs.ssh_key_unlock === "ASK"){
|
||||||
if(data.become_password === "ASK"){
|
passwords.push("ssh_key_unlock");
|
||||||
passwords.push("become_password");
|
}
|
||||||
}
|
if(data.inputs.become_password === "ASK"){
|
||||||
if(data.vault_password === "ASK"){
|
passwords.push("become_password");
|
||||||
passwords.push("vault_password");
|
}
|
||||||
}
|
if(data.inputs.vault_password === "ASK"){
|
||||||
}
|
passwords.push("vault_password");
|
||||||
scope.$emit(callback, passwords);
|
}
|
||||||
|
}
|
||||||
|
scope.$emit(callback, passwords);
|
||||||
|
});
|
||||||
|
|
||||||
})
|
})
|
||||||
.error(function (data, status) {
|
.error(function (data, status) {
|
||||||
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
|
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
|
||||||
@@ -39,5 +43,6 @@ CheckPasswords.$inject =
|
|||||||
[ 'Rest',
|
[ 'Rest',
|
||||||
'GetBasePath',
|
'GetBasePath',
|
||||||
'ProcessErrors',
|
'ProcessErrors',
|
||||||
'Empty'
|
'Empty',
|
||||||
|
'credentialTypesLookup'
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user