Handle properly the '/https/*' urls
CW uses a url prefix to detect https behing a reverse-proxy.
A more proper way to do that is documented here in the waitress documentation
(waitress is the default pyramid wsgi server):
https://waitress.readthedocs.org/en/latest/#using-behind-a-reverse-proxy
A later version should implement this, or use waitress in the 'pyramid'
command.
Related to #4291181
from pyramid.authentication import SessionAuthenticationPolicy
from pyramid.authorization import ACLAuthorizationPolicy
from pyramid.session import SignedCookieSessionFactory
from pyramid_cubicweb.core import get_principals
def includeme(config):
config.set_session_factory(
SignedCookieSessionFactory(
secret=config.registry.settings['session.secret']
))
config.set_authentication_policy(
SessionAuthenticationPolicy(callback=get_principals))
config.set_authorization_policy(ACLAuthorizationPolicy())
config.include('pyramid_cubicweb.login')