[Zope3-checkins] Broken ZODB (was SVN: Zope3/trunk/src/zope/app/authentication/Eliminated all old-style classes)

Garrett Smith garrett at mojave-corp.com
Wed Jun 22 17:26:38 EDT 2005


This change has broken presisted SessionCresentials. I'm not sure why,
but the unpickler is calling SessionCredentials __init__.

I'm not sure what the right course is here, but I think something should
be done. One of these perhaps:

- Revert to old style class
- Write a conversion script
- Provide a BBB signature of __init__ with default values for login and
password

Also, since SessionCredentials is stored as session data, should it not
be Persistent?

 -- Garrett

Dmitry Vasiliev wrote:
> Log message for revision 30881:
>   Eliminated all old-style classes
> 
> 
> Changed:
>   U   Zope3/trunk/src/zope/app/authentication/README.txt
>   U   Zope3/trunk/src/zope/app/authentication/groupfolder.py
>   U   Zope3/trunk/src/zope/app/authentication/principalfolder.py
>   U   Zope3/trunk/src/zope/app/authentication/principalplugins.py
>   UU  Zope3/trunk/src/zope/app/authentication/session.py
> 
> -=-
> Modified: Zope3/trunk/src/zope/app/authentication/README.txt
> ===================================================================
> --- Zope3/trunk/src/zope/app/authentication/README.txt
2005-06-22
> 12:02:55 UTC (rev 30880) +++
> Zope3/trunk/src/zope/app/authentication/README.txt	2005-06-22
>    12:05:52 UTC (rev 30881) @@ -46,7 +46,7 @@ >>> from zope import
>    interface >>> from zope.app.authentication import interfaces
> 
> -  >>> class MyCredentialsPlugin:
> +  >>> class MyCredentialsPlugin(object):
>    ...
>    ...     interface.implements(interfaces.ICredentialsPlugin)
>    ...
> @@ -56,7 +56,7 @@
>    ...     def challenge(self, request):
>    ...         pass # challenge is a no-op for this plugin
>    ...
> -  ...     def logout(request):
> +  ...     def logout(self, request):
>    ...         pass # logout is a no-op for this plugin
> 
>  As a plugin, MyCredentialsPlugin needs to be registered as a named
> utility: @@ -83,7 +83,7 @@
> 
>  Our authenticator uses this type when it creates a principal info:
> 
> -  >>> class MyAuthenticatorPlugin:
> +  >>> class MyAuthenticatorPlugin(object):
>    ...
>    ...     interface.implements(interfaces.IAuthenticatorPlugin)
>    ...
> @@ -688,4 +688,4 @@
>  the PAU will provide it as a queriable:
> 
>    >>> list(pau.getQueriables()) # doctest: +ELLIPSIS
> -  [('Queriable', ...QueriableAuthenticatorPlugin instance...)]
> +  [('Queriable', ...QueriableAuthenticatorPlugin object...)]
> 
> Modified: Zope3/trunk/src/zope/app/authentication/groupfolder.py
> ===================================================================
> --- Zope3/trunk/src/zope/app/authentication/groupfolder.py
2005-06-22
> 12:02:55 UTC (rev 30880) +++
> Zope3/trunk/src/zope/app/authentication/groupfolder.py
2005-06-22
>          12:05:52 UTC (rev 30881) @@ -90,7 +90,7 @@ )
> 
> 
> -class GroupInfo:
> +class GroupInfo(object):
>      """An implementation of IPrincipalInfo used by the group folder.
> 
>      A group info is created with id, title, and description:
> 
> Modified: Zope3/trunk/src/zope/app/authentication/principalfolder.py
> ===================================================================
> ---
> Zope3/trunk/src/zope/app/authentication/principalfolder.py
2005-06-22
> 12:02:55 UTC (rev 30880) +++
>  Zope3/trunk/src/zope/app/authentication/principalfolder.py
2005-06-22
> 12:05:52 UTC (rev 30881) @@ -126,7 +126,7 @@ PrincipalInformation =
> InternalPrincipal  
> 
> 
> -class PrincipalInfo:
> +class PrincipalInfo(object):
>      """An implementation of IPrincipalInfo used by the principal
> folder. 
> 
>      A principal info is created with id, login, title, and
> description: @@ -195,7 +195,7 @@
> 
>          Create a principal with 1 as id
>          Add a login attr since __setitem__ is in need of one
> -
> +
>              >>> principal = Principal(1)
>              >>> principal.login = 1
> 
> @@ -267,7 +267,7 @@
>                  i += 1
> 
> 
> -class Principal:
> +class Principal(object):
>      """A group-aware implementation of
> zope.security.interfaces.IPrincipal. 
> 
>      A principal is created with an ID:
> @@ -303,7 +303,7 @@
>          return 'Principal(%r)' % self.id
> 
> 
> -class AuthenticatedPrincipalFactory:
> +class AuthenticatedPrincipalFactory(object):
>      """Creates 'authenticated' principals.
> 
>      An authenticated principal is created as a result of an
> authentication @@ -369,7 +369,7 @@
>          return principal
> 
> 
> -class FoundPrincipalFactory:
> +class FoundPrincipalFactory(object):
>      """Creates 'found' principals.
> 
>      A 'found' principal is created as a result of a principal lookup.
> 
> Modified: Zope3/trunk/src/zope/app/authentication/principalplugins.py
> ===================================================================
> ---
> Zope3/trunk/src/zope/app/authentication/principalplugins.py
2005-06-22
> 12:02:55 UTC (rev 30880) +++
>  Zope3/trunk/src/zope/app/authentication/principalplugins.py
2005-06-22
> 12:05:52 UTC (rev 30881) @@ -28,5 +28,5 @@ from
> zope.app.authentication import interfaces  
> 
> 
> -class PrincipalFactory:
> -    pass
> \ No newline at end of file
> +class PrincipalFactory(object):
> +    pass
> 
> Modified: Zope3/trunk/src/zope/app/authentication/session.py
> ===================================================================
> --- Zope3/trunk/src/zope/app/authentication/session.py
2005-06-22
> 12:02:55 UTC (rev 30880) +++
> Zope3/trunk/src/zope/app/authentication/session.py	2005-06-22
>  12:05:52 UTC (rev 30881) @@ -14,7 +14,7 @@ """ Implementations of
>      the session-based and cookie-based extractor and challenge
> plugins. 
> 
> -$Id: $
> +$Id$
>  """
>  import transaction
>  from persistent import Persistent
> @@ -24,10 +24,9 @@
>  from zope.schema import TextLine
>  from zope.publisher.interfaces.http import IHTTPRequest
> 
> -from zope.app import zapi
>  from zope.app.component import hooks
>  from zope.app.container.contained import Contained
> -from zope.app.session.interfaces import ISession, IClientId
> +from zope.app.session.interfaces import ISession
>  from zope.app.traversing.browser.absoluteurl import absoluteURL
> 
>  from zope.app.authentication.interfaces import ICredentialsPlugin
> @@ -50,7 +49,7 @@
>          """Return password."""
> 
> 
> -class SessionCredentials:
> +class SessionCredentials(object):
>      """Credentials class for use with sessions.
> 
>      A session credential is created with a login and a password:
> 
> 
> Property changes on:
> Zope3/trunk/src/zope/app/authentication/session.py
> ___________________________________________________________________
>    Name: svn:keywords + Id
> 
> _______________________________________________
> Zope3-Checkins mailing list
> Zope3-Checkins at zope.org
> http://mail.zope.org/mailman/listinfo/zope3-checkins



More information about the Zope3-Checkins mailing list