REST API for managing complaints.
mvn compile jib:dockerBuild
docker-compose upAPI Documentation and examples.
Go to SWAGGER: http://localhost:8080/swagger-ui.html
Credentials: admin/admin
The "Client Remote IP discovery" feature depends on deployment setup.
Please check pl/tzason/complaint/util/RequestUtil.java implementation for details.
Setup A.
If this application is deployed in the standalone mode without any proxy/load balancer,
then IP address is read directly from request request.getRemoteAddr() (default).
Setup B.
Otherwise, when application is deployed with Load Balancer/ Reverse Proxy, remote address is read from HEADER X-Forwarded-For
If you want to verify country discovery by IP using your local environment, please add IP to the header X-Real-IP: 84.234.119.249. Below 2 examples (PL and DE):
- CURL PL IP address:
curl -u admin:admin -X 'POST' \
'http://localhost:8080/api/complaints' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-H "X-Real-IP: 84.234.119.249" \
-d '{
"productId": "Product ",
"content": "Does not work",
"reporter": "tomasz.zason@test.pl"
}'- CURL for DE IP address:
curl -u admin:admin -X 'POST' \
'http://localhost:8080/api/complaints' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-H "X-Real-IP: 85.214.132.117" \
-d '{
"productId": "Produkt",
"content": "Funktioniert nicht",
"reporter": "tomasz.zason@test.de"
}'Then just run without header.
curl -u admin:admin -X 'POST' \
'http://localhost:8080/api/complaints' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{
"productId": "Produkt",
"content": "Funktioniert nicht",
"reporter": "tomasz.zason@test.de"
}'