<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jul 25, 2014 at 2:49 PM, Karel Piwko <span dir="ltr">&lt;<a href="mailto:kpiwko@redhat.com" target="_blank">kpiwko@redhat.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Long term, we want an implementation that works on all servers. If some<br>
of them reject path params with &#39;/&#39;, we need to token encode it somehow.<br>
<br>
According to <a href="https://wiki.mozilla.org/WebAPI/SimplePush/Protocol" target="_blank">https://wiki.mozilla.org/WebAPI/SimplePush/Protocol</a> ,<br>
EndpointURL should be exposed to application. Which does not mean that<br>
it must be exposed to via UPS, right?</blockquote><div><br></div><div>It is not really exposed via UPS...</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 As UPS is *THE* application to<br>
which EndpointURL is exposed to.<br></blockquote><div><br></div><div>right, that&#39;s why we store it there :) In order to have the UPS trigger the updates (using the URL)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
UPS can translate {deviceToken} to EndpointURL. We just need a way how<br>
to generate unique {deviceToken} on client.</blockquote><div><br></div><div>that would be our own layer on-top, which is a no-go</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 Would UUID work?<br>
EndpointURL can become part of JSON [1].<br></blockquote><div><br></div><div>it was there as &quot;simplePushEndpoint&quot;, but for stated reasons it&#39;s now the deviceToken that has the URL value</div><div><br></div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Such change would mean that clients can&#39;t use SP server directly but<br>
have to go through UPS. This makes more sense then current setup to me.<br></blockquote><div><br></div><div>not really</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
Karel<br>
<br>
[1]<br>
<a href="https://github.com/aerogear/aerogear-unifiedpush-server/blob/master/jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/installations/InstallationRegistrationEndpoint.java#L74" target="_blank">https://github.com/aerogear/aerogear-unifiedpush-server/blob/master/jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/installations/InstallationRegistrationEndpoint.java#L74</a><br>

