Skip to content

Commit

Permalink
Use zope.container instead of zope.app.container.
Browse files Browse the repository at this point in the history
Use ``zope.site`` instead of ``zope.app.component``.
Use ``zope.authentication`` and ``zope.principalregistry`` instead of ``zope.app.security``.
Use ``zope.password`` instead of maintaining a copy of password managers.
  • Loading branch information
nadako committed Mar 14, 2009
1 parent 7b098b0 commit a924d2c
Show file tree
Hide file tree
Showing 19 changed files with 59 additions and 266 deletions.
9 changes: 8 additions & 1 deletion CHANGES.txt
Expand Up @@ -5,7 +5,14 @@ CHANGES
Version 0.6.1 (unreleased)
--------------------------

-
- Update dependencies:

* Use ``zope.container`` instead of ``zope.app.container``.
* Use ``zope.site`` instead of ``zope.app.component``.
* Use ``zope.authentication`` and ``zope.principalregistry`` instead
of ``zope.app.security``.
* Use ``zope.password`` instead of maintaining a copy of password
managers.


Version 0.6.0 (2009-01-04)
Expand Down
10 changes: 5 additions & 5 deletions setup.py
Expand Up @@ -59,8 +59,6 @@ def read(*rnames):
test = [
'z3c.testing',
'zope.app.testing',
'zope.publisher',
'zope.session',
'zope.testing',
],
),
Expand All @@ -72,22 +70,24 @@ def read(*rnames):
'z3c.formui',
'z3c.i18n',
'z3c.template',
'zope.app.component',
'zope.app.container',
'zope.app.generations',
'zope.app.security',
'zope.authentication',
'zope.component',
'zope.container',
'zope.deprecation',
'zope.dublincore',
'zope.event',
'zope.i18n',
'zope.interface',
'zope.lifecycleevent',
'zope.location',
'zope.password',
'zope.principalregistry',
'zope.publisher',
'zope.schema',
'zope.security',
'zope.session',
'zope.site',
'zope.traversing',
],
zip_safe = False,
Expand Down
2 changes: 1 addition & 1 deletion src/z3c/authenticator/README.txt
Expand Up @@ -7,7 +7,7 @@ and associating information with them. It uses plugins and subscribers to get
its work done.

For a simple authentication utility to be used, it should be registered as a
utility providing the `zope.app.security.interfaces.IAuthentication` interface.
utility providing the `zope.authentication.interfaces.IAuthentication` interface.

Our target is to support a handy IAuthentication utility which offers a simple
API for custom IUser implementations and does not depend on the default
Expand Down
12 changes: 6 additions & 6 deletions src/z3c/authenticator/authentication.py
Expand Up @@ -23,11 +23,11 @@
from zope.schema.interfaces import ISourceQueriables
from zope.location.interfaces import ILocation

from zope.app.component import queryNextUtility
from zope.app.container import btree
from zope.app.security.interfaces import IAuthentication
from zope.app.security.interfaces import PrincipalLookupError
from zope.app.security.interfaces import IUnauthenticatedPrincipal
from zope.component import queryNextUtility
from zope.container import btree
from zope.authentication.interfaces import IAuthentication
from zope.authentication.interfaces import PrincipalLookupError
from zope.authentication.interfaces import IUnauthenticatedPrincipal

from z3c.authenticator import interfaces
from z3c.authenticator import event
Expand Down Expand Up @@ -129,7 +129,7 @@ def unauthenticatedPrincipal(self):
we have in IPrincipalCreated which whould allow to apply groups. And
there is no way to apply local groups to global unauthenticated
principals it they get returned by the global IAuthentication or the
fallback implementation. See zope.app.security.principalregistry
fallback implementation. See zope.principalregistry
Usage:
Expand Down
8 changes: 4 additions & 4 deletions src/z3c/authenticator/browser/login.py
Expand Up @@ -12,10 +12,10 @@
import zope.component
from zope.publisher.browser import BrowserPage
from zope.traversing.browser import absoluteURL
from zope.app.component import hooks
from zope.app.security.interfaces import IUnauthenticatedPrincipal
from zope.app.security.interfaces import IAuthentication
from zope.app.security.interfaces import ILogout
from zope.site import hooks
from zope.authentication.interfaces import IUnauthenticatedPrincipal
from zope.authentication.interfaces import IAuthentication
from zope.authentication.interfaces import ILogout

