<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Apr 15, 2013 at 2:05 PM, 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">Hi Sebi, I think this is a good idea, here comes few suggestion:<br>
<br>
* Replace create* for the entity only, into a scaffolding domain we assume that the user is willing to generate ALL the things. So for example: { &quot;security&quot;: &quot;users&quot; :[&quot;sebi&quot;,&quot;abtractj&quot;], //1 &quot;role&quot; :[&quot;simple&quot;,&quot;admin&quot;], //2 &quot;roleMap&quot;<br>

<br></blockquote><div style>You mean creating users/role just for a particular entity ? Sorry I think I did not understand well this remark. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

* generateLoginForm and generateOTPPage. I&#39;d replace by otp: true, login: true. Why? In our scenario doesn&#39;t exist jsp pages only, but also endpoints for it. I&#39;m not specialist in this scaffolding topic, but my idea is: if the user specify true generate pages &amp; endpoints, if they don&#39;t want jsp pages, just delete it.<br>
</blockquote><div><br></div><div style>Right, I have this idea just after sending the email, one thing should be &quot;loginForm&quot;:&quot;otp&quot;|&quot;classic&quot; </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
* Would be nice if we could provide an alternative to specify something more general for authentication/authorization, for example (ignore my poor scaffolding skills):<br>
<br>
<a href="https://gist.github.com/abstractj/ed6676b3106929cc23b0" target="_blank">https://gist.github.com/abstractj/ed6676b3106929cc23b0</a>. And something which allows me to specify the exception, for example: &quot;I want all of my endpoints requiring authentication, except the login endpoint.<br>
</blockquote><div><br></div><div style>+1, invert the config, let me think on how we could define this in a clear way </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
* You probably know about it, but just a reminder. Don&#39;t forget about configuration files from PicketLink (this would be something nice to be scaffolded). Maybe allow devs to specify persistence provider or database? For example: I want to use PicketLink with MySQL.<br>
</blockquote><div><br></div><div style>+1, you could help me on this by providing me a complete list on the values and the locations that we could change, this way I can integrate it to the config.  </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
Overall looks good.<br></blockquote><div style>Abstractj++ for the feedback !!  </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
--<br>
&quot;The measure of a man is what he does with power&quot; - Plato<br>
-<br>
@abstractj<br>
-<br>
Volenti Nihil Difficile<br>
<div class="im"><br>
<br>
<br>
On Monday, April 15, 2013 at 6:35 AM, Sebastien Blanc wrote:<br>
<br>
&gt; Good Morning !<br>
&gt; I&#39;ve been thinking about Security Scaffolding. It&#39;s a different beast than a simple CRUD scaffolding. It&#39;sa bit more difficult to make assumption when you want to generate security flows : which http method to protect ? using only authentification or also authorization ? etc ...<br>

&gt;<br>
&gt; Therefore, I&#39;ve been thinking of some kind of configuration that the user could provide before the scaffolding process. Keeping it really simple and &quot;human readable&quot; and that could really speed up setting up the security layer :<br>

&gt;<br>
&gt;<br>
&gt; { &quot;security&quot;: &quot;createUsers&quot; :[&quot;sebi&quot;,&quot;abtractj&quot;], //1 &quot;createRole&quot; :[&quot;simple&quot;,&quot;admin&quot;], //2 &quot;roleMap&quot;: [&quot;simple&quot;:[&quot;abstractj&quot;,&quot;sebi&quot;],&quot;admin&quot;:[&quot;sebi&quot;]], //3 &quot;generateLoginForm&quot; : true, //4 &quot;generateOTPPage&quot; : true, //5 &quot;entities&quot; : { //6 &quot;org.sebi.Task&quot; : { &quot;GET&quot;: { &quot;authentification&quot; : false }, &quot;POST&quot;: { &quot;authentification&quot; : true, &quot;authorization&quot; : &quot;simple&quot; }, &quot;PUT&quot;: { &quot;authentification&quot; : true, &quot;authorization&quot; : &quot;admin&quot; }, &quot;DELETE&quot;: { &quot;authentification&quot; : true, &quot;authorization&quot; : &quot;admin&quot; } } } }<br>

&gt;<br>
&gt; Let me detail each of these points to make the discussion easier :<br>
&gt;<br>
&gt; * 1. createUSers : We pass a list of users that we be inserted into the db : this will generate or a SQL script or a class creating the users like in <a href="https://github.com/aerogear/aerogear-controller-demo/blob/master/src/main/java/org/jboss/aerogear/controller/demo/config/PicketLinkDefaultUsers.java" target="_blank">https://github.com/aerogear/aerogear-controller-demo/blob/master/src/main/java/org/jboss/aerogear/controller/demo/config/PicketLinkDefaultUsers.java</a><br>

</div>&gt; (<a href="https://github.com/aerogear/aerogear-controller-demo/blob/master/src/main/java/org/jboss/aerogear/controller/demo/config/PicketLinkDefaultUsers.java" target="_blank">https://github.com/aerogear/aerogear-controller-demo/blob/master/src/main/java/org/jboss/aerogear/controller/demo/config/PicketLinkDefaultUsers.java</a>)<br>

<div class="im">&gt;<br>
&gt; * 2. createAdmin : We pass a list of roles that we be inserted into the db : this will generate or a SQL script or a class creating the users like in <a href="https://github.com/aerogear/aerogear-controller-demo/blob/master/src/main/java/org/jboss/aerogear/controller/demo/config/PicketLinkDefaultUsers.java" target="_blank">https://github.com/aerogear/aerogear-controller-demo/blob/master/src/main/java/org/jboss/aerogear/controller/demo/config/PicketLinkDefaultUsers.java</a><br>

&gt;<br>
&gt; * 3. roleMap : We create here an association map between users and roles : this will generate or a SQL script or a class creating the users like in <a href="https://github.com/aerogear/aerogear-controller-demo/blob/master/src/main/java/org/jboss/aerogear/controller/demo/config/PicketLinkDefaultUsers.java" target="_blank">https://github.com/aerogear/aerogear-controller-demo/blob/master/src/main/java/org/jboss/aerogear/controller/demo/config/PicketLinkDefaultUsers.java</a><br>

&gt;<br>
</div>&gt; (<a href="https://github.com/aerogear/aerogear-controller-demo/blob/master/src/main/java/org/jboss/aerogear/controller/demo/config/PicketLinkDefaultUsers.java" target="_blank">https://github.com/aerogear/aerogear-controller-demo/blob/master/src/main/java/org/jboss/aerogear/controller/demo/config/PicketLinkDefaultUsers.java</a>)<br>

<div class="im">&gt; * 4. generateLoginForm : if true, the UI scaffolding will also generate a login form (location and layout depending on the scaffolding provider (AngularJS+Bootstrap, AngularJS+JQM) or by providing a custom template fragment.<br>

&gt;<br>
&gt; * 5. generateOTPPage : if true, the UI scaffolding will also generate a OTP page (location and layout depending on the scaffolding provider (AngularJS+Bootstrap, AngularJS+JQM) or by providing a custom template fragment.<br>

&gt;<br>
&gt; * 6. Entities : Here we configure the security flow for each entity per HTTP methods. Concretely, this will mean :<br>
&gt; - On the backend, generate the right route, i.e :<br>
&gt; route().from(&quot;/task&quot;).roles(&quot;admin&quot;).on(RequestMethod.DELETE).to(Task.class).delete();<br>
&gt;<br>
&gt; - On the frontend, setting the flag or not on a pipe to enable auth. Other option are possible, liking hiding links, disabling button depending on the authorization/authnetification. We should discuss these options.<br>

&gt;<br>
&gt; I think it could be a nice addition, and from the feedback I&#39;ve heard, this kind of feature really misses today in the current scaffolding tools regarding security. This could be really a killing feature and not hard to implement.<br>

&gt;<br>
&gt; Please comment, ask questions to polish the feature !<br>
&gt;<br>
&gt; Seb<br>
&gt;<br>
&gt;<br>
</div>&gt; _______________________________________________<br>
&gt; aerogear-dev mailing list<br>
&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a> (mailto:<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>
<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>