<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 12, 2014 at 8:01 AM, Bruno Oliveira <span dir="ltr">&lt;<a href="mailto:bruno@abstractj.org" target="_blank">bruno@abstractj.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Not against JSON, but maybe worth to take a look at <a href="http://msgpack.org/" target="_blank">http://msgpack.org/</a></blockquote><div>hum interesting as well, indeed worth a look </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<span class=""><br>
On 2014-11-11, Lukáš Fryč wrote:<br>
&gt; On Tue, Nov 11, 2014 at 2:12 PM, Sebastien Blanc &lt;<a href="mailto:scm.blanc@gmail.com">scm.blanc@gmail.com</a>&gt;<br>
&gt; wrote:<br>
&gt;<br>
&gt; &gt; Hi,<br>
&gt; &gt;<br>
&gt; &gt; I would like to start a discussion around the import/export of<br>
&gt; &gt; installations in UPS. To track all the tasks, we have a ticket[1] also<br>
&gt; &gt; containing some sub-tasks.<br>
</span>&gt; &gt; &lt;<a href="https://gist.github.com/sebastienblanc/b863b80380f8ed16ad7b#scope" target="_blank">https://gist.github.com/sebastienblanc/b863b80380f8ed16ad7b#scope</a>&gt;Scope<br>
<span class="">&gt; &gt;<br>
&gt; &gt; For now we stick to installations, meanning we can import or export<br>
&gt; &gt; installations from a particular Variant. Import/Export for Variants will<br>
&gt; &gt; maybe come later but due to some security issues (mainly for iOS<br>
&gt; &gt; cert/passphrase) it&#39;s on hold.<br>
&gt; &gt;<br>
</span>&gt; &gt; &lt;<a href="https://gist.github.com/sebastienblanc/b863b80380f8ed16ad7b#import-service" target="_blank">https://gist.github.com/sebastienblanc/b863b80380f8ed16ad7b#import-service</a>&gt;Import<br>
<span class="">&gt; &gt; Service<br>
&gt; &gt;<br>
&gt; &gt; That&#39;s an easy one ;) since the service already exist [2]. It&#39;s a REST<br>
&gt; &gt; service and it uses the VariantId/Secret combination to authenticate.<br>
&gt; &gt;<br>
&gt; &gt; Data format looks like :<br>
&gt; &gt;<br>
&gt; &gt; [<br>
&gt; &gt;    {<br>
&gt; &gt;      &quot;deviceToken&quot; : &quot;someTokenString&quot;,<br>
&gt; &gt;      &quot;deviceType&quot; : &quot;iPad&quot;,<br>
&gt; &gt;      &quot;operatingSystem&quot; : &quot;iOS&quot;,<br>
&gt; &gt;      &quot;osVersion&quot; : &quot;6.1.2&quot;,<br>
&gt; &gt;      &quot;alias&quot; : &quot;someUsername or email adress...&quot;,<br>
&gt; &gt;      &quot;categories&quot; : [&quot;football&quot;, &quot;sport&quot;]<br>
&gt; &gt;    },<br>
&gt; &gt;    {<br>
&gt; &gt;      &quot;deviceToken&quot; : &quot;someOtherTokenString&quot;,<br>
&gt; &gt;      ...<br>
&gt; &gt;    },<br>
&gt; &gt;    ...<br>
&gt; &gt;  ]<br>
&gt; &gt;<br>
&gt; &gt;<br>
</span>&gt; &gt; &lt;<a href="https://gist.github.com/sebastienblanc/b863b80380f8ed16ad7b#export-service" target="_blank">https://gist.github.com/sebastienblanc/b863b80380f8ed16ad7b#export-service</a>&gt;Export<br>
<span class="">&gt; &gt; Service<br>
&gt; &gt;<br>
&gt; &gt; Like import, it will use the variantId/secret combo to authenticate and<br>
&gt; &gt; retrieve the right variant to export the installations. The data structure<br>
&gt; &gt; format would of course looks like the one used for import.<br>
</span>&gt; &gt; &lt;<a href="https://gist.github.com/sebastienblanc/b863b80380f8ed16ad7b#output-format" target="_blank">https://gist.github.com/sebastienblanc/b863b80380f8ed16ad7b#output-format</a>&gt;Output<br>
<span class="">&gt; &gt; format<br>
&gt; &gt;<br>
&gt; &gt; How should provide the exported data ? I need your input here 1. Raw Json<br>
&gt; &gt; ? 2. Json file ? 3. Zip / tarball ?<br>
&gt; &gt;<br>
&gt;<br>
&gt; Gzipped json file download sounds as easily accessible for browsers.<br>
&gt;<br>
</span>&gt; &gt; &lt;<a href="https://gist.github.com/sebastienblanc/b863b80380f8ed16ad7b#ui" target="_blank">https://gist.github.com/sebastienblanc/b863b80380f8ed16ad7b#ui</a>&gt;UI<br>
&gt; &gt;<br>
&gt; &gt; UI should be a *nice to have*<br>
<span class="">&gt; &gt;<br>
&gt; &gt; I would suggest to add 2 items (import and export) in the contextual menu<br>
&gt; &gt; that you can see in this screenshot :<br>
&gt; &gt;<br>
&gt; &gt;<br>
</span>&gt; &gt; &lt;<a href="https://camo.githubusercontent.com/94f19f69e50a217e89363aefe52912c9b33f6355/687474703a2f2f7331352e706f7374696d672e6f72672f6779626b72737a73622f696d706f72746578706f72742e706e67" target="_blank">https://camo.githubusercontent.com/94f19f69e50a217e89363aefe52912c9b33f6355/687474703a2f2f7331352e706f7374696d672e6f72672f6779626b72737a73622f696d706f72746578706f72742e706e67</a>&gt;<br>
<span class="">&gt; &gt;<br>
&gt; &gt; For import, the user will have a file input and feedback on how many<br>
&gt; &gt; installations were imported. For export, the user just have to press an<br>
&gt; &gt; export button<br>
&gt; &gt;<br>
&gt;<br>
&gt; +1 sounds good, we just need to decide whether block the user when<br>
&gt; uploading / downloading<br>
&gt;<br>
&gt; I guess:<br>
&gt;<br>
&gt; a) downloading - do not block UI, downloading is a separate activity<br>
&gt; b) uploading - block the UI, offer progress and error indication and<br>
&gt; ability to cancel the process (transactional? - cancelling means no<br>
&gt; installation is imported?)<br>
&gt;<br>
&gt;<br>
&gt; &gt;<br>
</span>&gt; &gt; &lt;<a href="https://gist.github.com/sebastienblanc/b863b80380f8ed16ad7b#migration-issues" target="_blank">https://gist.github.com/sebastienblanc/b863b80380f8ed16ad7b#migration-issues</a>&gt;Migration<br>
<span class="">&gt; &gt; issues<br>
&gt; &gt;<br>
&gt; &gt; So, that is a very important point that I would like to discuss. Even if<br>
</span>&gt; &gt; we are able to import installations, the *variantID_ and the<br>
&gt; &gt; __variantSecret* will not match with those that are in the Clients.<br>
<span class="">&gt; &gt;<br>
&gt; &gt; Imagine the following scenario : I export 15000 installations, my<br>
&gt; &gt; datacenter burns, I create a new UPS instance, with a new Push App and a<br>
&gt; &gt; new Variant (so new VariantID and VariantSecret), then I inport the<br>
&gt; &gt; installations. Well, my 15000 clients will point to the wrong variant. For<br>
&gt; &gt; sure, they can be updated but that might not always be an option.<br>
&gt; &gt;<br>
</span>&gt; &gt; That is why I would like suggest the following change : Make *VariantId*<br>
&gt; &gt;  and *VariantSecret* editable, so after someone has done an import he can<br>
<span class="">&gt; &gt; change the values of the variants so it matches the clients.<br>
&gt; &gt;<br>
&gt; &gt; I know we had this discussion before, but in the future we might want to<br>
&gt; &gt; change the naming around VariantId and VariantSecret, to me it sounds more<br>
</span>&gt; &gt; like *variantAPIKey* / *variantAPISecret*<br>
&gt; &gt;<br>
&gt; &gt; wdyt ?<br>
&gt; &gt; &lt;<a href="https://gist.github.com/sebastienblanc/b863b80380f8ed16ad7b#security" target="_blank">https://gist.github.com/sebastienblanc/b863b80380f8ed16ad7b#security</a>&gt;<br>
<span class="">&gt; &gt; Security<br>
&gt; &gt;<br>
&gt; &gt; As said before, import/export uses variantId/variantSecret to<br>
&gt; &gt; authenticate. So if someone has access to these keys he could make a<br>
&gt; &gt; malicious import of 500k installations. What should we do for that ? We<br>
&gt; &gt; could give this access only to authenticated &quot;console&quot; users but then it<br>
&gt; &gt; would be hard to expose import/export as rest service (because of KC<br>
&gt; &gt; implication)<br>
&gt; &gt;<br>
&gt; &gt; Please comment, ask questions , be crazy ...<br>
&gt; &gt;<br>
&gt; &gt; Sebi<br>
&gt; &gt;<br>
&gt; &gt; [1] <a href="https://issues.jboss.org/browse/AGPUSH-978" target="_blank">https://issues.jboss.org/browse/AGPUSH-978</a><br>
&gt; &gt;<br>
&gt; &gt; [2]<br>
&gt; &gt; <a href="http://aerogear.org/docs/specs/aerogear-unifiedpush-rest/registry/device/importer/index.html" target="_blank">http://aerogear.org/docs/specs/aerogear-unifiedpush-rest/registry/device/importer/index.html</a><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; &gt;<br>
<br>
&gt; _______________________________________________<br>
&gt; aerogear-dev mailing list<br>
&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
<br>
<br>
</span>--<br>
<br>
abstractj<br>
PGP: 0x84DC9914<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<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></div></div>