README.pyramid.rst
changeset 11631 faf279e33298
parent 11621 5747d4c2e083
child 11681 b23d58050076
equal deleted inserted replaced
11478:1817f8946c22 11631:faf279e33298
       
     1 
       
     2 pyramid_cubicweb_ is one specific way of integrating CubicWeb_ with a
       
     3 Pyramid_ web application.
       
     4 
       
     5 Features
       
     6 ========
       
     7 
       
     8 * provides a default route that let a cubicweb instance handle the request.
       
     9 
       
    10 Usage
       
    11 =====
       
    12 
       
    13 To use, install ``pyramid_cubicweb`` in your python environment, and
       
    14 then include_ the package::
       
    15 
       
    16     config.include('pyramid_cubicweb')
       
    17 
       
    18     
       
    19 Configuration
       
    20 =============
       
    21 
       
    22 Requires the following `INI setting / environment variable`_:
       
    23 
       
    24 * `cubicweb.instance` / `CW_INSTANCE`: the cubicweb instance name
       
    25 
       
    26 Authentication cookies
       
    27 ----------------------
       
    28 
       
    29 When using the `pyramid_cubicweb.auth` (CubicWeb AuthTkt
       
    30 authentication policy), which is the default in most cases, you may
       
    31 have to configure the behaviour of these authentication policies using
       
    32 standard's Pyramid configuration. You may want to configure in your
       
    33 ``pyramid.ini``:
       
    34 
       
    35 :Session Authentication:
       
    36 
       
    37     This is a `AuthTktAuthenticationPolicy`_ so you may overwrite default
       
    38     configuration values by adding configuration entries using the prefix
       
    39     ``cubicweb.auth.authtkt.session``. Default values are:
       
    40 
       
    41     ::
       
    42 
       
    43         cubicweb.auth.authtkt.session.hashalg = sha512
       
    44         cubicweb.auth.authtkt.session.cookie_name = auth_tkt
       
    45         cubicweb.auth.authtkt.session.timeout = 1200
       
    46         cubicweb.auth.authtkt.session.reissue_time = 120
       
    47         cubicweb.auth.authtkt.session.http_only = True
       
    48         cubicweb.auth.authtkt.session.secure = True
       
    49 
       
    50 
       
    51 :Persistent Authentication:
       
    52 
       
    53     This is also a `AuthTktAuthenticationPolicy`_. It is used when persistent
       
    54     sessions are activated (typically when using the cubicweb-rememberme_
       
    55     cube). You may overwrite default configuration values by adding
       
    56     configuration entries using the prefix
       
    57     ``cubicweb.auth.authtkt.persistent``. Default values are:
       
    58 
       
    59     ::
       
    60 
       
    61         cubicweb.auth.authtkt.persistent.hashalg = sha512
       
    62         cubicweb.auth.authtkt.persistent.cookie_name = pauth_tkt
       
    63         cubicweb.auth.authtkt.persistent.max_age = 3600*24*30
       
    64         cubicweb.auth.authtkt.persistent.reissue_time = 3600*24
       
    65         cubicweb.auth.authtkt.persistent.http_only = True
       
    66         cubicweb.auth.authtkt.persistent.secure = True
       
    67 
       
    68 
       
    69 .. Warning:: Legacy timeout values from the instance's
       
    70              ``all-in-one.conf`` are **not** used at all (``
       
    71              http-session-time`` and ``cleanup-session-time``)
       
    72 
       
    73 Please refer to the documentation_ for more details (available in the
       
    74 ``docs`` directory of the source code).
       
    75 
       
    76 .. _pyramid_cubicweb: https://www.cubicweb.org/project/pyramid-cubicweb
       
    77 .. _CubicWeb: https://www.cubicweb.org/
       
    78 .. _`cubicweb-rememberme`: \
       
    79     https://www.cubicweb.org/project/cubicweb-rememberme
       
    80 .. _Pyramid: http://pypi.python.org/pypi/pyramid
       
    81 .. _include: http://docs.pylonsproject.org/projects/pyramid/en/latest/api/config.html#pyramid.config.Configurator.include
       
    82 .. _`INI setting / environment variable`: http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html#adding-a-custom-setting
       
    83 .. _documentation: http://pyramid-cubicweb.readthedocs.org/
       
    84 .. _AuthTktAuthenticationPolicy: \
       
    85     http://docs.pylonsproject.org/projects/pyramid/en/latest/api/authentication.html#pyramid.authentication.AuthTktAuthenticationPolicy