跳转到主要内容

将CubicWeb集成到Pyramid应用程序中。

项目描述

pyramid_cubicweb 是将 CubicWebPyramid 网络应用程序集成的一种特定方式。

功能

  • 提供默认路由,允许cubicweb实例处理请求。

用法

使用时,在您的Python环境中安装 pyramid_cubicweb,然后 包含

config.include('pyramid_cubicweb')

配置

需要以下 INI设置/环境变量

  • cubicweb.instance / CW_INSTANCE:cubicweb实例名称

身份验证cookie

当使用 pyramid_cubicweb.auth(CubicWeb AuthTkt身份验证策略,大多数情况下是默认的)时,您可能需要使用标准Pyramid配置来配置这些身份验证策略的行为。您可能需要在您的 pyramid.ini 中进行配置

会话身份验证::

这是一个AuthTktAuthenticationPolicy,您可以通过使用前缀cubicweb.auth.authtkt.session添加配置条目来覆盖默认配置值。默认值是

cubicweb.auth.authtkt.session.hashalg = sha512
cubicweb.auth.authtkt.session.cookie_name = auth_tkt
cubicweb.auth.authtkt.session.timeout = 1200
cubicweb.auth.authtkt.session.reissue_time = 120
cubicweb.auth.authtkt.session.http_only = True
cubicweb.auth.authtkt.session.secure = True
持久性身份验证:

这同样是一个AuthTktAuthenticationPolicy。当启用持久会话时(通常在使用cubicweb-rememberme立方体时)使用它。您可以通过使用前缀cubicweb.auth.authtkt.persistent添加配置条目来覆盖默认配置值。默认值是

cubicweb.auth.authtkt.persistent.hashalg = sha512
cubicweb.auth.authtkt.persistent.cookie_name = pauth_tkt
cubicweb.auth.authtkt.persistent.max_age = 3600*24*30
cubicweb.auth.authtkt.persistent.reissue_time = 3600*24
cubicweb.auth.authtkt.persistent.http_only = True
cubicweb.auth.authtkt.persistent.secure = True

有关更多详细信息,请参阅文档(位于源代码的docs目录中)。

支持者

AWSAWS云计算和安全赞助商DatadogDatadog监控FastlyFastlyCDNGoogleGoogle下载分析MicrosoftMicrosoftPSF赞助商PingdomPingdom监控SentrySentry错误记录StatusPageStatusPage状态页面