summaryrefslogtreecommitdiffstats
path: root/ipsilon/util/page.py
Commit message (Collapse)AuthorAgeFilesLines
* Add expiration to Idp metadataSimo Sorce2015-01-291-1/+9
| | | | | | | | Also regenerate it frequently, so that any change in configuration can be automatically reflected in the metadata downloaded my clients over time. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Use referer too as source of transaction IDsSimo Sorce2015-01-161-1/+14
| | | | | | | | | This allows us to use apache module that use things like ErrorDocument directives to do internal redirects and still retain the original transaction intact. 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>
* Allow to call forms from any of the admin pagesSimo Sorce2014-10-271-6/+15
| | | | | Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Handle invalid/expired transactions gracefullySimo Sorce2014-10-241-0/+8
| | | | | | | | | Return a useful error page every time and invalid or expired transaction is requested, instead of ending up with an internal backtrace and an ugly 500 error. 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-10/+4
| | | | | | | | | | 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 way to set default headersSimo Sorce2014-10-071-0/+3
| | | | | | | | When a Page is called automatically sets default headers by adding headers on the default_headers variable. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Add pretty handler for 404Simo Sorce2014-10-071-1/+1
| | | | | Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Fix exposed functionsSimo Sorce2014-10-071-1/+1
| | | | | | | | | | | | The Page util is supposed to intercept and enable exposed pages on its own so that additional functions can be run in the generic __call__ Fix the code to check for the function argument correctly and use a different argument than the standard cherrypy one for admin pages so that we do actually land in the Page.__call__ all the time for those pages. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Redirect anonymous users awaySimo Sorce2014-10-061-0/+10
| | | | | | | | | 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>
* Use new Log class everywhereSimo Sorce2014-08-271-5/+2
| | | | | | | | | Replace copies of _debug function sprinkled all over the code with a single implementation Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com> - Removed replace of self._debug to self.debug
* Add External form auth pluginSimo Sorce2014-08-271-2/+2
| | | | | | | This plugin uses mod_intercept_form_submit to perform authentication. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Rework remote_login and remove protect decoratorSimo Sorce2014-08-271-4/+0
| | | | | | | | | | | | The protect decorator was not really being used for anything, remove it. Change the way UserSession's remote_login() works. If called now it either sets a REMOTE_USER (if found) or nukes the current user data in the session. This means this function can be safely called only in a login plugin now. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Fix referer checks with escaped URLsSimo Sorce2014-05-201-4/+16
| | | | | | | | | | | | | When a SP name included spaces the referer checker would fail to match the url. It would try to return a 403 error, unfortunately this would also trip as a return instead of an exception was used, ending up with a 500 error being returned to the user. Fix url checks by unquoting before comparing. Fix error reporting by rasing an exception when needed instead of returning. Signed-off-by: Simo Sorce <simo@redhat.com>
* Fix E713 with stricter pep8 error checkerSimo Sorce2014-05-201-1/+1
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* Add New form helper to Page objectSimo Sorce2014-04-201-4/+19
| | | | | | | | This removes the need to define a root funciton only to redirect to a GET/POST one. Also adds basic CSRF protection if the page is declared a form. Signed-off-by: Simo Sorce <simo@redhat.com>
* Add common way to add a subtree to a pageSimo Sorce2014-03-281-0/+6
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* Move admin_protect to a more generic moduleSimo Sorce2014-03-241-0/+11
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* Add _debug facility to the Page classSimo Sorce2014-02-241-0/+4
| | | | | | | Use this instead of th misleading "_log" name. These really are just debugging statements not normal logging. Signed-off-by: Simo Sorce <simo@redhat.com>
* Move default template arguments to its own functionSimo Sorce2014-02-241-1/+11
| | | | | | | This way it is clearer what the defaults are, plus subclasses can override the defaults if they so choose. Signed-off-by: Simo Sorce <simo@redhat.com>
* Implement login plugin infrastructureSimo Sorce2014-01-241-16/+10
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* Use pep8 checkPetr Vobornik2014-01-241-0/+2
| | | | | Signed-off-by: Petr Vobornik <pvoborni@redhat.com> Signed-off-by: Simo Sorce <simo@redhat.com>
* Use pylint checkPetr Vobornik2014-01-241-0/+2
| | | | | Signed-off-by: Petr Vobornik <pvoborni@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Fix ImportsSimo Sorce2014-01-241-2/+2
| | | | | | Based on patches by Petr Voborni Signed-off-by: Simo Sorce <simo@redhat.com>
* Rename src package to ipsilonSimo Sorce2014-01-241-0/+60
Signed-off-by: Petr Vobornik <pvoborni@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>