pyramid_cubicweb/auth.py
changeset 11537 caf268942436
parent 11533 4ced3782b90f
child 11561 25d93d14f8b6
equal deleted inserted replaced
11536:6618408c0629 11537:caf268942436
    16     The update is done in the 'remember' method, which is called on login,
    16     The update is done in the 'remember' method, which is called on login,
    17     and each time the authentication ticket is reissued.
    17     and each time the authentication ticket is reissued.
    18 
    18 
    19     Meaning, the last_login_time is updated reissue_time seconds (maximum)
    19     Meaning, the last_login_time is updated reissue_time seconds (maximum)
    20     before the last request by the user.
    20     before the last request by the user.
       
    21 
       
    22     Usually used via :func:`includeme`.
    21     """
    23     """
    22 
    24 
    23     def remember(self, request, principal, **kw):
    25     def remember(self, request, principal, **kw):
    24         headers = super(CubicWebAuthTktAuthenticationPolicy, self).remember(
    26         headers = super(CubicWebAuthTktAuthenticationPolicy, self).remember(
    25             request, principal, **kw)
    27             request, principal, **kw)
    35             log.exception("Failed to update last_login_time")
    37             log.exception("Failed to update last_login_time")
    36         return headers
    38         return headers
    37 
    39 
    38 
    40 
    39 def includeme(config):
    41 def includeme(config):
       
    42     """ Activate the CubicWeb AuthTkt authentication policy.
       
    43 
       
    44     Usually called via ``config.include('pyramid_cubicweb.auth')``.
       
    45 
       
    46     See also :ref:`defaults_module`
       
    47     """
    40     secret = config.registry['cubicweb.config']['pyramid-auth-secret']
    48     secret = config.registry['cubicweb.config']['pyramid-auth-secret']
    41 
    49 
    42     if not secret:
    50     if not secret:
    43         secret = 'notsosecret'
    51         secret = 'notsosecret'
    44         warnings.warn('''
    52         warnings.warn('''