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

2013-01-15 Thread Glyph
On Jan 14, 2013, at 11:39 PM, Hynek Schlawack wrote: > > Am 14.01.2013 um 23:58 schrieb Glyph : > It seems like the "shared caching reference" would solve this problem as well? >>> >>> Yes, I think that's the right answer. It's certainly the right design >>> in my case, and perhaps

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

2013-01-14 Thread Hynek Schlawack
Am 14.01.2013 um 23:58 schrieb Glyph : >>> It seems like the "shared caching reference" would solve this problem >>> as well? >> >> Yes, I think that's the right answer. It's certainly the right design >> in my case, and perhaps in the general case too. > > I think that this is the right design

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

2013-01-14 Thread Glyph
On Jan 14, 2013, at 5:10 PM, Peter Westlake wrote: > The main question left in my mind is about the degree of dependency > between the checker and the realm if extra information is passed, > by whatever method. If the realm expects the checker to pass it > (for instance) an LDAP session, then it

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

2013-01-14 Thread Peter Westlake
On Mon, Jan 14, 2013, at 22:58, Glyph wrote: > On Jan 14, 2013, at 3:18 AM, Peter Westlake > wrote: > > >> It seems like the "shared caching reference" would solve this problem > >> as well? > > > > Yes, I think that's the right answer. It's certainly the right design > > in my case, and perhaps

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

2013-01-14 Thread Glyph
On Jan 14, 2013, at 3:18 AM, Peter Westlake wrote: >> It seems like the "shared caching reference" would solve this problem >> as well? > > Yes, I think that's the right answer. It's certainly the right design > in my case, and perhaps in the general case too. I think that this is the right des

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

2013-01-14 Thread Itamar Turner-Trauring
On Mon, Jan 14, 2013 at 6:27 AM, Peter Westlake wrote: > Interesting... those portals could be on different Realms too. It would > also allow more than one checker to be tried per interface, which would > allow (say) a credentials.IUsernamePassword to be tried against different > checkers. > In

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

2013-01-14 Thread Peter Westlake
Interesting... those portals could be on different Realms too. It would also allow more than one checker to be tried per interface, which would allow (say) a credentials.IUsernamePassword to be tried against different checkers. Peter. On Sun, Jan 13, 2013, at 14:08, Itamar Turner-Trauring wrote:

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

2013-01-14 Thread Peter Westlake
On Sun, Jan 13, 2013, at 6:39, Glyph wrote: > > On Jan 10, 2013, at 6:41 AM, Peter Westlake > wrote: > > > On Wed, Jan 9, 2013, at 18:02, Glyph wrote > >> On Jan 9, 2013, at 9:26 AM, Peter Westlake > >> wrote: > >>> On Jan 9, Adi wrote: > I am not an expert in Twisted, but from my understa

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

2013-01-13 Thread Itamar Turner-Trauring
On Sun, Jan 13, 2013 at 9:08 AM, Itamar Turner-Trauring < ita...@futurefoundries.com> wrote: > > @inlineCallbacks > def login(self, *args, **kwargs): > for portal in self.portals: > try: > return portal.login(*args, **kwargs) > except: >

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

2013-01-13 Thread Itamar Turner-Trauring
It's possible that in some of the cases discussed above, what you want is a custom *Portal*. For example, if you want to try a sequence of logins, and choose the first that succeeds: class MultiPortal(object): def __init__(self, portals): self.portals = portals @inlineCallbacks

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

2013-01-12 Thread Glyph
On Jan 10, 2013, at 6:41 AM, Peter Westlake wrote: > On Wed, Jan 9, 2013, at 18:02, Glyph wrote >> On Jan 9, 2013, at 9:26 AM, Peter Westlake >> wrote: >>> On Jan 9, Adi wrote: I am not an expert in Twisted, but from my understanding, the "string" requirement is there to provide a plu

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

2013-01-10 Thread Peter Westlake
On Wed, Jan 9, 2013, at 18:02, Glyph wrote > On Jan 9, 2013, at 9:26 AM, Peter Westlake > wrote: > > On Jan 9, Adi wrote: > >> I am not an expert in Twisted, but from my understanding, the "string" > >> requirement is there to provide a plugable interface. So that you can > >> have generic credent

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

