[okfn-help] aaa cachine (was Re: further to load on us0)

John Bywater john.bywater at appropriatesoftware.net
Fri Oct 9 13:29:20 BST 2009


Martin Keegan wrote:
> On Thu, 8 Oct 2009, John Bywater wrote:
> 
>>> Anyway, that's a broader issue. What I want to know right now is how hard
>>> it is to memoise the result of password lookups into some time-limited
>>> cache, so we can reduce the number of calls out to postgres.
>> I was thinking about that earlier. It's access control of authenticated 
>> sessions, not authentication, that takes time. We need to memoise the 
>> results of person-action-object tuples. I'll see what I can do.
> 
> Ok, whereabouts in the code is the lookup done?

The KForge access control code is entirely contained within these files:
http://knowledgeforge.net/domainmodel/trac/browser/trunk/src/dm/accesscontrol.py 

http://knowledgeforge.net/kforge/trac/browser/trunk/src/kforge/accesscontrol.py 


They implement a role-based access controller, which checks whether 
permissions (associations between actions such as 'delete' and 
protection objects which represent resources) have been associated with 
and roles (which users have in several ways: system-wide, 
project-membership, etc.).

The object associations are recorded in, and retrieved from, the 
dictionary-like domain model object registers:
http://knowledgeforge.net/domainmodel/trac/browser/trunk/src/dm/dom/accesscontrol.py
http://knowledgeforge.net/domainmodel/trac/browser/trunk/src/dm/dom/stateful.py
http://knowledgeforge.net/domainmodel/trac/browser/trunk/src/dm/dom/base.py

Rufus wrote a short guide to this interface here (see Example 2):
http://knowledgeforge.net/kforge/trac/browser/trunk/docs/cli_shell.txt

Anyway, the domain model sits over a persistence layer:
http://knowledgeforge.net/domainmodel/trac/browser/trunk/src/dm/db/__init__.py
that simply adapts the SQLObject ORM.

There are a few other obvious performance optimisations to be made. I'll 
see what else I can do.

Jb

> 
> Mk




More information about the okfn-help mailing list