<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Oct 21, 2013 at 11:23 AM, Matthias Wessendorf <span dir="ltr">&lt;<a href="mailto:matzew@apache.org" target="_blank">matzew@apache.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><p style="line-height:22.727272033691406px;margin-right:0px;font-size:15.454545021057129px;margin-left:0px;margin-bottom:15px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin-top:0px!important">

Hello,</p><p style="line-height:22.727272033691406px;font-size:15.454545021057129px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px">For [<a href="https://issues.jboss.org/browse/AGPUSH-209" rel="noreferrer" style="color:rgb(65,131,196);text-decoration:none" target="_blank">1</a>] I want to discuss a RESTful API for resetting the (Master)Secret of a PushApp and/or a Variant.</p>
</div></blockquote><div style>Good idea ! </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">

<p style="line-height:22.727272033691406px;font-size:15.454545021057129px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px">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" target="_blank">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" target="_blank">3</a>]).</p>

<p style="line-height:22.727272033691406px;font-size:15.454545021057129px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px">To give a congrete example: Resetting the Secret of an Android Variant would result in a PUT against this URL:</p>

<pre style="background-color:rgb(248,248,248);border-top-left-radius:3px;margin-bottom:15px;padding:6px 10px;line-height:19px;border-top-right-radius:3px;font-size:13px;overflow:auto;border-bottom-right-radius:3px;font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;margin-top:15px;border:1px solid rgb(221,221,221);border-bottom-left-radius:3px">
<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="line-height:22.727272033691406px;font-size:15.454545021057129px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px">The CURL command would look like:</p><pre style="background-color:rgb(248,248,248);border-top-left-radius:3px;margin-bottom:15px;padding:6px 10px;line-height:19px;border-top-right-radius:3px;font-size:13px;overflow:auto;border-bottom-right-radius:3px;font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;margin-top:15px;border:1px solid rgb(221,221,221);border-bottom-left-radius:3px">
<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="line-height:22.727272033691406px;font-size:15.454545021057129px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px"></p></div></blockquote><div style>And resetting a PushApp will be of this form ? </div>
<div style><br></div><div style><pre style="font-size:13px;background-color:rgb(248,248,248);border-top-left-radius:3px;margin-bottom:15px;padding:6px 10px;line-height:19px;border-top-right-radius:3px;overflow:auto;border-bottom-right-radius:3px;font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;margin-top:15px;border:1px solid rgb(221,221,221);border-bottom-left-radius:3px">
<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}/reset</code></pre>
</div><div style>Does resetting a pushApp, implicitly reset the Variant Secret ? </div><div style> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><p style="line-height:22.727272033691406px;font-size:15.454545021057129px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px">The response body to that <em>PUT</em> request contain (JSON) details about the specific Android Variant (using Android as an example here):</p>
</div></blockquote><div style>Not sure if we have to return all the details ... Is returning the secret not enough ?  </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr">
<pre style="background-color:rgb(248,248,248);border-top-left-radius:3px;margin-bottom:15px;padding:6px 10px;line-height:19px;border-top-right-radius:3px;font-size:13px;overflow:auto;border-bottom-right-radius:3px;font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;margin-top:15px;border:1px solid rgb(221,221,221);border-bottom-left-radius:3px">
<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="line-height:1.7;font-size:1.5em;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:1em 0px 15px;padding:0px"><a name="141da5387793e5f6_admin-ui" href="https://gist.github.com/matzew/7d78eb091f6ca0fa01bb#admin-ui" style="color:rgb(65,131,196);text-decoration:none;display:block;padding-left:30px" target="_blank"><span></span></a>Admin UI</h3>

<p style="line-height:22.727272033691406px;font-size:15.454545021057129px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px">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="line-height:22.727272033691406px;font-size:15.454545021057129px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px">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="line-height:22.727272033691406px;font-size:15.454545021057129px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px">Any thoughts ?</p><p style="line-height:22.727272033691406px;font-size:15.454545021057129px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px">

[1] <a href="https://issues.jboss.org/browse/AGPUSH-209" rel="noreferrer" style="color:rgb(65,131,196);text-decoration:none" target="_blank">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" target="_blank">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" target="_blank">http://staging.aerogear.org/docs/specs/aerogear-push-rest/Variants/Android/</a></p>
<span class=""><font color="#888888">
<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>
</font></span></div>
<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><br></blockquote></div><br></div></div>