diff options
author | Simo Sorce <simo@redhat.com> | 2014-09-10 17:19:55 -0400 |
---|---|---|
committer | Patrick Uiterwijk <puiterwijk@redhat.com> | 2014-09-24 20:51:24 +0200 |
commit | e0895efb26de64a28de7b9219f524b715c396b2b (patch) | |
tree | 06c114093b1ee22c1ed9a68e277666b9a2f3cc44 /ipsilon/util/data.py | |
parent | 9e45a0dda4cfa26b531a423fc8b1c4b10d382a0f (diff) | |
download | ipsilon-e0895efb26de64a28de7b9219f524b715c396b2b.tar.gz ipsilon-e0895efb26de64a28de7b9219f524b715c396b2b.tar.xz ipsilon-e0895efb26de64a28de7b9219f524b715c396b2b.zip |
Add transactions support
In some cases a user may end up having multiple login pags in diffeent tabs in
the borwser (session restore after a crash, or simply opening multiple urls
which all redirect to the same IdP).
Without transactions multiple authentication requests in fly may step on each
other causing potentially all of them to fail to properly authenticate and
redirect back to the original web site.
Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Diffstat (limited to 'ipsilon/util/data.py')
-rwxr-xr-x | ipsilon/util/data.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ipsilon/util/data.py b/ipsilon/util/data.py index bdf93e7..5a144a4 100755 --- a/ipsilon/util/data.py +++ b/ipsilon/util/data.py @@ -348,3 +348,18 @@ class UserStore(Store): def save_user_preferences(self, user, options): return self.save_options('users', user, options) + + +class TranStore(Store): + + def __init__(self, path=None): + if path is None: + self._path = os.getcwd() + else: + self._path = path + self._name = None + if 'transactions.db' in cherrypy.config: + self._name = cherrypy.config['transactions.db'] + if not self._name: + self._name = os.path.join(self._path, 'transactions.sqlite') + super(TranStore, self).__init__(self._name) |