[Twisted-Python] Re: Perspective Broker Anonymous access..

Carlos Eduardo cedepaula at yahoo.com.br
Fri Dec 8 15:19:24 EST 2006

Jean-Paul Calderone <exarkun <at> divmod.com> writes:

> You have to re-implement the login process to support anonymous users.
> PBClientFactory.login() cannot be used for this.
> Jean-Paul

So, the examples given in
http://twistedmatrix.com/projects/core/documentation/howto/pb-cred.html (below)
doesnt works?

# anonymous users share one Avatar, named users each get their own
    def requestAvatar(self, avatarID, mind, *interfaces):
        assert pb.IPerspective in interfaces
        if avatarID == checkers.ANONYMOUS:
            return pb.IPerspective, self.anonAvatar, lambda:None
            return pb.IPerspective, self.avatars[avatarID], lambda:None

I was looking at pb.py, portal.py and the way i understood, the whole chain
(login -> cbSendUsername -> remote login -> cb_Response -> remote respond) is
the responsible by the login process... if we send like credentials.Anonymous in
login(), all this chain needs to handle it... right?

Its a little strange why we cant have authenticated and anonymous users sharing
the same process since we can filter in the avatar given the permissions (like
example above).

Another question... is it interesting to twisted project to have this kind of
support? I mean, is it important to provide a way to this support in a patch to
the project or should I do modifications I need (if i learn how to) and keep
them to me?

Thanks for all and sorry if these questions are not in scope...


More information about the Twisted-Python mailing list