This repository was archived by the owner on Jun 12, 2024. It is now read-only.
Releases: contiamo/go-base
Releases · contiamo/go-base
v3.2.2
fix: print req object as string during authn errors (#111) **What** - When the logging was previously refactored in the authorization middleware, the `prettyRequest` was being logged as a raw bytes array, which is impossible to read. This change converts it to a string so that the log is readable. Signed-off-by: Lucas Roesler <roesler.lucas@gmail.com>
v3.2.1
fix: reduce log noise during claims.Validate (#107) **What** - Only log errors during claims.Validate if the error is non-nil. Otherwise there is a lot of noise in logs that look like errors on every request but are actually valid. Signed-off-by: Lucas Roesler <roesler.lucas@gmail.com>
v3.2.0
feat: Improve error handling for validation errs and user errors (#106) * feat: Improve error handling for validation errs and user errors **What** - Add new UserError type that can be used to wrap errors in a way that ensures the BaseHandler will expose them as user visible errors with the 400 status code in the API - Improve handling for validation errors that do not have a field key set, these errors are now returned as GeneralErrors because they do not have a field that we can connect to - Define the APIErrorMessenger and the considered ErrorResponse objects. Update the error parsing to use these instead of the more concrete but cumbersome GeneralErrorResponse and FieldErrorResponse. This should make the internal logic of the error handling more semantic, so that we are not setting the GeneralError type on a FieldError, for example. This also introduces the Scrubbed method, which also make this behavior and the intent more obvious as well. Note that this implementation allows us to avoid pointer methods, because it returns a new copy of the underlying concrete type instead of mutating it. I found this a little bit nicer to read and use. - Restructure some of the files to make exploration a little more straight forward (I hope) - Mark the old error responses as deprecated. From my inspection, these are not used anywhere, but this gives us a little leeway. Signed-off-by: Lucas Roesler <roesler.lucas@gmail.com>
v3.1.2
feat: Suppor ozzo v4 validation errors in the base handler (#105) - Allow the base http handler to handle validation errors from ozzo v1 and ozzo v4. The new v4 handling allows the base handler to support the generated validators from openapi-generator-go: https://github.com/contiamo/openapi-generator-go Signed-off-by: Lucas Roesler <roesler.lucas@gmail.com>
v3.1.1
Improve schedule worker debugging and tests (#101) **What** - Add some more test statements to make the validation more strict. It now ensures that the one time schedule is not reschedule in the future while the repeating schedule does exist. It also ensures that "empty queue" is returned as expected. - Using snake case on logrus fields because it works better with loki, which will then detect these as actual log fields which can leverage the full loki query language - Add more log statements with task metadata to the scheduleTask workflow. This improves the ability to follow the flow of the logs when we need to view both manager and worker logs together. Signed-off-by: Lucas Roesler <roesler.lucas@gmail.com>
v3.1.0
Unify middleware and tokens claim model (#98) **What** - use the authorization.Claims model in the tokens creator - Expand claims validation tests - Expand authorization middleware test cases Signed-off-by: Lucas Roesler <roesler.lucas@gmail.com>
v3.0.0
This release introduces a new token Creator
interface. See creator.go#L50-L76
v2.8.3
Upgrade all of the dependencies
v2.8.2
Upgrade to latest jaeger client (#79) **What** - Update to the latest jaeger client so that we have the improved trace debugging features and the client collector ip resolution. This improves the stability in kubernetes, where the ip addresses are not perfectly stable. Signed-off-by: Lucas Roesler <roesler.lucas@gmail.com>
v2.8.1
Explicitly sanitize the auth header value in tracing (#77) * Explicitly sanitize the auth header value in tracing **What** - Implement an explicit sanitization of the header value before we log it to the tracing tags. This make it clear that we we not leaking sensitive data Signed-off-by: Lucas Roesler <roesler.lucas@gmail.com>