Closed raczu closed 4 months ago
@wzarek
Can't we use the same validators as in #32 - RSN-31?
We decided to use fluent validation for creating validators, the @mkoper02 validators have already been rewritten to use this library, see #32
@raczu resolve conflicts / rebase
@wzarek
@raczu conflicts again
Description
The purpose of this PR is to add authentication of users using JWT token and authorization to given resources/routes depending on their roles. A secrey key must be set in
appsettings.json
in order for JWT to work properly, the easiest way to generate key is to use following command:and manually replace placeholder value or directly with usage of jq:
Additionally, mappers have been added, which extends database models for easier mapping to appropiate DTO, and handlers for easier handling exceptions in service layer or unhandled one. It allowed to standarize the format of problems returned by API to
problem+json
. When it comes to data validation, a libraryFluentValidation
has been added, and its exceptions are also handled with usage of handlers.Related issue and/or ticket
RSN-40