AGSEC-183 - UPS user management with Keycloak

@kpiwko @matzew @qmx @danielpassos @sebastienblanc @danbev @edewit You are all invited to review.

This PR contains several changes, so I would like to borrow your brain on it. It relates to https://github.com/aerogear/aerogear-unifiedpush-server/pull/399 and https://issues.jboss.org/browse/AGPUSH-697.

For testing:

Good morning, this is related with the super user Jira. For testing:

user: admin
password: 123 
user: developer
password: developer

Flows to test:

Login as admin, create several applications, then logout. Login as developer and check if you can see admin's applications. (they should not be available to developer)
Login as developer, create several applications, then logout. Login as admin and check if you can see developer's and admin applications (they should be there)
Go to http://localhost:8080/auth/admin/aerogear/console/index.html# and try to login as admin
Go to http://localhost:8080/auth/admin/aerogear/console/index.html# and try to login as developer (it should be forbidden)

It contains:

- The application management for developer/admin profiles
- Refactoring to remove duplicates from the endpoints
- Producers to provide a centralized class to deal with multiple roles

One of the benefits which I can see here is: if we want to separate admin actions from regular developer actions, now it's pretty much possible.

Note: 

1. I tested several workflows to guarantee that everything is working, but like a good human, something can be wrong.
2. This is not the super best API design, so feedback is welcome.
3. This pull-request should go into 1.0.x branch and master.
If you have the snippet with what you mean or want to provide a pull request against me repo. Go ahead.



—

abstractj
PGP: 0x84DC9914

On Wed, Oct 22, 2014 at 1:18 PM, Erik Jan de Wit <notifications@github.com>
wrote:

>> @@ -38,15 +42,18 @@
>>      @Inject
>>      private PushMessageInformationDao pushMessageInformationDao;
>>  
>> +    @Inject
>> +    @LoggedIn
>> +    private Instance<String> principalName;
> I'm not entirely sure, but this could be replaced by `private String principalName` to avoid all the `get()` methods right?
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/aerogear/aerogear-unifiedpush-server/pull/408/files#r19220378