Test Task Weather Service REST API. Spring Boot, WebFlux, PostgreSQL, Liquibase, Keycloak, Swagger, JUnit, Mockito
-
Execute
docker-compose upfrom the /docker directory. -
Open Swagger UI
-
In the AuthController, trigger a POST request to /auth, substituting username and password as follows:
| username | password | role |
|---|---|---|
| user1 | user1 | user |
| user2 | user2 | user |
| admin | admin | admin |
- Use the obtained Bearer token for authorization in Swagger UI (Authorize button).
- Use the API. The roles for which these methods are available are indicated in brackets in the method headers.
In Docker, three containers are launched: Postgres (port 5432), Keycloak (port 8181), and the application itself (port 8080). The application image is located on Docker Hub.
Upon starting, Keycloak imports a realm with the roles “admin”, “user”, and three users. It is assumed that user management is carried out through the Keycloak Admin Panel The login/password for the admin panel is admin/admin.