Jared,
Thank you for challenging the API proposals, digging deep to understand them, and summarizing on the list to make your learnings accessible.
I'm excited to see goldilocks winning folks over. She quickly swayed me in the Bulgaria Sessions.
A couple thoughts inline, that hopefully helps folks understand rationale -
On Oct 8, 2013, at 10:52 PM, Jared Hirsch <
6a...@mozilla.com> wrote:
>
> ## Proposals summarized
>
> One of the topics discussed at the Paris work week was how to change our session management approach to improve usability. The discussion was summarized in a proposal called the Paris proposal. Callahad later came up with an alternative proposal, which he dubbed the Goldilocks proposal, and in which he *referred to* watch as 'configure' and request as 'prompt', intending to avoid confusion. Funny enough, I thought part of the Goldilocks proposal was to *actually change* the APIs to configure/prompt (sigh) which motivated a lot of my concern in the previous email.
Yes, important point! We're not proposing new function names. We're proposing changing semantics on existing functions.
I still believe we can do this in a way that does not break existing users of watch and get, and does so with minimal backwards compatibility code. This belief is strengthened by the fact that we were able to "make ios7 work" and that's the environment that has restrictions that prevent everything except the subset that is goldilocks.
To explore this further, with dan in the Bulgaria Sessions, I started an experimental branch [1] to rip out everything obviated by the goldilocks proposal. My thinking was to aggressively reduce the footprint of include.js and the communication iframe, then make minimalistic changes elsewhere, and discover a couple things:
1. how well can goldilocks support existing users of get and watch?
2. how well does goldilocks deliver on the goals? (enumerated in paris, including reduced complexity, much faster load times)
My conclusion was that we could actually deliver goldilocks using the communication iframe in a much reduced capacity, and then as a next step we might be able to eliminate it all together. It feels extremely promising.
[1]:
https://github.com/mozilla/browserid/tree/goldilocks
> ### 'Paris' proposal
>
> Persona is stateful and "knows" if the user should be logged in or not. It will always automatically fire onlogin to try to enforce this, given the chance. (onlogout is removed)
>
> ### 'Goldilocks' proposal
>
> Persona is effectively stateless. It pretty much only works in response to direct user action.
>
>
> ## Paris vs Goldilocks, going a bit deeper
>
> Now that I understand it, I really like the simplicity of Goldilocks. Some other points Callahad mentioned (I'm running out of steam, just pasting out of IRC now):
>
> "Paris" still has full Persona-owned session management going on. Lloyd just wants Persona to stop calling onlogout automatically. (This would technically let us remove onlogout, and move that into a callback passed to .logout() directly). RPs would have to change all their stuff to only call .watch() when *they* don't think someone is logged in, but if they call .watch() and Persona thinks the user should be logged in, then Persona will automatically fire onlogin. So if you mess up your logout (only clearing your cookies, not calling id.logout), your users automatically get logged back in whenever they see your login form. (This happened to many RPs on their first attempt at integrating Persona.)
>
> Nice things about Goldilocks:
> 1) We can support existing .get() sites with *no* regressions purely in a 7 line client-side polyfill.
> 2) We can support existing Observer API sites with minimal regressions purely in a slightly longer client-side polyfill. The only things we would break are sites that expect require automatic session extension. (I don't know of any.)
/me is hopeful
> 3) We can tie this to the FxOS 1.3 release (March), which gives us the full, promised 6 month deprecation window
Yes. We need feedback from the native team on this. The thing that helps native folks with goldilocks is because of the simplified api, we can reduce our footprint in native environments, and drastically simplify and improve those implementations.
> The two big things we lose with Goldilocks are automatic session extension (Moz OpsSec wanted this) and cross-domain SSO. But we can't *really* deliver cross-domain SSO (realms) because of the upcoming localStorage / third party cookie changes being made by, well, everyone.
Back story: The usage of session extension in mozilla infrastructure was motivated by the desire for quick session revocation. The idea was with short sessions, upon disabling a user account, it would quickly (but not immediately) be the case that the device is locked out of all sites to which they no longer have access.
If we no longer have session extension, then for internal mozilla sites we will simply check our LDAP systems directly to see if the user account is still enabled and if session was started before a password change operation.
This gets us instantaneous session revocation, at the cost of less decoupling between individual applications and our authentication service, but pragmatically speaking, we're still much more decoupled. We still have the fantastic security property that user's LDAP passwords are typed into fewer places, and visible by less of our internally and externally hosted applications.
So it's still true that persona meaningfully improves the security of mozilla infrastructure.
> Also useful, Callahad put together a Goldilocks prototype, see [1]. Reading this cleared up some points for me.
>
>
> ## That's all folks
>
> Huge, huge thanks to Callahad for talking me through this at length.
>
> There are infinity other threads on the mailing list about this, but hopefully this summary helps people who, like me, were kinda lost about what the proposals were fundamentally all about.
Thanks again jared for digging deep and making this conversation (hopefully) more accessible to folks.
<3,
lloyd