<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
A little of both.  Serving JS, et al from a CDN for a set of domain services is easy peasey stuff and we do it all the time... but we tend to do so with a common edge (at the very least in DNS space) that precludes the need for JSONP/CORS.  I'm not sure if the use case here is:<br><br>1) JS client talking to multiple service providers hosting openstack, (seems low priority to me but potentially valid)<br>2) JS client talking to multiple openstack services within a single hosting provider (seems high priority to me)<br><br>#2 is easy we do it all the time.  #1 gets messy but I probably wouldn't just use a JS only mashup client to get the job done.  <br><br>Anyway, just thoughts...  re maturity:  our enterprise security folks have issues with using jsonp/cors and consider it contraindicated at the moment.<br><br><br><br>Jan<br><br><br><div><div id="SkyDrivePlaceholder"></div><hr id="stopSpelling">Subject: Re: [Openstack] Using Nova APIs from Javascript: possible?<br>From: tres@treshenry.net<br>Date: Wed, 25 Apr 2012 09:49:15 -0700<br>CC: openstack@lists.launchpad.net<br>To: jan_drake@hotmail.com<br><br>Jan: is the concern that you don't see the value in the use case or that you don't believe the proposed technologies are sufficiently mature?<div><br></div><div>In order to keep the thread somewhat linear I'm basically going to +1 what Nick said and add that as an application developer I should be able to serve the JS, HTML and CSS for my application from a CDN and have my application talk directly to an OpenStack endpoint. This is an important scenario now but will become critical with the wave of PAAS offerings coming for OpenStack (i.e. my application should be able to talk directly to FathomDB running on OS).</div><div><br></div><div><div><br><div><div>On Apr 25, 2012, at 3:46 AM, Nick Lothian wrote:</div><br class="ecxApple-interchange-newline"><blockquote>JSONP has been used for years - for example Solr has supported it since 2008 (and possibly earlier). CORS matches the Openstack APIs better though. <BR>Redirects are unrelated to the problem as far as I can see.<BR>I think that toolmakers trying to build Javascript tools that connect to multiple service providers is a completely valid use case. It is supported for pretty much any other language, why not Javascript?<BR>
<div class="ecxgmail_quote">On Apr 25, 2012 12:33 PM, "Jan Drake" <<a href="mailto:jan_drake@hotmail.com">jan_drake@hotmail.com</a>> wrote:<br><blockquote class="ecxgmail_quote" style="border-left:1px #ccc solid;padding-left:1ex">
<div><div>So, why such a focus on this?  IMO both JSONP and CORS are way too early stage to adopt and the security risks outweigh the rewards.  Usually, I see people doing this to enable mashups across separate providers.</div>
<div><br></div><div>Just curious why the focus/need is perceived in the community?  If this is really because of redirects then we probably have a broken model and/or improper distribution of responsibilities.</div><div><br>
</div><div>Love to know if I'm missing a real use case.  Can help fix model if it is broken.  Have much experience in this area.</div><div><br></div><div>IMO no solution should trick the browser.</div><div><br></div><div>
<br></div><div>Jan</div><div><br><br></div><div><br>On Apr 24, 2012, at 7:05 PM, Luis Gervaso <<a href="mailto:luis@woorea.es">luis@woorea.es</a>> wrote:<br><br></div><div></div><blockquote>
<div><div class="ecxgmail_extra">The solution until the webservice deliver that headers is:<br><br>Solution 1:<br><br>1. Put the webservice behind a remote or local proxy<br>2. Apply some a filter (decorator) for each response with the CORS headers (in the proxy) in order to trick the browser<br>

<br>Solution 2:<br><br>Some time ago I tested it with Chrome (disabling security) and it worked for me<br><br>Solution 3 (really dirty, but works):<br><br>Embedded Flash Proxy<br><br><br><div class="ecxgmail_quote">On Wed, Apr 25, 2012 at 3:09 AM, Nick Lothian <span dir="ltr"><<a href="mailto:nick.lothian@gmail.com">nick.lothian@gmail.com</a>></span> wrote:<br>

<blockquote class="ecxgmail_quote" style="border-left:1px #ccc solid;padding-left:1ex">Yes, this will work if I know in advance what server I will be connecting too.<BR>However, it does remove the ability to support any cloud without intervention on the serverside. <BR><div><div>
<div class="ecxgmail_quote">On Apr 25, 2012 2:46 AM, "Joel Semar" <<a href="mailto:semarjt@gmail.com">semarjt@gmail.com</a>> wrote:<br><blockquote class="ecxgmail_quote" style="border-left:1px #ccc solid;padding-left:1ex">


<div class="ecxgmail_extra">Nick,</div><div class="ecxgmail_extra"><br></div><div class="ecxgmail_extra">I know you said 'serverless clients' but you have to be serving the js from somewhere right?</div><div class="ecxgmail_extra">



