[Twisted-Python] Foolscap-0.0.7 (aka newpb) released

I've made a new release of Foolscap, 0.0.7, which fixes two irritating bugs: in previous versions you could not connect to the same PBURL multiple times, nor could you connect to yourself. The former would return None where it was supposed to return a RemoteReference, the latter could cause a negotiation timeout and failure. Both are fixed now. There are no incompatible protocol changes in this release: 0.0.6 clients will speak to 0.0.7 clients. There likely to be incompatible changes in the future though: the protocol is not yet stabilized. Foolscap is a next-generation RPC protocol for Twisted, under development as "newpb" for the last several years. It is intended to eventually replace PB, but it is not yet ready for production use. My hope is that Foolscap will make it easier for python/twisted applications to use tools and concepts from the object-capability world, in particular from E and the Web-Calculus. Some useful URLs: Foolscap home page: http://twistedmatrix.com/trac/wiki/FoolsCap Download the release: http://twistedmatrix.com/~warner/Foolscap/ Browse the source: http://twistedmatrix.com/trac/browser/sandbox/warner/Foolscap/trunk Read some docs: http://twistedmatrix.com/~warner/Foolscap/using-pb.html E: http://www.erights.org/ Web-Calculus: http://www.waterken.com/dev/Web/ Also I'll probably organize a Foolscap BOF at PyCon this year. share and enjoy, -Brian

I'm afraid I don't understand what you mean by "client-server authentication".. can you expand upon that? If what you want is a way to send a username/password to a server and have it connect you to some resource based upon the validity of that pair, then it's trivial to publish some sort of "login" object that has a method which accepts that pair, and then does a lookup/verification and returns some sort of avatar for that user, something like this: class Avatar(foolscap.Referenceable): def __init__(self, user_object): self.user_object = user_object def remote_stuff(self, args): return self.user_object.stuff(args) class Login(foolscap.Referenceable): def remote_login(self, username, password): if username in self.passwords and self.passwords[username] == password: return Avatar(self.user_objects[username]) raise BadPasswordOrUnknownUserError() t = foolscap.Tub() pburl = t.registerReference(Login()) print "connect your client to %s" % pburl I haven't put a great deal of thought into how twisted.cred should be used in conjunction with Foolscap, but my hunch is that it should just be a layer on top, with some sort of convention for indicating what form of credentials the client is offering. cheers, -Brian

I'm afraid I don't understand what you mean by "client-server authentication".. can you expand upon that? If what you want is a way to send a username/password to a server and have it connect you to some resource based upon the validity of that pair, then it's trivial to publish some sort of "login" object that has a method which accepts that pair, and then does a lookup/verification and returns some sort of avatar for that user, something like this: class Avatar(foolscap.Referenceable): def __init__(self, user_object): self.user_object = user_object def remote_stuff(self, args): return self.user_object.stuff(args) class Login(foolscap.Referenceable): def remote_login(self, username, password): if username in self.passwords and self.passwords[username] == password: return Avatar(self.user_objects[username]) raise BadPasswordOrUnknownUserError() t = foolscap.Tub() pburl = t.registerReference(Login()) print "connect your client to %s" % pburl I haven't put a great deal of thought into how twisted.cred should be used in conjunction with Foolscap, but my hunch is that it should just be a layer on top, with some sort of convention for indicating what form of credentials the client is offering. cheers, -Brian
participants (2)
-
Brian Warner
-
Yi Qiang