summaryrefslogtreecommitdiffstats
path: root/ipsilon/admin/common.py
Commit message (Collapse)AuthorAgeFilesLines
* Make SSSD config 'preconfigured' and unmodifiablepreconfSimo Sorce2015-05-061-2/+8
| | | | | | | | Also fail to enable if not pre-configured Fixes #111 Signed-off-by: Simo Sorce <simo@redhat.com>
* Merge the login and info plugins configurationsSimo Sorce2015-04-291-0/+3
| | | | | | | | | | | | Having separate login and info plugins configuration pages doesn't really make a lot of sense. As a first step moving towards login stacks put login and info plugin configuration into a common "Login Stack" menu item. https://fedorahosted.org/ipsilon/ticket/117 Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Rob Crittenden <rcritten@redhat.com>
* Allow scheme to be visible again in admin pagePatrick Uiterwijk2015-04-281-0/+2
| | | | | | | Without this, the browser will refuse to load the scheme. Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com> Reviewed-by: Rob Crittenden <rcritten@redhat.com>
* Rename and move PluginConfig to ConfigHelperRob Crittenden2015-04-101-1/+1
| | | | | | | | | | | The configuration class was originally intended to be tied. At this point it is quite generic and useful outside of plugins. Rename it to something more generic and move it into the config module. https://fedorahosted.org/ipsilon/ticket/25 Signed-off-by: Rob Crittenden <rcritten@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Move mapping and complex list helpers out of classRob Crittenden2015-04-101-146/+148
| | | | | | | | | | This is so other classes which are not an AdminPage can also have access to these helpers. https://fedorahosted.org/ipsilon/ticket/25 Signed-off-by: Rob Crittenden <rcritten@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Print exceptions when saving data fails in admin UIRob Crittenden2015-04-101-2/+4
| | | | | | | | | | | There were places where a broad exception was caught when saving administrative changes but the actual exception wasn't logged. The user was presented only with a 'Failed to save data!' message. https://fedorahosted.org/ipsilon/ticket/39 Signed-off-by: Rob Crittenden <rcritten@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Set Cache-control on all generated pages, centralize in EndpointRob Crittenden2015-03-191-5/+0
| | | | | | | | | | See "Bindings for the OASIS Security Assertion Markup Language (SAML) V2.0" section 3.2.3.2. https://fedorahosted.org/ipsilon/ticket/7 Signed-off-by: Rob Crittenden <rcritten@redhat.com> Reviewed-by: Nathan Kinder <nkinder@redhat.com>
* Handle changing MappingList optionsSimo Sorce2015-02-241-0/+85
| | | | | | | | Add admin function to handle getting a MappingList object in form of key/value pair fields. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Handle changing ComplexList optionsSimo Sorce2015-02-241-0/+67
| | | | | | | | Add admin function to handle getting a ComplexList object in form of key/value pair fields. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Fix file permissions and remove shebang'sPatrick Uiterwijk2014-12-161-2/+0
| | | | | Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Fix svg parsing in mod_wsgiSimo Sorce2014-11-121-1/+1
| | | | | | | | | Whe ipsilon is used behind apache we need to cast the template to a string. Otherwise mod_wsgi returns a TypeError complaining about the fact data is a unicode string instead of a byte string. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Add visual cues to configuration panelsSimo Sorce2014-11-121-12/+19
| | | | | | | | | | | Make it easier to recognize which plugins are enabled and which are disabled. Also make it easier to recognize when a plugin has just changed state, by flashing its row (help also realize it may have moved up/down) Based on concept work by Petr Vobornik Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Use indirection to report error stringsSimo Sorce2014-11-121-11/+16
| | | | | | | This way if CSS/Code changes we have just one place to fix. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Return proper errors if config is read-onlySimo Sorce2014-11-121-9/+41
| | | | | | | | Do not throw 501 errors, instead return warnings that the configuration changes cannot be applied. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Refactor plugin initialization and enablementSimo Sorce2014-11-121-58/+31
| | | | | | | | | | | | Move most plugin enablement and initialization code in plugin.py to reduce code duplication and simplify and unifify plugin enablement for all base plugin types (login, info, providers). This patch breaks backwards compatibility as it changes how the list of enabled plugins is stored in the database tables. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Set newurl on admin actions to stay on the pageSimo Sorce2014-11-121-1/+2
| | | | | | | | | | | By setting newurl, the browser state is replaced with the base configuration URL, so that user actions like hitting reload do not end up trying to trigger another change or an enablement/disablement of a plugin. It also insures actions are not accidentally triggered when hitting the back button. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Refactor plugin configurationSimo Sorce2014-11-121-39/+35
| | | | | | | | | | | | | | | Fork a PluginConfig class out of PluginObject, the base object now supports a simple dictionary config, while using PluginConfig provide access to structured util.config based configuration. Change UI code that deal with plugins configuration to properly use the new structured config objects in order to represent data in appropriate format based on the data type. Use the new util.config objects to represent plugins configuration. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Fix plugins enablement codeSimo Sorce2014-10-271-2/+10
| | | | | Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Add SVG Image to the Home administration pageSimo Sorce2014-10-271-1/+21
| | | | | | | | | This SVG image contain HREF links that are template in jinja to link images/text i the SVG to the menu pages. Clicking on elements of the SVG thus redirects to the relevant menu item. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Update style of plugins config page tooSimo Sorce2014-10-271-10/+9
| | | | | | | | Also fix a bug that would cause the config page to show no fields when saving. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Reuse the AdminPlugins class for the providers tooSimo Sorce2014-10-271-4/+10
| | | | | | | This way we can remove even more duplicated code... \o/ Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Improve UI for enabling/disabling plugins configSimo Sorce2014-10-271-2/+155
| | | | | | | Use the same templates for both info and login plugins Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Do not overwrite default plugin optionsSimo Sorce2014-10-241-25/+24
| | | | | | | | | Change the admin plugin to not overwrite the plugin default options, and only use the sanctioned pluginObject interfaces to read/write config values. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Add auto-auth requirement to all admin pagesSimo Sorce2014-10-071-2/+2
| | | | | | | | | | Instead ofhaving to explicitly decorate all methods with auth_protect() use the fact all pages go through Page.__call__ to conditionally check if the user is anoynous and set a default when instantiating AdminPage so that all admin pages require authentication. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Add AdminPage abstraction on top of util.PageSimo Sorce2014-10-071-2/+13
| | | | | | | | | | This is to allow different default headers between Admin pages and other pages. In particular we set no-caching headers to all admin pages to force browsers to refresh as often as possible. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Redirect anonymous users awaySimo Sorce2014-10-061-1/+2
| | | | | | | | | It makes no sense to let anonymous users interact with the admin pages so tighten up access and redirect away users that have no rights. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Refactor the data store a bitSimo Sorce2014-09-241-4/+1
| | | | | | | | | | | Reduce code duplication, and clearly separates admin and user dbs. Move plugin wrapper away and let plugin code use native functions. This patch also changes the indexed data to use a uuid and assumes 2 identical uuid cannot be created concurrently. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Add Info providers Admin pagesSimo Sorce2014-09-241-1/+2
| | | | | Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Allow plugins to determine config options orderSimo Sorce2014-09-241-1/+16
| | | | | | | | Ordering may also be partial, for any option not specified they will be appended in lexycographic order. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Convert all forms to use util.Page form supportSimo Sorce2014-04-211-7/+1
| | | | | | This way all forms will get Referer checking automaticaly Signed-off-by: Simo Sorce <simo@redhat.com>
* Automatically build configuration page menuSimo Sorce2014-03-281-10/+21
| | | | | | Do not hardcode it, rather build it out of the pages tree. Signed-off-by: Simo Sorce <simo@redhat.com>
* Move login plugin configuration to its own moduleSimo Sorce2014-03-261-104/+16
| | | | | | | move also the template, in preparation for handling other configuration data in the main page. Signed-off-by: Simo Sorce <simo@redhat.com>
* Move admin_protect to a more generic moduleSimo Sorce2014-03-241-12/+1
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* Implement plugin ordering configurationSimo Sorce2014-03-241-0/+75
| | | | | | Allows to change the login plugins order from the admin configuration page. Signed-off-by: Simo Sorce <simo@redhat.com>
* Apply patternfly to administration pagesPetr Vobornik2014-02-171-0/+4
| | | | | Signed-off-by: Petr Vobornik <pvoborni@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Add infrastructure to configure serverSimo Sorce2014-01-241-0/+126
Signed-off-by: Simo Sorce <simo@redhat.com>