Clone the repository in folder do you prefer
cd /var/www
git clone https://github.com/luk4z7/middleware-aclExecute the file init.sh for up the docker containers
https://github.com/luk4z7/middleware-acl for the canonical source repository
Lucas Alves 2017 (c) Middleware Access Control Library - Authorization API
_ _ _ _ _
_ __ ___ (_) __| | __| | | _____ ____ _ _ __ ___ __ _ ___| |
| '_ ` _ \| |/ _` |/ _` | |/ _ \ \ /\ / / _` | '__/ _ \_____ / _` |/ __| |
| | | | | | | (_| | (_| | | __/\ V V / (_| | | | __/_____| (_| | (__| |
|_| |_| |_|_|\__,_|\__,_|_|\___| \_/\_/ \__,_|_| \___| \__,_|\___|_|
middleware
DOCKER
Generate new containers ? [ 1 ]
Delete all containers ? [ 2 ]
Start new build ? [ 3 ]
Preview the logs ? [ 4 ]
Install dependencies ? [ 5 ]
Update dependencies ? [ 6 ]
First step
Start new build [ 3 ]Second step
Generate new containers [ 1 ]Preview the all logs of containers
Preview the logs [ 4 ]Or access the single container
docker logs api -fdocker logs mongo -fRouters
In this examples I using jq for pretty the result, for more information view in : jq
List Role
curl -H "Content-Type: application/json" -X GET http://127.0.0.1:6060/v1/roles | jqCreate Role and User
curl -H "Content-Type: application/json" -X POST -d '{"user":"alice", "role":"visitante"}' http://127.0.0.1:6060/v1/roles | jqGet role and its permissions
curl -H "Content-Type: application/json" -X GET http://127.0.0.1:6060/v1/roles/alice | jqUpdate role (add permissions)
curl -H "Content-Type: application/json" -X PUT -d '{"user":"alice", "permission": "read"}' http://127.0.0.1:6060/v1/roles | jqDelete role
curl -H "Content-Type: application/json" -X DELETE http://127.0.0.1:6060/v1/roles/administrador | jqList user roles
curl -H "Content-Type: application/json" -X GET http://127.0.0.1:6060/v1/users/alice/roles | jqRemove role from user
curl -H "Content-Type: application/json" -X DELETE http://127.0.0.1:6060/v1/users/alice/roles/visitante3 | jqCheck user permission
curl -H "Content-Type: application/json" -X GET http://127.0.0.1:6060/v1/users/alice/resource/data1/permission/read | jqAccess the container
docker exec -it api bashcd /go/src/middlewareand execute this:
./coverage.sh --htmland so, the file html is generated, only copy the file for the current directory
cp /tmp/cover314639520/coverage.html .Access the html file inside the project folder outside the container