<div dir="ltr"><p style="margin-right:0px;margin-bottom:15px;margin-left:0px;color:rgb(0,0,0);font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:15.454545021057129px;line-height:22.727272033691406px;margin-top:0px!important">
Hello,</p><p style="margin:15px 0px;color:rgb(0,0,0);font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:15.454545021057129px;line-height:22.727272033691406px">For [<a href="https://issues.jboss.org/browse/AGPUSH-209" rel="noreferrer" style="color:rgb(65,131,196);text-decoration:none">1</a>] I want to discuss a RESTful API for resetting the (Master)Secret of a PushApp and/or a Variant.</p>
<p style="margin:15px 0px;color:rgb(0,0,0);font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:15.454545021057129px;line-height:22.727272033691406px">Initially I&#39;d like to propose an empty PUT request against an &#39;reset&#39; endpoint, specific to the ID of the PushApp/Variant (see [<a href="http://staging.aerogear.org/docs/specs/aerogear-push-rest/PushApplication/" rel="noreferrer" style="color:rgb(65,131,196);text-decoration:none">2</a>] and [<a href="http://staging.aerogear.org/docs/specs/aerogear-push-rest/Variants/Android/" rel="noreferrer" style="color:rgb(65,131,196);text-decoration:none">3</a>]).</p>
<p style="margin:15px 0px;color:rgb(0,0,0);font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:15.454545021057129px;line-height:22.727272033691406px">To give a congrete example: Resetting the Secret of an Android Variant would result in a PUT against this URL:</p>
<pre style="font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:13px;line-height:19px;margin-top:15px;margin-bottom:15px;background-color:rgb(248,248,248);border:1px solid rgb(221,221,221);overflow:auto;padding:6px 10px;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;color:rgb(0,0,0)">
<code style="font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;line-height:normal;margin:0px;padding:0px;border:none;background-color:transparent;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">https://SERVER:PORT/CONTEXT/rest/applications/{pushApplicationID}/android/{variantID}/reset
</code></pre><p style="margin:15px 0px;color:rgb(0,0,0);font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:15.454545021057129px;line-height:22.727272033691406px">The CURL command would look like:</p><pre style="font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:13px;line-height:19px;margin-top:15px;margin-bottom:15px;background-color:rgb(248,248,248);border:1px solid rgb(221,221,221);overflow:auto;padding:6px 10px;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;color:rgb(0,0,0)">
<code style="font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;line-height:normal;margin:0px;padding:0px;border:none;background-color:transparent;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">curl -3 -v -H &quot;Accept: application/json&quot; -H &quot;Content-type: application/json&quot;
  -X PUT
https://SERVER:PORT/CONTEXT/rest/applications/{pushApplicationID}/android/{variantID}/reset
</code></pre><p style="margin:15px 0px;color:rgb(0,0,0);font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:15.454545021057129px;line-height:22.727272033691406px">The response body to that <em>PUT</em> request contain (JSON) details about the specific Android Variant (using Android as an example here):</p>
<pre style="font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:13px;line-height:19px;margin-top:15px;margin-bottom:15px;background-color:rgb(248,248,248);border:1px solid rgb(221,221,221);overflow:auto;padding:6px 10px;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;color:rgb(0,0,0)">
<code style="font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;line-height:normal;margin:0px;padding:0px;border:none;background-color:transparent;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">{
  &quot;id&quot;:&quot;402880e43fa95bb3013faf3c41b40005&quot;,
  &quot;name&quot;:&quot;Android App&quot;,
  &quot;description&quot;:&quot;The Android Variant&quot;,
  &quot;variantID&quot;:&quot;04e9f747-d256-4a24-a0ac-29b9a15e37b1&quot;,
  &quot;secret&quot;:&quot;70135d26-696d-426a-8183-e1fd0fcb86fe&quot;,
  &quot;developer&quot;:&quot;admin&quot;,
  &quot;instances&quot;:[],
  &quot;googleKey&quot;:&quot;My Google API Key&quot;,
  &quot;projectNumber&quot;:&quot;My Project Number / Sender ID&quot;
}
</code></pre><h3 style="margin:1em 0px 15px;padding:0px;line-height:1.7;font-size:1.5em;color:rgb(0,0,0);font-family:Helvetica,arial,freesans,clean,sans-serif"><a name="admin-ui" class="" href="https://gist.github.com/matzew/7d78eb091f6ca0fa01bb#admin-ui" style="color:rgb(65,131,196);text-decoration:none;display:block;padding-left:30px"><span class=""></span></a>Admin UI</h3>
<p style="margin:15px 0px;color:rgb(0,0,0);font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:15.454545021057129px;line-height:22.727272033691406px">On the Admin UI the <em>HTTP PUT</em> request could be triggered through a button, the actual execution would happen after giving &quot;approval&quot; on a &#39;confirmation&#39; button...</p>
<p style="margin:15px 0px;color:rgb(0,0,0);font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:15.454545021057129px;line-height:22.727272033691406px">On the long run, we could make it more &#39;complex&#39;, e.g. sending an email, containing an URL to give approval to the reset etc - but for now, I&#39;d like to keep the reset simple..</p>
<p style="margin:15px 0px;color:rgb(0,0,0);font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:15.454545021057129px;line-height:22.727272033691406px">Any thoughts ?</p><p style="margin:15px 0px;color:rgb(0,0,0);font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:15.454545021057129px;line-height:22.727272033691406px">
[1] <a href="https://issues.jboss.org/browse/AGPUSH-209" rel="noreferrer" style="color:rgb(65,131,196);text-decoration:none">https://issues.jboss.org/browse/AGPUSH-209</a><br><span style="font-size:15.454545021057129px;line-height:22.727272033691406px">[2]</span><span style="font-size:15.454545021057129px;line-height:22.727272033691406px"> </span><a href="http://staging.aerogear.org/docs/specs/aerogear-push-rest/PushApplication/" rel="noreferrer" style="font-size:15.454545021057129px;line-height:22.727272033691406px;color:rgb(65,131,196);text-decoration:none">http://staging.aerogear.org/docs/specs/aerogear-push-rest/PushApplication/</a><br>
<span style="font-size:15.454545021057129px;line-height:22.727272033691406px">[3]</span><span style="font-size:15.454545021057129px;line-height:22.727272033691406px"> </span><a href="http://staging.aerogear.org/docs/specs/aerogear-push-rest/Variants/Android/" rel="noreferrer" style="font-size:15.454545021057129px;line-height:22.727272033691406px;color:rgb(65,131,196);text-decoration:none">http://staging.aerogear.org/docs/specs/aerogear-push-rest/Variants/Android/</a></p>
<div><br></div><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>