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.
:+1: perfect!

On Wednesday, October 22, 2014, Bruno Oliveira <notifications@github.com>
wrote:

> In servers/auth-server/src/main/webapp/WEB-INF/ups-realm.json:
>
> > @@ -28,6 +28,21 @@
> >              "realmRoles": [ "admin" ],
> >              "applicationRoles": {
> >                 "realm-management": [ "realm-admin" ],
> > +               "account": [ "manage-account" ]
> > +            }
> > +        },
> > +        {
> > +            "username" : "developer",
> > +            "enabled": true,
>
> @matzew <https://github.com/matzew> I'm ok with this, I just wanted to
> provide an easy way for people testing multiple roles
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/aerogear/aerogear-unifiedpush-server/pull/408/files#r19223756>
> .
>


-- 
Sent from Gmail Mobile