summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2009-10-31- Explicitly revert the feature introduced in 1.1a8: where the nameChris McDonough
``root`` is available as an attribute of the request before a NewRequest event is emitted. This makes some potential future features impossible, or at least awkward (such as grouping traversal and view lookup into a single adapter lookup).
2009-10-30Update documentation after root factory changes.Chris McDonough
2009-10-30(no commit message)Chris McDonough
2009-10-30- The ``__call__`` of a plugin "traverser" implementation (registeredChris McDonough
as an adapter for ``ITraverser`` or ``ITraverserFactory``) will now receive a *request* as the single argument to its ``__call__`` method. In previous versions it was passed a WSGI ``environ`` object. The request object passed to the factory implements dictionary-like methods in such a way that existing traverser code which expects to be passed an environ will continue to work. - Fix docs.
2009-10-30FeaturesChris McDonough
-------- - In previous versions of BFG, the "root factory" (the ``get_root`` callable passed to ``make_app`` or a function pointed to by the ``factory`` attribute of a route) was called with a "bare" WSGI environment. In this version, and going forward, it will be called with a ``request`` object. The request object passed to the factory implements dictionary-like methods in such a way that existing root factory code which expects to be passed an environ will continue to work. Internal -------- - The request implements dictionary-like methods that mutate and query the WSGI environ. This is only for the purpose of backwards compatibility with root factories which expect an ``environ`` rather than a request. - The ``repoze.bfg.request.create_route_request_factory`` function, which returned a request factory was removed in favor of a ``repoze.bfg.request.route_request_interface`` function, which returns an interface. - The ``repoze.bfg.request.Request`` class, which is a subclass of ``webob.Request`` now defines its own ``__setattr__``, ``__getattr__`` and ``__delattr__`` methods, which override the default WebOb behavior. The default WebOb behavior stores attributes of the request in ``self.environ['webob.adhoc_attrs']``, and retrieves them from that dictionary during a ``__getattr__``. This behavior was undesirable for speed and "expectation" reasons. Now attributes of the ``request`` are stored in ``request.__dict__`` (as you otherwise might expect from an object that did not override these methods). - Reverse the order in which the router calls the request factory and the root factory. The request factory is now called first; the resulting request is passed to the root factory. - The ``repoze.bfg.request.request_factory`` function has been removed. Its functionality is no longer required. - The "routes root factory" that wraps the default root factory when there are routes mentioned in the configuration now attaches an interface to the request via ``zope.interface.directlyProvides``. This replaces logic in the (now-gone) ``repoze.bfg.request.request_factory`` function. - The ``route`` and ``view`` ZCML directives now register an interface as a named utility (retrieved from ``repoze.bfg.request.route_request_interface``) rather than a request factory (the previous return value of the now-missing ``repoze.bfg.request.create_route_request_factory``.
2009-10-30Normalize level param.Chris McDonough
2009-10-29- The ``repoze.bfg.request.Request`` class, which is a subclass ofChris McDonough
``webob.Request`` now defines its own ``__setattr__``, ``__getattr__`` and ``__delattr__`` methods, which override the default WebOb behavior. The default WebOb behavior stores attributes of the request in ``self.environ['webob.adhoc_attrs']``, and retrieves them from that dictionary during a ``__getattr__``. This behavior was undesirable for speed and "expectation" reasons. Now attributes of the ``request`` are stored in ``request.__dict__`` (as you otherwise might expect from an object that did not override these methods). - The router no longer calls ``repoze.bfg.traversal._traverse`` and does its work "inline" (speed).
2009-10-29- An incorrect ZCML conflict would be encountered when theChris McDonough
``request_param`` predicate attribute was used on the ZCML ``view`` directive if any two otherwise same-predicated views had the combination of a predicate value with an ``=`` sign and one without (e.g. ``a`` vs. ``a=123``).
2009-10-28Prep for 1.1a8.Chris McDonough
2009-10-26Readd backward compat for ITraverserFactory -> ITraverser change.Chris McDonough
2009-10-26Revert 6873, as it introduces an unnecessary providedBy for each request in ↵Chris McDonough
the 99% case, and its behavior can be emulated by returning a root object that implements some interface and registering a traverser for that interface.
2009-10-26The root factory may now return an object which implements ``ITraverser`` ↵Malthe Borch
directly. In this case, no adaptation is done before traversal. This feature is added such that a routes factory can implement its own traversal logic without establishing an artificial context only to get a hook into the traversal machinery.
2009-10-26Adapt to ``ITraverser`` instead of ``ITraverserFactory``. While this change ↵Malthe Borch
breaks backwards compatibility, migration is trivial.
2009-10-26Dead code.Chris McDonough
2009-10-26Refactor; the ``_traverse`` is only used internally; the ``traverser`` ↵Malthe Borch
argument is never used. Note that this refactoring does away with a surplus traverser factory lookup.
2009-10-24(no commit message)Chris McDonough
2009-10-24Ahem.Chris McDonough
2009-10-23Remove 'Respond' exception (its addition would be purely speculative: we ↵Chris McDonough
solved the reissue_time authentication policy issue a different way).
2009-10-23- Added ``max_age`` parameter to ``authtktauthenticationpolicy`` ZCMLChris McDonough
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.
2009-10-22Maintain weight so it influences view lookup ordering.Chris McDonough
2009-10-22(no commit message)Chris McDonough
2009-10-22It's an envvar.Chris McDonough
2009-10-22It's an envvar.Chris McDonough
2009-10-22Added ``path_info`` predicate (regex-filters on the corresponding HTTP header).Malthe Borch
2009-10-22We already have a reference to the environ.Chris McDonough
2009-10-21- Change how ``bfg_view`` decorator works when used as a class methodChris McDonough
decorator. In 1.1a7, it actually tried to grope every class in scanned package at startup time looking for methods, which led to some strange symptoms (e.g. ``AttributeError: object has no attribute __provides__``). Now, instead of groping methods at startup time, we just cause the ``bfg_view`` decorator itself to populate its class' __dict__ when its used inside a class as a method decorator. This is essentially a reversion back to 1.1a6 "grokking" behavior plus some special magic for using the ``bfg_view`` decorator as method decorator inside the ``bfg_view`` class itself.
2009-10-21- Fix bug encountered during "scan" (when ``<scan ..>`` directive isChris McDonough
used in ZCML) introduced in 1.1a7. Symptom: ``AttributeError: object has no attribute __provides__`` raised at startup time.
2009-10-21- The name ``root`` is available as an attribute of the requestChris McDonough
slightly earlier now (before a NewRequest event is emitted). ``root`` is the result of the application "root factory".
2009-10-21Add Respond exception.Chris McDonough
2009-10-21Handle no old cookie case.Chris McDonough
2009-10-20- Re-issue authentication ticket if the cookie has expired when usingChris McDonough
``repoze.bfg.security.remember`` when the ``authtktauthenticationpolicy`` authentication policy is in effect. (Patch from Andreas Zeidler).
2009-10-20(no commit message)Chris McDonough
2009-10-20(no commit message)Chris McDonough
2009-10-20- Fix route_url documentation (``_query`` argument documented asChris McDonough
``query`` and ``_anchor`` argument documented as ``anchor``).
2009-10-19Note.Chris McDonough
2009-10-19- Add ``repoze.bfg.testing.registerSettings`` API, which is documentedChris McDonough
in the "repoze.bfg.testing" API chapter. This allows for registration of "settings" values obtained via ``repoze.bfg.settings.get_settings()`` for use in unit tests.
2009-10-19- ``paster bfgshell`` now supports IPython if it's available forChris McDonough
import. Thanks to Daniel Holth for the initial patch.
2009-10-19Refer to webob chapter in glossary.Chris McDonough
2009-10-19Better disambiguation of predicate vs. non-predicate attributes.Chris McDonough
2009-10-19- Call out predicate attributes of ZCML directive within "Views"Chris McDonough
chapter.
2009-10-19- Add a chapter titled "Request and Response" to the narrativeChris McDonough
documentation, content cribbed from the WebOb documentation.
2009-10-19Prep for 1.1a7.Chris McDonough
2009-10-19(no commit message)Chris McDonough
2009-10-19(no commit message)Chris McDonough
2009-10-19Organize into separate authentication and authorization sections.Chris McDonough
2009-10-18Add filesystem analogy.Chris McDonough
2009-10-18Renderings.Chris McDonough
2009-10-18- Added ``Changing the Traverser`` and ``Changing HowChris McDonough
:mod:`repoze.bfg.url.model_url` Generates a URL`` to the "Hooks" narrative chapter of the docs.
2009-10-18Renames.Chris McDonough
2009-10-18Comment.Chris McDonough