diff options
author | Simo Sorce <simo@redhat.com> | 2014-10-05 14:00:25 -0400 |
---|---|---|
committer | Patrick Uiterwijk <puiterwijk@redhat.com> | 2014-10-06 19:53:22 +0200 |
commit | 7605a4263263fb399176a0d9eea49ab7ecc81274 (patch) | |
tree | 47e2d9ae4de53ef6504ba438a5b2d2d6f9a3e08f /ipsilon/util/trans.py | |
parent | dfd9e00ff07ebbf1c3e4d9ef525ba38e2e96739e (diff) | |
download | ipsilon-7605a4263263fb399176a0d9eea49ab7ecc81274.tar.gz ipsilon-7605a4263263fb399176a0d9eea49ab7ecc81274.tar.xz ipsilon-7605a4263263fb399176a0d9eea49ab7ecc81274.zip |
Fix transaction handling in providers
When a provider redirects to the login code, it must retain 'ownership'
of the transaction, otherwise the login code will wipe the transaction
data as sson as the authentication is completed but before the provider
has completed its part of the transaction.
Make sure the transaction code retrieves the 'owner' from the data for
pre-existing transactions.
Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Diffstat (limited to 'ipsilon/util/trans.py')
-rwxr-xr-x | ipsilon/util/trans.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ipsilon/util/trans.py b/ipsilon/util/trans.py index 4d2f887..8208d4a 100755 --- a/ipsilon/util/trans.py +++ b/ipsilon/util/trans.py @@ -15,7 +15,6 @@ TRANSID = "ipsilon_transaction_id" class Transaction(Log): def __init__(self, provider, **kwargs): - self.debug('Transaction: %s' % repr(kwargs)) self.provider = provider self.transaction_id = None self._ts = TranStore() @@ -23,14 +22,17 @@ class Transaction(Log): tid = kwargs.get(TRANSID) if tid: self.transaction_id = tid - data = self._ts.get_unique_data(TRANSTABLE, tid) + data = self.retrieve() + if data and 'provider' in data: + self.provider = data['provider'] self._get_cookie() else: data = {'provider': self.provider, 'origintime': str(datetime.now())} self.transaction_id = self._ts.new_unique_data(TRANSTABLE, data) self._set_cookie() - self.debug('Transaction id: %s' % self.transaction_id) + self.debug('Transaction: %s %s' % (self.provider, + self.transaction_id)) def _set_cookie(self): self.cookie = SecureCookie(name=None, value=self.provider) |