<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Oct 21, 2013 at 11:36 AM, Sebastien Blanc <span dir="ltr"><<a href="mailto:scm.blanc@gmail.com" target="_blank">scm.blanc@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote"><div class="im">On Mon, Oct 21, 2013 at 11:23 AM, Matthias Wessendorf <span dir="ltr"><<a href="mailto:matzew@apache.org" target="_blank">matzew@apache.org</a>></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><div>Good idea ! </div><div class="im"><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'd like to propose an empty PUT request against an 'reset' 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,'Liberation Mono',Courier,monospace;margin-top:15px;border:1px solid rgb(221,221,221);border-bottom-left-radius:3px">
<code style="font-family:Consolas,'Liberation Mono',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,'Liberation Mono',Courier,monospace;margin-top:15px;border:1px solid rgb(221,221,221);border-bottom-left-radius:3px">
<code style="font-family:Consolas,'Liberation Mono',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 "Accept: application/json" -H "Content-type: application/json"
-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><div>And resetting a PushApp will be of this form ? </div>
<div><br></div><div><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,'Liberation Mono',Courier,monospace;margin-top:15px;border:1px solid rgb(221,221,221);border-bottom-left-radius:3px">
<code style="font-family:Consolas,'Liberation Mono',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></div></div></div></div></blockquote><div><br></div><div>yes, exactly - that's the pattern</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Does resetting a pushApp, implicitly reset the Variant Secret ? </div></div></div></div></blockquote><div><br></div><div><br></div><div>Not sure, but I guess nope.</div>
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div class="im"><div> </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><div>Not sure if we have to return all the details ... Is returning the secret not enough ? </div></div></div></div></blockquote><div><br></div><div><br></div><div>Returning just the secret would be OK for me; but does not hurt too much, if we return the entire object</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><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 class="im">
<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,'Liberation Mono',Courier,monospace;margin-top:15px;border:1px solid rgb(221,221,221);border-bottom-left-radius:3px">
<code style="font-family:Consolas,'Liberation Mono',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">{
"id":"402880e43fa95bb3013faf3c41b40005",
"name":"Android App",
"description":"The Android Variant",
"variantID":"04e9f747-d256-4a24-a0ac-29b9a15e37b1",
"secret":"70135d26-696d-426a-8183-e1fd0fcb86fe",
"developer":"admin",
"instances":[],
"googleKey":"My Google API Key",
"projectNumber":"My Project Number / Sender ID"
}
</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="141da604e8a5a1e1_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 "approval" on a 'confirmation' 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 'complex', e.g. sending an email, containing an URL to give approval to the reset etc - but for now, I'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><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></div>_______________________________________________<br>
aerogear-dev mailing list<br>
<a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">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>
<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><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>