Skip to content

Commit

Permalink
- Added the repoze.bfg.authentication,
Browse files Browse the repository at this point in the history
  ``repoze.bfg.authorization``, and ``repoze.bfg.interfaces`` modules
  to API documentation.
  • Loading branch information
Chris McDonough committed Dec 23, 2009
1 parent 7c411c4 commit fe96f48
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 27 deletions.
13 changes: 13 additions & 0 deletions docs/api/authentication.rst
@@ -0,0 +1,13 @@
.. _authentication_module:

:mod:`repoze.bfg.authentication`
--------------------------------

.. automodule:: repoze.bfg.authentication

.. autoclass:: AuthTktAuthenticationPolicy

.. autoclass:: RepozeWho1AuthenticationPolicy

.. autoclass:: RemoteUserAuthenticationPolicy

9 changes: 9 additions & 0 deletions docs/api/authorization.rst
@@ -0,0 +1,9 @@
.. _authorization_module:

:mod:`repoze.bfg.authorization`
-------------------------------

.. automodule:: repoze.bfg.authorization

.. autoclass:: ACLAuthorizationPolicy

16 changes: 16 additions & 0 deletions docs/api/interfaces.rst
@@ -0,0 +1,16 @@
.. _interfaces_module:

:mod:`repoze.bfg.interfaces`
----------------------------

.. automodule:: repoze.bfg.interfaces

.. autoclass:: IAfterTraversal

.. autoclass:: INewRequest

.. autoclass:: INewResponse

.. autoclass:: IWSGIApplicationCreatedEvent


60 changes: 33 additions & 27 deletions docs/narr/startup.rst
Expand Up @@ -4,7 +4,9 @@ Startup
=======

When you cause :mod:`repoze.bfg` to start up in a console window,
you'll see something much like this show up on the console::
you'll see something much like this show up on the console:

.. code-block:: bash
$ paster serve myproject/MyProject.ini
Starting server in PID 16601.
Expand Down Expand Up @@ -65,11 +67,11 @@ press ``return`` after running ``paster serve MyProject.ini``.
constructor is meant to return a :term:`router` instance, which is
a :term:`WSGI` application.

For ``repoze.bfg`` applications, the constructor will be a function
named ``app`` in the ``run.py`` file within the :term:`package` in
which your application lives. If this function succeeds, it will
return a :mod:`repoze.bfg` :term:`router` instance. Here's the
contents of an example ``run.py`` module:
For :mod:`repoze.bfg` applications, the constructor will be a
function named ``app`` in the ``run.py`` file within the
:term:`package` in which your application lives. If this function
succeeds, it will return a :mod:`repoze.bfg` :term:`router`
instance. Here's the contents of an example ``run.py`` module:

.. literalinclude:: MyProject/myproject/run.py
:linenos:
Expand Down Expand Up @@ -106,8 +108,9 @@ press ``return`` after running ``paster serve MyProject.ini``.
Note that the ``app`` function imports the ``get_root`` :term:`root
factory` function from the ``myproject.models`` Python module.

#. The ``app`` function first constructs a :term:`Configurator`,
passing ``get_root`` to it as its ``root_factory`` argument, and
#. The ``app`` function first constructs a
:class:`repoze.bfg.configuration.Configurator` instance, passing
``get_root`` to it as its ``root_factory`` argument, and
``settings`` dictionary captured via the ``**settings`` kwarg as
its ``settings`` argument.

Expand All @@ -121,25 +124,28 @@ press ``return`` after running ``paster serve MyProject.ini``.
something like ``{'reload_templates':'true',
'debug_authorization':'false', 'debug_notfound':'false'}``.

#. The ``app`` function then calls the ``load_zcml`` method of the
configurator instance, passing in a ``zcml_file`` value.
``zcml_file`` is the value of the ``configure_zcml`` setting or a
default of ``configure.zcml``. This filename is relative to the
run.py file that the ``app`` function lives in. The ``load_zcml``
function processes each :term:`ZCML declaration` in the ZCML file
implied by the ``zcml_file`` argument. If ``load_zcml`` fails to
parse the ZCML file (or any file which is included by the ZCML
file), a ``XMLConfigurationError`` is raised. If it succeeds, an
:term:`application registry` is populated using all the :term:`ZCML
declaration` statements present in the file.

#. The ``make_wsgi_app`` method of the configurator is called. The
result is a :term:`router` instance. The router is associated with
the :term:`application registry` implied by the configurator
previously populated by ZCML. The router is a WSGI application.

#. A ``WSGIApplicationCreatedEvent`` event is emitted (see
:ref:`events_chapter` for more information about events).
#. The ``app`` function then calls the
:meth:`repoze.bfg.configuration.Configurator.load_zcml` method,
passing in a ``zcml_file`` value. ``zcml_file`` is the value of
the ``configure_zcml`` setting or a default of ``configure.zcml``.
This filename is relative to the run.py file that the ``app``
function lives in. The ``load_zcml`` function processes each
:term:`ZCML declaration` in the ZCML file implied by the
``zcml_file`` argument. If ``load_zcml`` fails to parse the ZCML
file (or any file which is included by the ZCML file), a
``XMLConfigurationError`` is raised and processing ends. If it
succeeds, an :term:`application registry` is populated using all
the :term:`ZCML declaration` statements present in the file.

#. The :meth:`repoze.bfg.configuration.Configurator.make_wsgi_app`
method is called. The result is a :term:`router` instance. The
router is associated with the :term:`application registry` implied
by the configurator previously populated by ZCML. The router is a
WSGI application.

#. A :class:`repoze.bfg.interfaces.WSGIApplicationCreatedEvent` event
is emitted (see :ref:`events_chapter` for more information about
events).

#. Assuming there were no errors, the ``app`` function in
``myproject`` returns the router instance created by
Expand Down

0 comments on commit fe96f48

Please sign in to comment.