diff options
| author | Chris McDonough <chrism@agendaless.com> | 2009-10-20 22:49:53 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2009-10-20 22:49:53 +0000 |
| commit | 6506f3651f5ed483d6852f9419790220b3258bb0 (patch) | |
| tree | 9aad57076df4ef15d9b7895a1a11802b92f7c9a2 /repoze/bfg/tests/test_authentication.py | |
| parent | 20d25a03196a569eba5691cd67c856e6da38f22b (diff) | |
| download | pyramid-6506f3651f5ed483d6852f9419790220b3258bb0.tar.gz pyramid-6506f3651f5ed483d6852f9419790220b3258bb0.tar.bz2 pyramid-6506f3651f5ed483d6852f9419790220b3258bb0.zip | |
- Re-issue authentication ticket if the cookie has expired when using
``repoze.bfg.security.remember`` when the
``authtktauthenticationpolicy`` authentication policy is in effect.
(Patch from Andreas Zeidler).
Diffstat (limited to 'repoze/bfg/tests/test_authentication.py')
| -rw-r--r-- | repoze/bfg/tests/test_authentication.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/repoze/bfg/tests/test_authentication.py b/repoze/bfg/tests/test_authentication.py index 12ecb6b16..9420df1a1 100644 --- a/repoze/bfg/tests/test_authentication.py +++ b/repoze/bfg/tests/test_authentication.py @@ -528,6 +528,14 @@ class TestAuthTktCookieHelper(unittest.TestCase): value) self.failUnless('; Expires=' in value) + def test_remember_reissue_expired_cookie(self): + import time + plugin = self._makeOne('secret', timeout=2, reissue_time=1) + old_val = self._makeTicket(userid='userid', time=time.time()-3) + request = self._makeRequest({'HTTP_COOKIE':'auth_tkt=%s' % old_val}) + result = plugin.remember(request, 'userid', userdata='userdata') + self.failIf(result is None, 'not re-issued?') + def test_forget(self): plugin = self._makeOne('secret') request = self._makeRequest() |
