docker-compose up -d
- Access the psql client
psql -U postgres
- Create the user 'reading_user' and giving him permissions
CREATE USER reading_user WITH PASSWORD 'reading_pass';
GRANT CONNECT ON DATABASE my_database TO reading_user;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO reading_user;
GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO reading_user;
GRANT USAGE ON SCHEMA public TO reading_user;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO reading_user;
docker-compose up -d -f docker-compose-proxy.yml
mvn spring-boot:run -Dspring-boot.run.profiles=direct
mvn spring-boot:run -Dspring-boot.run.profiles=proxy
curl --location 'http://localhost:8080/api/app-user' \
--header 'Content-Type: application/json' \
--data '{
"name": "test4"
}'
curl --location 'http://localhost:8080/api/app-user'