[Twisted-Python] Must avatarId always be a string?

Adi Roiban adi at roiban.ro
Thu Jan 10 05:34:57 EST 2013

On 10 January 2013 12:00, Marco Giusti <marco.giusti at gmail.com> wrote:
>> My AvatarID Object is just for data.
>> Let me describe one of my usage/requirement:
>> I have a portal with credentialsChecker for both OS accounts and
>> application specific accounts.
>> One can have user "john" both as a local account and/or an application account.
>> If my credentialsChecker returns only 'john', the Realm will not know
>> from where to get user's home folder, so the returned AvatarID needs
>> to signal the "source" of avatarID login so that it can use the same
>> source for getting account configuration.
> Can't you use `Portal.login` interfaces paramenter? I think you have two
> different entry points for local and application accounts, so:

I can not do portal.login('john', None, ILocalHomeFolder) since at log
in time I don't know if john is an os or application account... The
credential checker will find out what kind of account is John.


> well actually tuples are not modifiable, so they are strings, then
> ('john', 'os') is an unique identifier across all system with no much
> more information than 'john at os'. The advantage of using plain string is
> that they don't break the interface.

Later I would like to extract the provider from the AvatatID and doing
(user, provider) = AvatarID.split('@', 2) is a bit more complicated
and error prone.

Thanks for the notes.

Adi Roiban

More information about the Twisted-Python mailing list