-
Notifications
You must be signed in to change notification settings - Fork 1
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
refactor: introduce middlewares #23
Merged
pvbouwel
merged 12 commits into
VITObelgium:main
from
pvbouwel:refactor/middleware_for_logging
Feb 6, 2025
Merged
refactor: introduce middlewares #23
pvbouwel
merged 12 commits into
VITObelgium:main
from
pvbouwel:refactor/middleware_for_logging
Feb 6, 2025
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
Introduce a middleware for logging. The goal of this middleware is to make sure access logging is possible so for accuracy it is best to have it as entry point so even before any router. Because health checking requires special care for logging this middleware also has health checking as responsibilty. The same middleware is used for sts and s3 components.
Make sure the bytes sent received and the status code are updated such that the access log shows the values that are to be expected.
Using stringer allows to track operations easily in Request context and it is also very execution efficient.
While this initially makes the register route functions uglier we can clean it up later in a refactor. Things will become messier and uglier before they become prettier.
The cmd package was just a 'dump nearly everything' package. One of the problems of this was tight coupling and not allowing for re-usable parts. This refactor is a starting point. By no means perfect and likley there are way too many public objects but it does help to decouple parts and avoid certain duplication of code.
When relative paths are provided in the backendconfig file they should be relative to the config file and not to the working directory. Absolute paths are just treated as is. Also allow inline credentials to not overcomplicate creation of test files for test setups.
…ivate key as argument tests: update presign_test's to work post code restructure refactor: make sure IsPresignedUrlWithValidSignature also communicates information regarding expiry.
Introduce AWS error codes in order to allow to create re-usable code and have an interface that is not service specific. feature: user facing errors. Allow passing error which can be user facing. VITObelgium#19
…port 8443 already in use) bugfix: When awaiting health it should actually shut down the server if not healthy after a while.
This resolves #19 by adding a package usererror which allows creating an error that is aware of user facing messaging. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
As a first change this will introduce middleware for logging.
Introduce a middleware for logging. The goal of this middleware is to make sure access logging is possible so for accuracy it is best to have it as entry point so even before any router.
Because health checking requires special care for logging this middleware also has health checking as responsibilty. The same middleware is used for sts and s3 components.