I believe this will be a significant advance in the capability of the Gadgets platform and would likely be adopted by gadget developers in droves...
A couple of notes....
- A declarative syntax for the gadget developer to specify additional OpenSocial data to be passed to their backend when the gadget server requests content would allow developers to eliminate a large proportion of RESTful requests from their backend to the container while generating content. This should be a significant latency win. It may be sensible to say that the request to fetch the gadget content from the developers backend will always be POST to accomodate a payload even if initial implementations dont have one.
- The model described here is essentially pull. We should also consider adding the ability for gadget developer backends to programatically invalidate the containers cache of content in response to user action. I would expect this to allow gadget developers to significantly reduce serving infrastructure.
Another interesting side-effect of this proposal is that content is generated with user specific data before it goes to the client, so in many cases it can be strictly HTML with no JS. For profile/showcase style gadgets this would allow them to be inlined safely and have reasonable functionality.
On Wed, Jul 30, 2008 at 7:28 PM, Kevin Brown <et...@google.com> wrote:
I don't think so. The gadget xml spec should suffice. Supporting
features in the html response will also complicate static analysis of
gadgets (e.g. gadget directory filtering).
> localization, [Unsure: This may not be necessary since lang / country are
> sent to the remote site anyway] and invocation of
> gadgets.util.runOnLoadHandlers
>
> 5. The container MUST treat the response as a fully formed, valid HTML 4
> document. This includes honoring the doctype and not adding any additional
> CSS [Unsure: Other than skinning features?].
What if the returned doctype is XHTML? Should the container honor the
doctype or always treat it as HTML 4?
6. All links in the response document MUST be interpreted as relative to the specified /Content/@href value. Additionally, /Content/@href MUST be interpreted relative to the xml document itself. [Unsure: There are a variety of ways to achieve this, including link rewriting, injecting HTML base elements, or javascript. A specific mechanism probably doesn't need to be specified.]
On Wed, Jul 30, 2008 at 7:28 PM, Kevin Brown <et...@google.com> wrote:
6. All links in the response document MUST be interpreted as relative to the specified /Content/@href value. Additionally, /Content/@href MUST be interpreted relative to the xml document itself. [Unsure: There are a variety of ways to achieve this, including link rewriting, injecting HTML base elements, or javascript. A specific mechanism probably doesn't need to be specified.]
Can you elaborate a bit more here? Will links be fetched by the container and have their content processed according to steps 1-5?
On Thu, Jul 31, 2008 at 9:34 AM, Arne Roomann-Kurrik <kur...@google.com> wrote:
On Wed, Jul 30, 2008 at 7:28 PM, Kevin Brown <et...@google.com> wrote:
6. All links in the response document MUST be interpreted as relative to the specified /Content/@href value. Additionally, /Content/@href MUST be interpreted relative to the xml document itself. [Unsure: There are a variety of ways to achieve this, including link rewriting, injecting HTML base elements, or javascript. A specific mechanism probably doesn't need to be specified.]
Can you elaborate a bit more here? Will links be fetched by the container and have their content processed according to steps 1-5?
Yes, that's exactly what I had in mind. The end result should be that clicking on a link in an app stays inside the app (unless it's specified as opening a new tab or something). Depending on container policy, there are many ways to do this:
- Rewrite the link to call requestNavigateTo
- Rewrite the link to be a valid proxied url (for example, a container such as Shindig that uses security tokens could automatically append the token to each link)
- Intercept the links when they are clicked and take some other action.
It's not completely clear to me at the moment whether all subsequent clicks need authorization as well, but it's probably easier to just assume that they do and carry the authentication type forward for all dependent requests. If the developer is using signed auth, and the user clicks a link that doesn't require any auth, they can always simply skip validation.
Further refinement on this will be needed, and I'm hesitant to lay down anything concrete until we've got working implementations.
On Thu, Jul 31, 2008 at 10:15 AM, Kevin Brown <et...@google.com> wrote:
On Thu, Jul 31, 2008 at 9:34 AM, Arne Roomann-Kurrik <kur...@google.com> wrote:
On Wed, Jul 30, 2008 at 7:28 PM, Kevin Brown <et...@google.com> wrote:
6. All links in the response document MUST be interpreted as relative to the specified /Content/@href value. Additionally, /Content/@href MUST be interpreted relative to the xml document itself. [Unsure: There are a variety of ways to achieve this, including link rewriting, injecting HTML base elements, or javascript. A specific mechanism probably doesn't need to be specified.]
Can you elaborate a bit more here? Will links be fetched by the container and have their content processed according to steps 1-5?
Yes, that's exactly what I had in mind. The end result should be that clicking on a link in an app stays inside the app (unless it's specified as opening a new tab or something). Depending on container policy, there are many ways to do this:
- Rewrite the link to call requestNavigateTo
- Rewrite the link to be a valid proxied url (for example, a container such as Shindig that uses security tokens could automatically append the token to each link)
- Intercept the links when they are clicked and take some other action.
It's not completely clear to me at the moment whether all subsequent clicks need authorization as well, but it's probably easier to just assume that they do and carry the authentication type forward for all dependent requests. If the developer is using signed auth, and the user clicks a link that doesn't require any auth, they can always simply skip validation.
Would the idea of a session identifier make sense here? I get a lot of developers wondering why $_SESSION doesn't work with content that is fetched via makeRequest - supplying a guid that tracks the current user would probably satisfy the development patterns they're used to without needing the overhead of signing each request.
Further refinement on this will be needed, and I'm hesitant to lay down anything concrete until we've got working implementations.
Reasonable. I'm +1 for the current draft, understanding that it may need to change as someone attempts to implement it. Are you aiming to include this into Shindig before adoption into the spec, then?
~Arne
On Wed, Jul 30, 2008 at 7:56 PM, Louis Ryan <lr...@google.com> wrote:I believe this will be a significant advance in the capability of the Gadgets platform and would likely be adopted by gadget developers in droves...
A couple of notes....
- A declarative syntax for the gadget developer to specify additional OpenSocial data to be passed to their backend when the gadget server requests content would allow developers to eliminate a large proportion of RESTful requests from their backend to the container while generating content. This should be a significant latency win. It may be sensible to say that the request to fetch the gadget content from the developers backend will always be POST to accomodate a payload even if initial implementations dont have one.
I agree with that -- where does this go though? Barring massive overhaul of the gadget xml (which I'm not necessarily opposed to) I don't see a clear way to put it in there. Perhaps we could extend Preload to support this?
+1 here.
On Jul 30, 7:56 pm, "Louis Ryan" <lr...@google.com> wrote:
> I believe this will be a significant advance in the capability of the
> Gadgets platform and would likely be adopted by gadget developers in
> droves...
>
> A couple of notes....
>
> - A declarative syntax for the gadget developer to specify additional
> OpenSocial data to be passed to their backend when the gadget server
> requests content would allow developers to eliminate a large proportion of
> RESTful requests from their backend to the container while generating
> content. This should be a significant latency win. It may be sensible to say
> that the request to fetch the gadget content from the developers backend
> will always be POST to accomodate a payload even if initial implementations
> dont have one.
>
Have we got the syntax nailed down?
How about details on :
1. What parameters are passed from container to the application server
when requesting views.
2. How it is passed, get/post, and so on.
On Sep 25, 11:33 am, "Kevin Brown" <e...@google.com> wrote:
> On Thu, Sep 25, 2008 at 8:19 PM, <chl1...@yahoo.com> wrote:-viewer guid
>
> > How about details on :
>
> > 1. What parameters are passed from container to the application server
> > when requesting views.
>
> This was mentioned earlier in the thread (sorry if it was lost). The
> proposed parameters to add were:
>
> - country (as in current spec for Locale elements)
> - lang (same)
> - parameters for authentication (same as for gadgets.io.makeRequest
> specification)
>
> If there are others that you think are important, please say so.
>
-owner guid
-oauth access token (used for calling back to container's RESTful
apis)
-oauth access token secret (used for calling back to container's
RESTful apis)
-user agent
-accept
Will proxied request be treated same as makeReqeust in term of sending
parameters? If so, that probably covers it.
This one is new, and I think unnecessary. OAuth for REST did not
(last time I looked) use an access token by default.
Instead the gadget home server uses two-legged OAuth to call into the
REST-ful APIs.
First question is why, second question is how.
Why? There is sufficient information on a two-legged OAuth call to
make all of the necessary authorization checks, OAuth access tokens
seems unnecessary.
How? How should the container site pass the OAuth access token to the
gadget home server when the gadget is first installed?
Totally agree with the approach, but a question: do "links" refer
strictly to anchor tags, or to all relative URLs (e.g IMG, SCRIPT)?
The language isn't clear. I strongly prefer the latter option.
-- Adam
Totally agree with the approach, but a question: do "links" refer
On Wed, Oct 1, 2008 at 4:49 PM, Kevin Brown <et...@google.com> wrote:
> Another addendum:
>
> For relative urls, I believe the following is most appropriate:
>
> - When the content in question came from a remote url (/Content/@href), use
> that url as the base.
> - When the content was inline in the gadget xml, use the gadget's url as the
> base.
>
> So, if I have this gadget at http://example.org/gadget.xml
>
> <Content view="profile"><a href="profile.html">Click here</a></Content>
> <Content view="canvas" href="/proxied/proxied.php"/>
>
> where proxied.php returns:
>
> <a href="canvas.html">Click here</a>
>
> The resolved urls become http://example.org/profile.html and
> http://example.org/proxied/canvas.html, respectively.
>
> This makes it easier to move the gadget, and many more existing applications
> / websites can become opensocial apps without additional work.
>
> Does anyone disagree with this approach?
strictly to anchor tags, or to all relative URLs (e.g IMG, SCRIPT)?
The language isn't clear. I strongly prefer the latter option.
I like this a lot, a few possible enhancements...
You should be able to send viewer / owner information without signing a request, so @sign_owner and @sign_viewer seem possibly limiting. Instead of sign_owner and sign_viewer, possibly we can have an @fields parameter with a comma delimited list of names of standard fields to send? Values would be "viewer", "owner", "lang", and "country" (added lang/country because provide no benefits unless developer is expecting them). Container would sign viewer/owner if @authz="signed" or "oauth"
On Wed, Nov 12, 2008 at 11:10 AM, Evan Gilbert <uid...@google.com> wrote:I like this a lot, a few possible enhancements...
You should be able to send viewer / owner information without signing a request, so @sign_owner and @sign_viewer seem possibly limiting. Instead of sign_owner and sign_viewer, possibly we can have an @fields parameter with a comma delimited list of names of standard fields to send? Values would be "viewer", "owner", "lang", and "country" (added lang/country because provide no benefits unless developer is expecting them). Container would sign viewer/owner if @authz="signed" or "oauth"
That's really an orthogonal problem. These values come directly from makeRequest semantics, and the intent is that the two be intrinsically linked. Having different behavior for different request types creates even more confusion.
Hi Kevin,
In the doc, you mentioned that POST body should be part of cache key. How can that happen? Usually post invalidates cache rather than being cached.
-Charlie