Kipos API description.
Table of Contents generated with DocToc
Dependencies required before installing the project:
Postgresql and MailDev can be easily up and running thanks to this docker-compose command:
docker-compose up- application.yml file contains the main configuration.
- application-dev.yml file contains the dev configuration and override the main configuration.
- application-test.yml file contains the test configuration.
To correctly setup the dev environment, simply add "dev" value to "active profiles" in your Spring boot configuration.
- Framework: Spring Boot 2.3.4
- Database migration: Flyway
- Getter/Setter generation: Lombock
Rights and access management is carried out via Spring Security. The @PreAuthorize annotation is used to check access to an endpoint. Business checks can also be done through the service call in the annotation.
See the documentation: Spring Security 3.0.x
To return an HTTP code other than 200 as a response to a WS (in the event of a functional or technical error), all you have to do is throw an ApiException which takes an HTTP code and a message as parameters. It will be caught by an ExceptionHandler and returned in response to the WS with the specified HTTP code. This exception can be called anywhere at any time and it stops the current processing to return the desired error.
JWT is used for authentication, which means that for calls requiring authentication, you must have the token retrieved by the /auth /login call and send it in the header of the request:
key: Authorization
value: Bearer {your-token}