-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RSN-40] Add user authentication #43
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
raczu
added
scope: backend
Indicates that PR relates to backend changes.
type: feature
PR's categorised as feature.
status: ready for review
Determines that PR is ready for review.
labels
Jun 1, 2024
wzarek
requested changes
Jun 3, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we use the same validators as in #32 - RSN-31?
wzarek
added
status: require changes
Determines that PR requires changes to be approved.
and removed
status: ready for review
Determines that PR is ready for review.
labels
Jun 3, 2024
wzarek
added
status: ready for review
Determines that PR is ready for review.
and removed
status: require changes
Determines that PR requires changes to be approved.
labels
Jun 5, 2024
@raczu resolve conflicts / rebase |
@raczu conflicts again |
Simplify the logic on the controllers' side, custom exceptions and a library for validation were added. The implemented handlers are allow to catch those exceptions and return the corresponding statuses and detailed response. Additionally, mappers have been created to more easily convert entities into the corresponding DTOs, fixed enum conversion when it comes to UserRole and export postgres port on the development environment.
wzarek
approved these changes
Jun 6, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
scope: backend
Indicates that PR relates to backend changes.
status: ready for review
Determines that PR is ready for review.
type: feature
PR's categorised as feature.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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