可插拔认证机制(已废弃)
项目描述
此包提供了可插拔认证工具的原生实现。它已被zope.app.authentication取代。
详细文档
新的认证服务设计
当前实现将被替换。以下是我与Jim Fulton一起构思的设计方案。 – itamar
请注意,此设计(以某种形式)已由可插拔认证服务实现。此文档需要更新以反映最终实现。
新的AuthenticationService设计笔记
服务包含一个用户源列表。它们实现接口,从
class IUserPassUserSource:
"""Authenticate using username and password."""
def authenticate(username, password):
"Returns boolean saying if such username/password pair exists"
class IDigestSupportingUserSource(IUserPassUserSource):
"""Allow fetching password, which is required by digest auth methods"""
def getPassword(username):
"Return password for username"
等。可能还有其他接口,用于处理证书认证等。可能需要扩展上述接口以处理主体标题和描述等。
登录方法(cookie认证、HTTP基本认证、摘要认证、FTP认证)注册为上述接口之一的视图。
class ILoginMethodView:
def authenticate():
"""Return principal for request, or None."""
def unauthorized():
"""Tell request that a login is required."""
认证服务实现如下
class AuthenticationService:
def authenticate(self, request):
for us in self.userSources:
loginView = getView(self, us, "login", request)
principal = loginView.authenticate()
if principal is not None:
return principal
def unauthorized(self, request):
loginView = getView(self, self.userSources[0], request)
loginView.unauthorized()
变更日志
3.4.0 (2007-10-25)
首次发布,独立于主Zope树。
项目详情
下载文件
下载适用于您平台上的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。
源代码分发
zope.app.pluggableauth-3.4.0.tar.gz (12.5 kB 查看哈希值)
关闭
zope.app.pluggableauth-3.4.0.tar.gz的哈希值
| 算法 | 哈希摘要 | |
|---|---|---|
| SHA256 | 54611d1ed3ab04ab7fbc85cd6dc6e9193073bfaf14b6f81e9a4ee76cea1ad3f2 |
|
| MD5 | 7cf294005f10ceefb4774c7468006762 |
|
| BLAKE2b-256 | 3e0ffef14d2e3e91d3577101756dcb951c9a0f62522bd201b3a342de7577449c |