diff options
| author | Chris McDonough <chrism@agendaless.com> | 2009-10-23 20:02:14 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2009-10-23 20:02:14 +0000 |
| commit | 839ea015f9bc8c8096107e700a42bb872e9dc0c8 (patch) | |
| tree | b93b7a9ae7fc3842f633c254740a5ce7f6208e53 /repoze/bfg/tests/test_router.py | |
| parent | 9cb00f863f0c23f00f232b495c6829a9adda8432 (diff) | |
| download | pyramid-839ea015f9bc8c8096107e700a42bb872e9dc0c8.tar.gz pyramid-839ea015f9bc8c8096107e700a42bb872e9dc0c8.tar.bz2 pyramid-839ea015f9bc8c8096107e700a42bb872e9dc0c8.zip | |
- Added ``max_age`` parameter to ``authtktauthenticationpolicy`` ZCML
directive. If this value is set, it must be an integer representing
the number of seconds which the auth tkt cookie will survive.
Mainly, its existence allows the auth_tkt cookie to survive across
browser sessions.
- The ``reissue_time`` argument to the ``authtktauthenticationpolicy``
ZCML directive now actually works. When it is set to an integer
value, an authticket set-cookie header is appended to the response
whenever a request requires authentication and 'now' minus the
authticket's timestamp is greater than ``reissue_time`` seconds.
- The router now checks for a ``global_response_headers`` attribute of
the request object before returning a response. If this value
exists, it is presumed to be a sequence of two-tuples, representing
a set of headers to append to the 'normal' response headers. This
feature is internal, rather than exposed internally, because it's
unclear whether it will stay around in the long term. It was added
to support the ``reissue_time`` feature of the authtkt
authentication policy.
- The ``authtkt`` authentication policy ``remember`` method now no
longer honors ``token`` or ``userdata`` keyword arguments.
Diffstat (limited to 'repoze/bfg/tests/test_router.py')
| -rw-r--r-- | repoze/bfg/tests/test_router.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/repoze/bfg/tests/test_router.py b/repoze/bfg/tests/test_router.py index 76b33d204..9306640b4 100644 --- a/repoze/bfg/tests/test_router.py +++ b/repoze/bfg/tests/test_router.py @@ -391,6 +391,27 @@ class TestRouter(unittest.TestCase): response = router(environ, start_response) self.assertEqual(start_response.status, '201 Created') + def test_call_request_has_global_response_headers(self): + from zope.interface import Interface + from zope.interface import directlyProvides + class IContext(Interface): + pass + from repoze.bfg.interfaces import IRequest + context = DummyContext() + directlyProvides(context, IContext) + self._registerTraverserFactory(context, subpath=['']) + response = DummyResponse('200 OK') + response.headerlist = [('a', 1)] + view = DummyView(response) + environ = self._makeEnviron() + environ['webob.adhoc_attrs'] = {'global_response_headers':[('b', 2)]} + self._registerView(view, '', IContext, IRequest) + router = self._makeOne() + start_response = DummyStartResponse() + response = router(environ, start_response) + self.assertEqual(start_response.status, '200 OK') + self.assertEqual(start_response.headers, [('a', 1), ('b', 2)]) + def test_call_eventsends(self): context = DummyContext() self._registerTraverserFactory(context) |
