summaryrefslogtreecommitdiff
path: root/docs/narr/hooks.rst
AgeCommit message (Collapse)Author
2009-11-22Rendering tweaks.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-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-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-10- The ``notfound`` and ``forbidden`` ZCML directives now accept theChris McDonough
following addtional attributes: ``attr``, ``renderer``, and ``wrapper``. These have the same meaning as they do in the context of a ZCML ``view`` directive.
2009-07-05Spellcheck.Chris McDonough
2009-07-03General editing walkthrough.Chris McDonough
2009-07-02- Added a "Resources" chapter to the narrative documentation whichChris McDonough
explains how to override resources within one package from another package.
2009-06-30- Add a ``reload_resources`` configuration file setting (aka theChris McDonough
``BFG_RELOAD_RESOURCES`` environment variable). When this is set to true, the server never needs to be restarted when moving files between directory resource overrides (esp. for templates currently). - Add a ``reload_all`` configuration file setting (aka the ``BFG_RELOAD_ALL`` environment variable) that implies both ``reload_resources`` and ``reload_templates``. - The ``static`` helper view class now uses a ``PackageURLParser`` in order to allow for the overriding of static resources (CSS / logo files, etc) using the ``resource`` ZCML directive. The ``PackageURLParser`` class was added to a (new) ``static`` module in BFG; it is a subclass of the ``StaticURLParser`` class in ``paste.urlparser``. - The ``repoze.bfg.templating.renderer_from_cache`` function now checks for the ``reload_resources`` setting; if it's true, it does not register a template renderer (it won't use the registry as a template renderer cache). - Add ``pkg_resources`` to the glossary. - Update the "Environment" docs to note the existence of ``reload_resources`` and ``reload_all``. - Use a colon instead of a tab as the separator between package name and relpath to form the "spec" when register a ITemplateRenderer.
2009-06-29Minimal docs for ``resource`` directive.Chris McDonough
2009-06-29Add to docs.Chris McDonough
2009-06-18IForbiddenView utility registration -> forbidden directiveChris McDonough
INotFoundView utility registry -> notfound directive
2009-06-11Merge unifyroutesandtraversal branch into trunkChris McDonough
2009-06-01Add headers.Chris McDonough
2009-05-31FeaturesChris McDonough
-------- - It is now possible to register a custom ``repoze.bfg.interfaces.INotFoundView`` for a given application. This feature replaces the ``repoze.bfg.interfaces.INotFoundAppFactory`` feature previously described in the Hooks chapter. The INotFoundView will be called when the framework detects that a view lookup done as a result of a reqest fails; it should accept a context object and a request object; it should return an IResponse object (a webob response, basically). See the Hooks narrative chapter of the BFG docs for more info. Deprecations ------------ - The ``repoze.bfg.interfaces.IUnauthorizedAppFactory`` interface has been deprecated in favor of using the new ``repoze.bfg.interfaces.IForbiddenResponseFactory`` mechanism.
2009-05-31- Renamed ``repoze.bfg.interfaces.IForbiddenResponseFactory`` toChris McDonough
``repoze.bfg.interfaces.IForbiddenView``.
2009-05-27Merge authchanges branch to trunk.Chris McDonough
2009-05-26Revert all work towards creating a "forbidden" API on the security policy; ↵Chris McDonough
I'll do this work on the authchanges branch first.
2009-05-25IForbiddenAppFactory -> IForbiddenResponseFactory.Chris McDonough
2009-05-25Change the semantics of IForbiddenAppFactory.Chris McDonough
2009-05-24FeaturesChris McDonough
-------- - It is now possible to write a custom security policy that returns a customized ``Forbidden`` WSGI application when BFG cannot authorize an invocation of a view. To this end, ISecurityPolicy objects must now have a ``forbidden`` method. This method should return a WSGI application. The returned WSGI application should generate a response which is appropriate when access to a view resource was forbidden by the security policy (e.g. perhaps a login page). ``repoze.bfg`` is willing to operate with a custom security policy that does not have a ``forbidden`` method, but it will issue a warning; eventually security policies without a ``forbidden`` method will cease to work under ``repoze.bfg``. Note that the ``forbidden`` WSGI application returned by the security policy is not used if a developer has registered an IForbiddenAppFactory (see the "Hooks" narrative chapter); the explicitly registered IForbiddenAppFactory will be preferred over the (more general) security policy forbidden app factory. - All default security policies now have a ``forbidden`` callable attached to them. This particular callable returns a WSGI application which generates a ``401 Unauthorized`` response for backwards compatibility (had backwards compatibility not been an issue, this callable would have returned a WSGI app that generated a ``403 Forbidden`` response). Backwards Incompatibilities --------------------------- - Custom NotFound and Forbidden (nee' Unauthorized) WSGI applications (registered a a utility for INotFoundAppFactory and IUnauthorizedAppFactory) could rely on an environment key named ``message`` describing the circumstance of the response. This key has been renamed to ``repoze.bfg.message`` (as per the WSGI spec, which requires environment extensions to contain dots). Deprecations ------------ - The ``repoze.bfg.interfaces.IUnauthorizedAppFactory`` interface has been renamed to ``repoze.bfg.interfaces.IForbiddenAppFactory``.
2009-05-16Speed up common case (use default factory).Chris McDonough
2009-01-25- You can now override the NotFound and Unauthorized responses thatChris McDonough
:mod:`repoze.bfg` generates when a view cannot be found or cannot be invoked due to lack of permission. See the "ZCML Hooks" chapter in the docs for more information. - Use a homegrown Unauthorized error instead of ``webob.exc.Unauthorized`` (the latter is slow). - Various speed micro-tweaks.
2009-01-21Document after Rob had trouble.Chris McDonough
2009-01-16- Add a section on "Using BFG Security With URL Dispatch" into theChris McDonough
urldispatch chapter of the documentation. Clean up "BFG" vernacular (replace with repoze.bfg).
2009-01-15- Instead of invariably using ``webob.Request`` as the "requestChris McDonough
factory" (e.g. in the ``Router`` class) and ``webob.Response`` and the "response factory" (e.g. in ``render_template_to_response``), allow both to be overridden via a ZCML utility hook. See the "Using ZCML Hooks" chapter of the documentation for more information.