1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 06:51:10 +03:00

tacacs ui implementation

This commit is contained in:
John Mitchell 2017-05-01 15:27:30 -04:00
parent 932f53b2ea
commit 1a96e20a07
5 changed files with 99 additions and 0 deletions

View File

@ -18,6 +18,7 @@ export default [
'configurationGoogleForm', 'configurationGoogleForm',
'configurationLdapForm', 'configurationLdapForm',
'configurationRadiusForm', 'configurationRadiusForm',
'configurationTacacsForm',
'configurationSamlForm', 'configurationSamlForm',
'ConfigurationService', 'ConfigurationService',
'ConfigurationUtils', 'ConfigurationUtils',
@ -39,6 +40,7 @@ export default [
configurationGoogleForm, configurationGoogleForm,
configurationLdapForm, configurationLdapForm,
configurationRadiusForm, configurationRadiusForm,
configurationTacacsForm,
configurationSamlForm, configurationSamlForm,
ConfigurationService, ConfigurationService,
ConfigurationUtils, ConfigurationUtils,
@ -107,6 +109,7 @@ export default [
{label: i18n._('Google OAuth2'), value: 'google_oauth'}, {label: i18n._('Google OAuth2'), value: 'google_oauth'},
{label: i18n._('LDAP'), value: 'ldap'}, {label: i18n._('LDAP'), value: 'ldap'},
{label: i18n._('RADIUS'), value: 'radius'}, {label: i18n._('RADIUS'), value: 'radius'},
{label: i18n._('TACACS+'), value: 'tacacs'},
{label: i18n._('SAML'), value: 'saml'} {label: i18n._('SAML'), value: 'saml'}
]; ];
@ -143,6 +146,10 @@ export default [
formDef: configurationRadiusForm, formDef: configurationRadiusForm,
id: 'auth-radius-form', id: 'auth-radius-form',
name: 'radius' name: 'radius'
}, {
formDef: configurationTacacsForm,
id: 'auth-tacacs-form',
name: 'tacacs'
}, { }, {
formDef: configurationSamlForm, formDef: configurationSamlForm,
id: 'auth-saml-form', id: 'auth-saml-form',
@ -258,10 +265,33 @@ export default [
} }
} }
function populateTacacsProtocol(flag){
if($scope.$parent.TACACSPLUS_AUTH_PROTOCOL !== null) {
$scope.$parent.TACACSPLUS_AUTH_PROTOCOL = _.find($scope.$parent.TACACSPLUS_AUTH_PROTOCOL_options, { value: $scope.$parent.TACACSPLUS_AUTH_PROTOCOL });
}
if(flag !== undefined){
dropdownRendered = flag;
}
if(!dropdownRendered) {
dropdownRendered = true;
CreateSelect2({
element: '#configuration_tacacs_template_TACACSPLUS_AUTH_PROTOCOL',
multiple: false,
placeholder: i18n._('Select group types'),
});
}
}
$scope.$on('AUTH_LDAP_GROUP_TYPE_populated', function(e, data, flag) { $scope.$on('AUTH_LDAP_GROUP_TYPE_populated', function(e, data, flag) {
populateLDAPGroupType(flag); populateLDAPGroupType(flag);
}); });
$scope.$on('TACACSPLUS_AUTH_PROTOCOL_populated', function(e, data, flag) {
populateTacacsProtocol(flag);
});
$scope.$on('codeMirror_populated', function(e, key) { $scope.$on('codeMirror_populated', function(e, key) {
startCodeMirrors(key); startCodeMirrors(key);
}); });
@ -269,6 +299,7 @@ export default [
$scope.$on('populated', function() { $scope.$on('populated', function() {
startCodeMirrors(); startCodeMirrors();
populateLDAPGroupType(false); populateLDAPGroupType(false);
populateTacacsProtocol(false);
}); });
angular.extend(authVm, { angular.extend(authVm, {

View File

@ -48,6 +48,11 @@
</div> </div>
</div> </div>
<div ng-show="authVm.activeAuthForm === 'tacacs'">
<div id="auth-tacacs-form">
</div>
</div>
<div ng-show="authVm.activeAuthForm === 'saml'"> <div ng-show="authVm.activeAuthForm === 'saml'">
<div id="auth-saml-form"> <div id="auth-saml-form">

View File

@ -0,0 +1,58 @@
/*************************************************
* Copyright (c) 2016 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
export default ['i18n', function(i18n) {
return {
// editTitle: 'Authorization Configuration',
name: 'configuration_tacacs_template',
showActions: true,
showHeader: false,
fields: {
TACACSPLUS_HOST: {
type: 'text',
reset: 'TACACSPLUS_HOST'
},
TACACSPLUS_PORT: {
type: 'text',
reset: 'TACACSPLUS_PORT'
},
TACACSPLUS_SECRET: {
type: 'sensitive',
hasShowInputButton: true,
reset: 'TACACSPLUS_SECRET'
},
TACACSPLUS_SESSION_TIMEOUT: {
type: 'number',
integer: true,
spinner: true,
min: 0,
reset: 'TACACSPLUS_SESSION_TIMEOUT'
},
TACACSPLUS_AUTH_PROTOCOL: {
type: 'select',
reset: 'TACACSPLUS_AUTH_PROTOCOL',
ngOptions: 'protocol.label for protocol in TACACSPLUS_AUTH_PROTOCOL_options track by protocol.value'
}
},
buttons: {
reset: {
ngClick: 'vm.resetAllConfirm()',
label: i18n._('Revert all to default'),
class: 'Form-resetAll'
},
cancel: {
ngClick: 'vm.formCancel()',
},
save: {
ngClick: 'vm.formSave()',
ngDisabled: true
}
}
};
}
];

View File

@ -16,6 +16,7 @@ export default [
'configurationGoogleForm', 'configurationGoogleForm',
'configurationLdapForm', 'configurationLdapForm',
'configurationRadiusForm', 'configurationRadiusForm',
'configurationTacacsForm',
'configurationSamlForm', 'configurationSamlForm',
'systemActivityStreamForm', 'systemActivityStreamForm',
'systemLoggingForm', 'systemLoggingForm',
@ -34,6 +35,7 @@ export default [
configurationGoogleForm, configurationGoogleForm,
configurationLdapForm, configurationLdapForm,
configurationRadiusForm, configurationRadiusForm,
configurationTacacsForm,
configurationSamlForm, configurationSamlForm,
systemActivityStreamForm, systemActivityStreamForm,
systemLoggingForm, systemLoggingForm,
@ -51,6 +53,7 @@ export default [
'google_oauth': configurationGoogleForm, 'google_oauth': configurationGoogleForm,
'ldap': configurationLdapForm, 'ldap': configurationLdapForm,
'radius': configurationRadiusForm, 'radius': configurationRadiusForm,
'tacacs': configurationTacacsForm,
'saml': configurationSamlForm, 'saml': configurationSamlForm,
'activity_stream': systemActivityStreamForm, 'activity_stream': systemActivityStreamForm,
'logging': systemLoggingForm, 'logging': systemLoggingForm,

View File

@ -18,6 +18,7 @@ import configurationGithubTeamForm from './auth-form/sub-forms/auth-github-team.
import configurationGoogleForm from './auth-form/sub-forms/auth-google-oauth2.form'; import configurationGoogleForm from './auth-form/sub-forms/auth-google-oauth2.form';
import configurationLdapForm from './auth-form/sub-forms/auth-ldap.form.js'; import configurationLdapForm from './auth-form/sub-forms/auth-ldap.form.js';
import configurationRadiusForm from './auth-form/sub-forms/auth-radius.form.js'; import configurationRadiusForm from './auth-form/sub-forms/auth-radius.form.js';
import configurationTacacsForm from './auth-form/sub-forms/auth-tacacs.form.js';
import configurationSamlForm from './auth-form/sub-forms/auth-saml.form'; import configurationSamlForm from './auth-form/sub-forms/auth-saml.form';
//system sub-forms //system sub-forms
@ -39,6 +40,7 @@ angular.module('configuration', [])
.factory('configurationGoogleForm', configurationGoogleForm) .factory('configurationGoogleForm', configurationGoogleForm)
.factory('configurationLdapForm', configurationLdapForm) .factory('configurationLdapForm', configurationLdapForm)
.factory('configurationRadiusForm', configurationRadiusForm) .factory('configurationRadiusForm', configurationRadiusForm)
.factory('configurationTacacsForm', configurationTacacsForm)
.factory('configurationSamlForm', configurationSamlForm) .factory('configurationSamlForm', configurationSamlForm)
//system forms //system forms
.factory('systemActivityStreamForm', systemActivityStreamForm) .factory('systemActivityStreamForm', systemActivityStreamForm)