← Back to team overview

divmod-users team mailing list archive

Re: Persisting Cred in Axiom

 

Hey JP,


On Mon, Feb 25, 2013 at 10:46 PM, <exarkun@xxxxxxxxxxxxxxxxx> wrote:

> It seems like you must have seen axiom.userbase already.  It integrates
> Axiom with cred.  What are the problems with the approach it takes?
>

Oops, nope, forgot about it; I'll go read it again.


>  - one Realm implementation that produces authenticated users' avatars (in
>> my case, IBoxReceivers)
>> - all of the above ICredentialsCheckers
>> - one Portal, to mediate between all of these
>>
>> It seems that the most reasonable thing to do here would be to adapt the
>> root store to a Portal, but there's no IPortal interface. I could, of
>> course, just define that interface myself.
>>
>
> Adaption by calling interface objects is one approach.  Another approach
> is to just construct your adapters.
>
> There is no `IPortal` because `Portal` is the only implementation anyone
> needs.
>

Sure, I just wanted it for adaptation only :)


> You can do something like:
>
>    Portal(IRealm(store), list(store.powerupsFor(ICredentialsChecker)))
>

Hm, okay, I guess I could just have N distinct portals. I'm guessing this
code would live in my IBoxReceiver's __init__ (since it's the IBoxReceiver
that actually makes the Portal.login call), and that IBoxReceiver is
specific to one kind of credential, I'll use that list filtered for the
appropriate credentials :)

I guess this sounds a little bit like what I wrote above, but I'm not sure
> why the implementation is ten times shorter than your description.


Well, and it doesn't define an interface, or a service ;)


>  So, I suppose the short way to ask this question is: is it okay to define
>> interfaces that upstream doesn't define just so you have something to
>> adapt/powerup to?
>>
>
> No one is going to stop you, but it doesn't seem like a good (or necessary
> or even terribly useful) idea to me.
>

Okay, cool, thanks for the pointers :)


>
> Jean-Paul
>
> --
> Mailing list: https://launchpad.net/~divmod-**users<https://launchpad.net/~divmod-users>
> Post to     : divmod-users@lists.launchpad.**net<divmod-users@xxxxxxxxxxxxxxxxxxx>
> Unsubscribe : https://launchpad.net/~divmod-**users<https://launchpad.net/~divmod-users>
> More help   : https://help.launchpad.net/**ListHelp<https://help.launchpad.net/ListHelp>
>



-- 
cheers
lvh

References