<br></div><div class="ecxgmail_extra">If you are using nginx it can be as simple as:</div><div class="ecxgmail_extra"><br></div><div class="ecxgmail_extra">location /nova/ {</div><div class="ecxgmail_extra">   proxy_pass: <a href="http://nova-api.trystack.org/" target="_blank">http://nova-api.trystack.org</a>;</div>



<div class="ecxgmail_extra">}</div><div class="ecxgmail_extra"><br></div><div class="ecxgmail_extra">then you can POST to yourserver/nova/v.02/.  from the browser</div><div class="ecxgmail_extra"><br></div><div class="ecxgmail_extra">etc.</div>



<div class="ecxgmail_extra">(it's just about as simple on apache but you'd have to look it up)</div><div class="ecxgmail_extra"><br></div><div class="ecxgmail_extra"><br></div><div class="ecxgmail_extra">But then i guess this won't work for you if you are writing some distributable component/plugin/library.</div>



<div class="ecxgmail_extra"><br></div><div class="ecxgmail_extra">(sorry if you've already dismissed this option but i thought it worth a shot since it has worked flawlessly for me in the past)</div><div class="ecxgmail_extra">



<br></div><div class="ecxgmail_extra"><br><br><div class="ecxgmail_quote">On Tue, Apr 24, 2012 at 9:49 AM, Sandy Walsh <span dir="ltr"><<a href="mailto:sandy.walsh@rackspace.com">sandy.walsh@rackspace.com</a>></span> wrote:<br>



<blockquote class="ecxgmail_quote" style="border-left:1px #ccc solid;padding-left:1ex"><div><br>
<br>
On 04/24/2012 11:19 AM, Nick Lothian wrote:<br>
> JSONP is great, but won't work with POST requests.<br>
<br>
</div>Hmm, good point.<br>
<div><br>
> I don't quite understand what "Due to the redirect nature of the auth<br>
> system" means, though.<br>
><br>
> If I use a custom Webkit browser & allow cross domain XMLHttpRequests it<br>
> works fine - I do a POST to /v2.0/tokens, get the token and then use<br>
> that. What am I missing?<br>
<br>
</div>The Auth system will give you a token and then a new "management" url<br>
where the actual commands are issued (the real Nova API endpoint). These<br>
are often two different systems (domains), so cross-site requests are<br>
mandatory.<br>
<br>
-S<br>
<div><br>
<br>
<br>
> Nick<br>
><br>
> On Tue, Apr 24, 2012 at 8:57 PM, Sandy Walsh <<a href="mailto:sandy.walsh@rackspace.com">sandy.walsh@rackspace.com</a><br>
</div><div>> <mailto:<a href="mailto:sandy.walsh@rackspace.com">sandy.walsh@rackspace.com</a>>> wrote:<br>
><br>
>     Due to the redirect nature of the auth system we may need JSONP support<br>
>     for this to work.<br>
><br>
><br>
><br>
>     _______________________________________________<br>
>     Mailing list: <a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/~openstack</a><br>
>     Post to     : <a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><br>
</div>>     <mailto:<a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a>><br>
<div><div>>     Unsubscribe : <a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/~openstack</a><br>
>     More help   : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><br>
><br>
><br>
><br>
><br>
> _______________________________________________<br>
> Mailing list: <a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/~openstack</a><br>
> Post to     : <a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><br>
> Unsubscribe : <a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/~openstack</a><br>
> More help   : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><br>
<br>
_______________________________________________<br>
Mailing list: <a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/~openstack</a><br>
Post to     : <a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><br>
Unsubscribe : <a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/~openstack</a><br>
More help   : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Cheers,<div><br></div><div>Joel</div><br>
</div>
<br>_______________________________________________<br>
Mailing list: <a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/~openstack</a><br>
Post to     : <a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><br>
Unsubscribe : <a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/~openstack</a><br>
More help   : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><br>
<br></blockquote></div>
</div></div><br>_______________________________________________<br>
Mailing list: <a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/~openstack</a><br>
Post to     : <a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><br>
Unsubscribe : <a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/~openstack</a><br>
More help   : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>-------------------------------------------<br>Luis Alberto Gervaso Martin<div>Woorea Solutions, S.L<br>CEO & CTO<br>mobile: <a target="_blank">(+34) 627983344</a><br>
<a href="mailto:luis.gervaso@gmail.com">luis@</a><a href="http://woorea.es/" target="_blank">woorea.es</a></div>
<br>
</div>
</div></blockquote><blockquote><div><span>_______________________________________________</span><br><span>Mailing list: <a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/~openstack</a></span><br>
<span>Post to     : <a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a></span><br><span>Unsubscribe : <a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/~openstack</a></span><br>
<span>More help   : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a></span><br></div></blockquote></div></blockquote></div>
_______________________________________________<br>Mailing list: <a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/~openstack</a><br>Post to     : <a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><br>Unsubscribe : <a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/~openstack</a><br>More help   : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><br></blockquote></div><br></div></div></div>                                         </div></body>
</html>