Note: This project is frozen. If you'd like to continue its development I encourage you to do fork.
./gradlew build
./gradlew bootRun
Production Testbed Bleeding edge
It should be self explanatory. You can:
- build the docker image with:
gradle buildImage
- create container:
gradle createContainer
- run functional test on docker by:
gradle functionalTest
(TODO)
To acquire token POST
credentials to /tokens/acquire
Example curl:
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{
"email": "user@mail.com",
"password": "P4ssw0rd"
}' 'http://localhost:8080/tokens/acquire'
To authorize send JWT token in Authorization
header with Bearer
prefix in request.
Example curl:
curl http://localhost:8080/users \
-H 'Accept: application/json' \
-H 'Authorization: Bearer eyJhb...'
To configure secret for JWT add TOZ_BE_JWT_SECRET
environmental variable with base64 encoded secret.
Set TOZ_BE_SA_PASSWORD
environmental variable with super admin password before starting server.
This password will be used to initialize super admin database entity.
curl:
curl -X POST -H 'Content-Type: application/json' \
-u SA:$TOZ_BE_SA_PASSWORD \
-d '{ "name": "Johny",
"password": "johnySecret",
"surname":"Bravo",
"phoneNumber":"111222333",
"email": "johny.bravo@gmail.com",
"roles": ["VOLUNTEER"]}' \
http://localhost:8080/admin/users
- SA - Super admin
- TOZ - Organization admin
- VOLUNTEER - A Person, who is a volunteer in TOZ Organization