<div class="HOEnZb"><div class="h5"><br>
On Fri, Jul 25, 2014 at 1:04 PM, Matthias Wessendorf<br>
&lt;<a href="mailto:matzew@apache.org">matzew@apache.org</a>&gt; wrote:<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Fri, Jul 25, 2014 at 12:25 PM, Tadeas Kriz &lt;<a href="mailto:tkriz@redhat.com">tkriz@redhat.com</a>&gt;<br>
&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; —<br>
&gt;&gt; Tadeas Kriz<br>
&gt;&gt;<br>
&gt;&gt; On 25 Jul 2014, at 11:04 am, Daniel Bevenius<br>
&gt;&gt; &lt;<a href="mailto:daniel.bevenius@gmail.com">daniel.bevenius@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt; &gt;5. don’t use the url as a deviceToken (might not comply with<br>
&gt;&gt;&gt; Mozzila’s SimplePush specs)<br>
&gt;&gt;&gt; The deviceToken is an UPS concept and there is nothing in the<br>
&gt;&gt;&gt; SimplePush spec which is violated in this case.<br>
&gt;&gt;&gt;<br>
&gt;&gt; I thought that deviceTokens were changed from a generated value to<br>
&gt;&gt; the URL just to comply with Mozzila’s SimplePush specs.<br>
&gt;<br>
&gt; Nope<br>
&gt;<br>
&gt;&gt; Matzew, why was the generated token removed then?<br>
&gt;<br>
&gt; It was the channelID before - but that should not be exposed.<br>
&gt; In GCM devices are identified via registrationID<br>
&gt; In APNs devices are identified va deviceToken<br>
&gt; (both are somewhat the same - but different names)<br>
&gt;<br>
&gt; In SimplePush devices are identifeid v/ the URL of the pushEndpoint<br>
&gt; (a backend uses that endpoint to notify _THAT_ client, regardless of<br>
&gt; how many channels it has subscribed)<br>
&gt;<br>
&gt; So, that lead us to make the change (see history of this threa)<br>
&gt;<br>
&gt; -M<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt;&gt; I&#39;m not sure about what the best option is for UPS thought. Would a<br>
&gt;&gt;&gt; regex in for the @Path annotation work perhaps, something like:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; @DELETE<br>
&gt;&gt;&gt; @Path(&quot;{token, .+}&quot;)<br>
&gt;&gt;&gt; public Response unregisterInstallations(<br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; What do you mean by that regex? The problem is simply the “%2F”<br>
&gt;&gt; in the token (which is an URLencoded simplepush url) and it’s<br>
&gt;&gt; being revoked long before it hits the RestEasy (which does the<br>
&gt;&gt; routing according to what’s in the @Path).<br>
&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On 25 July 2014 10:32, Tadeas Kriz &lt;<a href="mailto:tkriz@redhat.com">tkriz@redhat.com</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; —<br>
&gt;&gt;&gt;&gt; Tadeas Kriz<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; On 24 Jul 2014, at 05:44 pm, Karel Piwko &lt;<a href="mailto:kpiwko@redhat.com">kpiwko@redhat.com</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt; On Thu, Jul 24, 2014 at 3:28 PM, Tadeas Kriz &lt;<a href="mailto:tkriz@redhat.com">tkriz@redhat.com</a>&gt;<br>
&gt;&gt;&gt;&gt; wrote:<br>
&gt;&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt;&gt; It should not. For hibernate, it’s just a string like any<br>
&gt;&gt;&gt;&gt; other.<br>
&gt;&gt;&gt;&gt; &gt;&gt; The problem might be in the configuration of <a href="http://JAX.RS/RestEasy" target="_blank">JAX.RS/RestEasy</a>. If<br>
&gt;&gt;&gt;&gt; &gt;&gt; I’ll have some time today evening, I’ll try to fix it, it<br>
&gt;&gt;&gt;&gt; should<br>
&gt;&gt;&gt;&gt; &gt;&gt; be an easy fix.<br>
&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt; &gt; Last famous words? ;-)<br>
&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; I shall never say “an easy fix” again.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt; But I agree. Everything is string and URL encode should happen on<br>
&gt;&gt;&gt;&gt; &gt; client while server should automatically decode and work always<br>
&gt;&gt;&gt;&gt; with<br>
&gt;&gt;&gt;&gt; &gt; just decoded string. If we need to encode twice, something is<br>
&gt;&gt;&gt;&gt; wrong.<br>
&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Anyway, the 400 Bad request response is made by the tomcat itself,<br>
&gt;&gt;&gt;&gt; disallowing the use of %2F as a path parameter. This will probably<br>
&gt;&gt;&gt;&gt; apply on other web containers.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Possible solutions with their disadvantages:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; 1. well-documented double-encoding of the URL (might be confusing)<br>
&gt;&gt;&gt;&gt; 2. use @QueryParam instead of @PathParam (breaks the api<br>
&gt;&gt;&gt;&gt; consistence, as every other call would still use @PathParam)<br>
&gt;&gt;&gt;&gt; 3. allow @QueryParam (again, breaks the api consistence, but only<br>
&gt;&gt;&gt;&gt; for the SimplePush)<br>
&gt;&gt;&gt;&gt; 4. find another encoding (Base64 for URL = URLEncode then Base64<br>
&gt;&gt;&gt;&gt; encode)<br>
&gt;&gt;&gt;&gt; 5. don’t use the url as a deviceToken (might not comply with<br>
&gt;&gt;&gt;&gt; Mozzila’s SimplePush specs)<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; What do you think guys?<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt; &gt; _______________________________________________<br>
&gt;&gt;&gt;&gt; &gt; aerogear-dev mailing list<br>
&gt;&gt;&gt;&gt; &gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt; &gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt;&gt; aerogear-dev mailing list<br>
&gt;&gt;&gt;&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt; aerogear-dev mailing list<br>
&gt;&gt;&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; aerogear-dev mailing list<br>
&gt;&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Matthias Wessendorf<br>
&gt;<br>
&gt; blog: <a href="http://matthiaswessendorf.wordpress.com/" target="_blank">http://matthiaswessendorf.wordpress.com/</a><br>
&gt; sessions: <a href="http://www.slideshare.net/mwessendorf" target="_blank">http://www.slideshare.net/mwessendorf</a><br>
&gt; twitter: <a href="http://twitter.com/mwessendorf" target="_blank">http://twitter.com/mwessendorf</a><br>
<br>
<br>
_______________________________________________<br>
aerogear-dev mailing list<br>
<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Matthias Wessendorf <br>
<br>blog: <a href="http://matthiaswessendorf.wordpress.com/" target="_blank">http://matthiaswessendorf.wordpress.com/</a><br>sessions: <a href="http://www.slideshare.net/mwessendorf" target="_blank">http://www.slideshare.net/mwessendorf</a><br>
twitter: <a href="http://twitter.com/mwessendorf" target="_blank">http://twitter.com/mwessendorf</a>
</div></div>