From e2fc5e8ac9259d37a1f2d9462eec7135b342973b Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Fri, 13 Sep 2013 14:07:22 +0200 Subject: UI for radius proxy https://fedorahosted.org/freeipa/ticket/3369 --- install/ui/doc/categories.json | 1 + install/ui/src/freeipa/app.js | 1 + install/ui/src/freeipa/navigation/menu_spec.js | 2 +- install/ui/src/freeipa/radiusproxy.js | 138 +++++++++++++++++++++++++ install/ui/test/data/ipa_init.json | 3 + ipalib/plugins/internal.py | 3 + 6 files changed, 147 insertions(+), 1 deletion(-) create mode 100644 install/ui/src/freeipa/radiusproxy.js diff --git a/install/ui/doc/categories.json b/install/ui/doc/categories.json index 02487e542..98958a839 100644 --- a/install/ui/doc/categories.json +++ b/install/ui/doc/categories.json @@ -219,6 +219,7 @@ "classes": [ "aci", "otptoken", + "radiusproxy", "user" ] } diff --git a/install/ui/src/freeipa/app.js b/install/ui/src/freeipa/app.js index 05bef374f..69bf2e717 100644 --- a/install/ui/src/freeipa/app.js +++ b/install/ui/src/freeipa/app.js @@ -43,6 +43,7 @@ define([ './netgroup', './otptoken', './policy', + './radiusproxy', './realmdomains', './rule', './selinux', diff --git a/install/ui/src/freeipa/navigation/menu_spec.js b/install/ui/src/freeipa/navigation/menu_spec.js index e531a9f6d..0e206b828 100644 --- a/install/ui/src/freeipa/navigation/menu_spec.js +++ b/install/ui/src/freeipa/navigation/menu_spec.js @@ -134,7 +134,7 @@ var nav = {}; {entity: 'trustconfig'} ] }, - + {entity: 'radiusproxy'}, {entity: 'config'} ]} ] diff --git a/install/ui/src/freeipa/radiusproxy.js b/install/ui/src/freeipa/radiusproxy.js new file mode 100644 index 000000000..375750e52 --- /dev/null +++ b/install/ui/src/freeipa/radiusproxy.js @@ -0,0 +1,138 @@ +/* Authors: + * Petr Vobornik + * + * Copyright (C) 2010 Red Hat + * see file 'COPYING' for use and warranty information + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +define([ + './ipa', + './jquery', + './menu', + './phases', + './reg', + './details', + './search', + './entity', + './dialogs/password' + ], + function(IPA, $, menu, phases, reg) { + +/** + * Radius module + * @class + * @singleton + */ +var radiusproxy = IPA.radiusproxy = {}; + +var make_spec = function() { +return { + name: 'radiusproxy', + enable_test: function() { + return true; + }, + facets: [ + { + $type: 'search', + columns: [ + 'cn', + 'ipatokenradiusserver', + 'ipatokenusermapattribute', + 'description' + ] + }, + { + $type: 'details', + sections: [ + { + name: 'details', + label: '@i18n:objects.radiusproxy.details', + fields: [ + 'cn', + { + $type: 'textarea', + name: 'description' + }, + { + $type: 'multivalued', + name: 'ipatokenradiusserver' // TODO: add validation + }, + 'ipatokenusermapattribute', // TODO: add validation + 'ipatokenradiustimeout', + 'ipatokenradiusretries' + ], + action_panel: { + name: 'radius_actions', + actions: [ + 'password' + ] + } + } + ], + actions: [ + { + $type: 'password', + dialog: { + password_name: 'ipatokenradiussecret' + } + } + ] + } + ], + adder_dialog: { + fields: [ + 'cn', + { + $type: 'multivalued', + name: 'ipatokenradiusserver' + }, + { + $type: 'password', + name: 'ipatokenradiussecret' + }, + { + $type: 'password', + name: 'secret_verify', + label: '@i18n:password.verify_password', + flags: ['no_command'], + required: true, + validators: [{ + $type: 'same_password', + other_field: 'ipatokenradiussecret' + }] + }, + 'ipatokenusermapattribute' + ] + } +};}; + +/** + * Radius specification object + */ +radiusproxy.spec = make_spec(); + +/** + * Register radiusproxy entity + */ +radiusproxy.register = function() { + var e = reg.entity; + e.register({type: 'radiusproxy', spec: radiusproxy.spec}); +}; + +phases.on('registration', radiusproxy.register); + +return radiusproxy; +}); \ No newline at end of file diff --git a/install/ui/test/data/ipa_init.json b/install/ui/test/data/ipa_init.json index 828af9fc3..9002a2009 100644 --- a/install/ui/test/data/ipa_init.json +++ b/install/ui/test/data/ipa_init.json @@ -397,6 +397,9 @@ "type_ipa": "IPA trust", "type_winsync": "Active Directory winsync" }, + "radiusproxy": { + "details": "RADIUS Proxy Server Settings" + }, "realmdomains": { "identity": "Realm Domains", "check_dns": "Check DNS", diff --git a/ipalib/plugins/internal.py b/ipalib/plugins/internal.py index 1e2cec342..92a79840c 100644 --- a/ipalib/plugins/internal.py +++ b/ipalib/plugins/internal.py @@ -532,6 +532,9 @@ class i18n_messages(Command): "type_ipa": _("IPA trust"), "type_winsync": _("Active Directory winsync"), }, + "radiusproxy": { + "details": _("RADIUS Proxy Server Settings"), + }, "realmdomains": { "identity": _("Realm Domains"), "check_dns": _("Check DNS"), -- cgit