跳转到主要内容

Grok应用的认证

项目描述

建立在zope.pluggableauth包之上,dolmen.authentication扩展了它,以添加可重用的组件描述和实现。

概述

dolmen.authentication提供了接口和组件

>>> import dolmen.authentication
>>> from dolmen.authentication import IAuthenticationInterfaces
>>> from dolmen.authentication import IAuthenticationEvents
>>> from dolmen.authentication import IAuthenticationAPI

>>> IAuthenticationAPI.isOrExtends(IAuthenticationInterfaces)
True

>>> IAuthenticationAPI.isOrExtends(IAuthenticationEvents)
True

>>> from zope.interface.verify import verifyObject
>>> verifyObject(IAuthenticationAPI, dolmen.authentication)
True

描述性接口

dolmen.authentication提供了一组基础接口,可用于规范化认证系统

>>> print IAuthenticationInterfaces.__doc__
This interface describes and exposes the meaningful interfaces
of the authentication module.

>>> interfaceDescription(IAuthenticationInterfaces)
IPrincipalFolder: A container specialized in storing principal representations.
IAccountStatus: Abstraction component allowing to check the status of a principal.
IPrincipal: A principal representation, directly inheriting from zope.security IPrincipal, but redefining several fields for a user-friendly form display.
IGroup: A logical grouping of principals. This component is an IPrincipal itself.
IPasswordProtected: This interface defines any component protected by a password
IPasswordChecker: Abstraction component in charge of resolving a principal'scredentials.

>>> IAuthenticationInterfaces.providedBy(dolmen.authentication.interfaces)
True

>>> verifyObject(IAuthenticationInterfaces, dolmen.authentication.interfaces)
True

事件接口和实现

dolmen.authentication提供了一组基本事件,可用于处理和跟踪主体的生命周期

>>> print IAuthenticationEvents.__doc__
This interface describes and exposes the meaningful events
descriptions and components of the authentication module.

>>> interfaceDescription(IAuthenticationEvents)
IUserLoggedOutEvent: IObjectEvent extending event : a user has logged out.
IUserLoggedInEvent: IObjectEvent extending event : a user has logged in.
UserLogoutEvent: An IUserLoggedOutEvent implementation.
UserLoginEvent: An IUserLoggedInEvent implementation.

>>> IAuthenticationEvents.providedBy(dolmen.authentication.events)
True

>>> verifyObject(IAuthenticationEvents, dolmen.authentication.events)
True

更改

0.3 (2012-01-17)

  • 对代码的更新以适应Dolmen/Grok堆栈的最新更改。

0.2 (2010-05-29)

  • LocatablePrincipalInfo适配器现在实现了并提供IPrincipalInfo接口。这允许适配器在AuthenticatedPrincipalFactory适配中使用。

0.1 (2010-03-26)

  • 初始发布。

项目详情


下载文件

下载适用于您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分布

dolmen.authentication-0.3.tar.gz (6.0 kB 查看散列)

上传时间

由支持