Closed
Bug 948034
Opened 12 years ago
Closed 12 years ago
popcorn uses "webmaker-sso" for include.js, rather than webmaker.org's include.js
Categories
(Webmaker Graveyard :: Popcorn Maker, defect)
Tracking
(Not tracked)
RESOLVED
INVALID
People
(Reporter: michiel, Assigned: michiel)
References
Details
The code for linking up the login/logout button for SSO on popcorn makes use of a version of include.js found in a node module. From server.js:
> "sso-include": path.resolve( __dirname, "node_modules/webmaker-sso/include" )
However, this file is distinct from, and not updated with, the real include.js found in webmaker.org/views/sso (which houses include.html and include.js).
The popcorn package.json lists this for webmaker-sso:
> "webmaker-sso": "https://github.com/jbuck/node-webmaker-sso/tarball/v0.0.4"
So I suspect this was a hack at some point that was put in place at some point to make the userbar easier to work with? Now that we're trying to lift out the userbar from our apps into a module, though, the fact that there is duplicated code is causing some problems for the lifting-effort in popcorn.
How much would be involved in making popcorn work with the proper webmaker.org version of include.js again?
Assignee: nobody → pomax
Status: NEW → ASSIGNED
Flags: needinfo?(schranz.m)
Flags: needinfo?(jon)
Comment 1•12 years ago
|
||
As Jon pointed out the other day in IRC the problem is our loading system and require. We need a clever way to rework it so it can all be loaded just fine!
Flags: needinfo?(schranz.m)
Comment 2•12 years ago
|
||
I think that we use require.js for builds because of i18n so we can probably just use it from bower again?
Flags: needinfo?(jon)
that would mean having sso-ux.js in login, incluce.html in webmaker.org, and include.js as a bower package. We're really trying our best to make this extremely hard to maintain =P
we can do a two-way in-client wait: if include.js is already loaded (feature detected), call yoSetThisStuffUp(), otherwise start a window.addEventListener("message", function(evt) { ifFromInclude -> yoSetThisStuffUp(); }) wait? Include.js can simply post an indiscriminate "I have been loaded now, you can do whatever you need to do" message so that everyone can use that "call or wait for" approach, and then we can make *that* snippet a bower component, while keeping include.js with include.html in webmaker.org?
Comment 5•12 years ago
|
||
(In reply to Mike "Pomax" Kamermans [:pomax] from comment #3)
> that would mean having sso-ux.js in login, incluce.html in webmaker.org, and
> include.js as a bower package. We're really trying our best to make this
> extremely hard to maintain =P
Yeah, I think we need to look at SSO more structurally than just moving some things into bower to really make things easier to maintain
I'd love to move the userbar.html template, the sso-ux.js connector, and a "use-or-wait-for" connector into the userbar bower component, and then have that template load webmaker.org's include.html (which loads include.js itself, and then fires off a postmessage that the userbar.html system waits for).
That way we have everything in two places: webmaker.org for the "this has to run on one domain, le always", and then everything else in bower. The real difficulty moving things around is CSRF; unless we have a way to server-to-server notify the login server that a user's session CSRF on, say, popcorn is a valid CSRF token for future over-http(s)-requests, things break pretty quickly.
new auth has invalidated this issue
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•