[Twisted-Python] More newbie questions [apologies for the length!]

Steve Waterbury steve.waterbury at gsfc.nasa.gov
Fri Jul 19 17:00:35 EDT 2002


Glyph Lefkowitz wrote:

> The most frequently applied term I've heard is "twister".  I'd sure like to
> have occasion to need a term which refers to someone who is a Twisted
> enthusiast who isn't directly on the development team ;-).

How about "twistor" (resonates with the Twistors theory (physics)
of Roger Penrose et al. :^) or "twisties"?  (The "-ies" carries 
some of the cult-y flavor ... :^)  

So far, I've only done some simple experiments with twisted web and 
twisted enterprise, but even just from that and reading the docs, I 
can already see that twisted rocks!  IMO it's by far the 
most advanced, most flexible, and best architected application 
framework in the Python world (which is the only language I would 
consider using for our application -- which BTW has nothing to do 
with twistors ... ;^).  

Thanks for the recently-added tutorial on Twisted Plugins; 
very cool!  Need more ... (see the following ... :^)  

Context:  the application we're developing is a "collaborative 
engineering environment", to include a repository, data 
transformation engine, multiprotocol communications hub, 
set of api's, and a gui client for browsing data and integrating 
desktop tools.  Not all that different from a multi-player game, 
so twisted fits the paradigm to a tee -- as soon as I read the 
ipc10paper, I knew that if twisted was half as good as it 
sounded on paper, it could provide most if not all of the 
infrastructure we need right out of the box.  

Twisted has allowed me to consider implementing some advanced 
features sooner that I had anticipated, like replicating the 
communications hub within the thick gui client (a wxPython app 
with a ZODB local object cache), so that for a power user, 
the client could be configured as essentially a peer to the 
server nodes, but also support very simple interfaces (web 
browser-based or very thin clients) for users with simple 
perspectives.  We have a prototype client, but haven't even 
begun to integrate twisted into it yet -- I'll ask questions 
about that later, like integrating the twisted event loop 
with wxPython's, which could be really nice.  

I had already selected PostgreSQL for the repository database, 
so twisted.enterprise is perfect, and trying out the example 
gave me the impression that it will be quite easy to work 
with.  

One thing I need to implement quickly is efficient support 
for "perspectives" (views with role-based access), so I'd like 
to get a little more documentation or somewhat better examples 
for how that is done with twisted.  I would love to have an 
example that would illustrate something like the following:

* Each user is assigned one or more roles.  Each role will 
carry some set of permissions relative to objects and functions 
in the system.  As I understand cred, a user is subclassed from 
Perspective, which maps to a "user-with-roles", I think.  My 
initial idea is to have a "mask" assigned to each object that 
needs view-sensitivity, and whether that object is accessible and 
how is determined by comparing the user's (Perspective's) role 
mask to the masks of the objects that would be operated on by 
the user's request.  Is this an appropriate concept to map to 
the twisted framework (from what I've read, it would involve 
cred and Perspective Broker)?  And if so, how?  Or if not, what 
would be the correct approach?  

* Speaking in terms of the role thing a bit further, some roles 
would be standardized, with pre-defined permissions like 
"read-only permission for all projects and create/mod permission for 
object type X on project Z."  But we also need to enable certain 
admin or project leader roles to create customized roles for 
their projects, etc.  How does this map?  

* I'd like to maintain the state of each user-with-roles in 
the PostgreSQL repository (syncing as necessary across thick 
clients and replicated servers, as was suggested on the list 
recently), and use hashed passwords over SSL.  I'm sure from 
what I've read that cred either supports this or will soon, 
but I'd like to get more info on how to implement it.  

Gotta go now ... will send more questions soon.  Thanks again 
for a truly awesome piece of work!  

Cheers,
-- Steve.

Stephen C. Waterbury  http://misspiggy.gsfc.nasa.gov/people/waterbug.html




More information about the Twisted-Python mailing list