From e0895efb26de64a28de7b9219f524b715c396b2b Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Wed, 10 Sep 2014 17:19:55 -0400 Subject: 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 Reviewed-by: Patrick Uiterwijk --- ipsilon/util/data.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'ipsilon/util/data.py') 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) -- cgit