2013-01-10 Thread Marco Giusti
On Thu, Jan 10, 2013 at 12:34:57PM +0200, Adi Roiban wrote: > On 10 January 2013 12:00, Marco Giusti wrote: > [snip] > >> 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 > >> appl

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

2013-01-10 Thread Adi Roiban
On 10 January 2013 12:00, Marco Giusti wrote: [snip] >> 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 accou

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

2013-01-10 Thread Marco Giusti
On Thu, Jan 10, 2013 at 11:00:06AM +0100, Marco Giusti wrote: [cut] > > Can't you use `Portal.login` interfaces paramenter? I think you have two > different entry points for local and application accounts, so: > > # login as local account > portal.login('john', None, ILocalHomeFolder)

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

2013-01-10 Thread Marco Giusti
On Thu, Jan 10, 2013 at 12:27:04AM +0200, Adi Roiban wrote: > On 9 January 2013 20:02, Glyph wrote: > > On Jan 9, 2013, at 9:26 AM, Peter Westlake wrote: > > > > I am not an expert in Twisted, but from my understanding, the "string" > > requirement is there to provide a plugable interface. So tha

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

2013-01-09 Thread Adi Roiban
On 9 January 2013 20:02, Glyph wrote: > On Jan 9, 2013, at 9:26 AM, Peter Westlake wrote: > > I am not an expert in Twisted, but from my understanding, the "string" > requirement is there to provide a plugable interface. So that you can > have generic credentials checkers, working with generic re

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

2013-01-09 Thread Hynek Schlawack
Am 09.01.2013 um 14:04 schrieb Jan Urbański : >> http://twistedmatrix.com/documents/current/core/howto/cred.html says >> that the avatarId parameter to IRealm.requestAvatar must be a string, >> not even a Unicode string. I'm using LDAP for authentication, and the >> checker retrieves the full LDA

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

2013-01-09 Thread Glyph
On Jan 9, 2013, at 9:26 AM, Peter Westlake wrote: >> I am not an expert in Twisted, but from my understanding, the "string" >> requirement is there to provide a plugable interface. So that you can >> have generic credentials checkers, working with generic realms. >> Having simple "strings" could

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

2013-01-09 Thread Peter Westlake
On Wed, Jan 9, 2013, at 14:40, Adi Roiban wrote: > On 9 January 2013 15:04, Jan Urbański wrote: ... > > I have faced a similar problem myself and after reading the code I've > > resolved to wilfully disregarding the documentation and passing tuples > > around, accepting that if it breaks, I get to

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

2013-01-09 Thread Ralph Meijer
On 2013-01-09 15:40, Adi Roiban wrote: > On 9 January 2013 15:04, Jan Urbański wrote: >> On 09/01/13 13:49, Peter Westlake wrote: >>> http://twistedmatrix.com/documents/current/core/howto/cred.html says >>> that the avatarId parameter to IRealm.requestAvatar must be a string, >>> not even a Unicod

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

2013-01-09 Thread Adi Roiban
On 9 January 2013 15:04, Jan Urbański wrote: > On 09/01/13 13:49, Peter Westlake wrote: >> http://twistedmatrix.com/documents/current/core/howto/cred.html says >> that the avatarId parameter to IRealm.requestAvatar must be a string, >> not even a Unicode string. I'm using LDAP for authentication,

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

2013-01-09 Thread Jan Urbański
On 09/01/13 13:49, Peter Westlake wrote: > http://twistedmatrix.com/documents/current/core/howto/cred.html says > that the avatarId parameter to IRealm.requestAvatar must be a string, > not even a Unicode string. I'm using LDAP for authentication, and the > checker retrieves the full LDAP entry for

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

2013-01-09 Thread Peter Westlake
http://twistedmatrix.com/documents/current/core/howto/cred.html says that the avatarId parameter to IRealm.requestAvatar must be a string, not even a Unicode string. I'm using LDAP for authentication, and the checker retrieves the full LDAP entry for the user as a side-effect of authentication. Unt