from z3c.form.interfaces import HIDDEN_MODE
from z3c.form.interfaces import IWidgets
Expand Down
1 change: 0 additions & 1 deletion src/z3c/authenticator/configure.zcml
Expand Up @@ -39,7 +39,6 @@
<include file="credential.zcml" />
<include file="principalregistry.zcml" />
<include file="group.zcml" />
<include file="password.zcml" />
<include file="principal.zcml" />
<include file="user.zcml" />
<include file="widget.zcml" />
Expand Down
4 changes: 2 additions & 2 deletions src/z3c/authenticator/credential.py
Expand Up @@ -26,8 +26,8 @@
from zope.session.interfaces import ISession
from zope.traversing.browser.absoluteurl import absoluteURL

from zope.app.component import hooks
from zope.app.container import contained
from zope.site import hooks
from zope.container import contained

from z3c.authenticator import interfaces

Expand Down
14 changes: 7 additions & 7 deletions src/z3c/authenticator/group.py
Expand Up @@ -29,13 +29,13 @@
from zope.security.interfaces import IGroup
from zope.security.interfaces import IGroupAwarePrincipal

from zope.app.container import btree
from zope.app.container import contained
from zope.app.security.interfaces import IAuthentication
from zope.app.security.interfaces import IAuthenticatedGroup
from zope.app.security.interfaces import IEveryoneGroup
from zope.app.security.interfaces import IUnauthenticatedGroup
from zope.app.security.interfaces import IUnauthenticatedPrincipal
from zope.container import btree
from zope.container import contained
from zope.authentication.interfaces import IAuthentication
from zope.authentication.interfaces import IAuthenticatedGroup
from zope.authentication.interfaces import IEveryoneGroup
from zope.authentication.interfaces import IUnauthenticatedGroup
from zope.authentication.interfaces import IUnauthenticatedPrincipal

from z3c.authenticator import interfaces
from z3c.authenticator import event
Expand Down
12 changes: 6 additions & 6 deletions src/z3c/authenticator/group.txt
Expand Up @@ -73,7 +73,7 @@ authentication service, we will setup a Authenticator utility:
Give them a location and register them as a IAuthentication utility :

>>> import zope.component
>>> from zope.app.security.interfaces import IAuthentication
>>> from zope.authentication.interfaces import IAuthentication
>>> rootFolder['authenticator'] = authenticator
>>> zope.component.provideUtility(authenticator, IAuthentication)

Expand Down Expand Up @@ -442,15 +442,15 @@ because the groups haven't been defined:

Now, if we define the Everybody group:

>>> import zope.app.security.interfaces
>>> import zope.authentication.interfaces
>>> class EverybodyGroup(Group):
... zope.interface.implements(
... zope.app.security.interfaces.IEveryoneGroup)
... zope.authentication.interfaces.IEveryoneGroup)

>>> all = EverybodyGroup('groups.all')
>>> groups['groups.all'] = all
>>> zope.component.provideUtility(all,
... zope.app.security.interfaces.IEveryoneGroup)
... zope.authentication.interfaces.IEveryoneGroup)

Then the group will be added to the principal:

Expand All @@ -462,12 +462,12 @@ Similarly for the authenticated group:

>>> class AuthenticatedGroup(Group):
... zope.interface.implements(
... zope.app.security.interfaces.IAuthenticatedGroup)
... zope.authentication.interfaces.IAuthenticatedGroup)

>>> authenticated = AuthenticatedGroup('groups.authenticated')
>>> groups['groups.authenticated'] = authenticated
>>> zope.component.provideUtility(authenticated,
... zope.app.security.interfaces.IAuthenticatedGroup)
... zope.authentication.interfaces.IAuthenticatedGroup)

Then the group will be added to the principal:

Expand Down
22 changes: 5 additions & 17 deletions src/z3c/authenticator/interfaces.py
Expand Up @@ -23,27 +23,15 @@

from zope.security.interfaces import IGroupClosureAwarePrincipal
from zope.security.interfaces import IMemberAwareGroup
from zope.app.container.interfaces import IContainer
from zope.app.container.constraints import contains
from zope.app.container.constraints import containers
from zope.app.security.interfaces import ILogout
from zope.app.security.vocabulary import PrincipalSource
from zope.container.interfaces import IContainer
from zope.container.constraints import contains
from zope.container.constraints import containers
from zope.authentication.interfaces import ILogout
from zope.authentication.principal import PrincipalSource

from z3c.i18n import MessageFactory as _


# TODO: this should really, really go to another place then
# zope.app.authentication
class IPasswordManager(zope.interface.Interface):
"""Password manager."""

def encodePassword(password):
"""Return encoded data for the password."""

def checkPassword(storedPassword, password):
"""Return whether the password coincide with the storedPassword."""


class IPlugin(zope.interface.Interface):
"""A plugin for IAuthenticator component."""

Expand Down
159 changes: 0 additions & 159 deletions src/z3c/authenticator/password.py

This file was deleted.

0 comments on commit a924d2c

Please sign in to comment.