[Twisted-Python] Adding pb users online
michal at pasternak.w.lub.pl
Wed Jan 14 16:46:15 EST 2004
Martin Stenh?rd [Wed, Jan 14, 2004 at 11:29:42PM +0100]:
> I have the below code for my server with pb authentications. And thats
> works fine clients can login and do CallRemote. The clients can also login
> as an anonymous users to add them self to users database that are stored in
> a MySQL table. My question is how do I reload my users using registerChecker
> with out stopping the server? So that the current online users don't lose
> there connections.
> c = checkers.InMemoryUsernamePasswordDatabaseDontUse()
Instead of adding them to the above checker, write your own class, that
implements ICredentialsChecker and authenticates using queries to SQL
You could implement some caching at that level, so it won't be really much
slower, than InMemory checker.
You could use FilePasswordDB as an example, defined in cred.checkers.
More information about the Twisted-Python