Releases: go-goyave/goyave
Releases · go-goyave/goyave
Pre-release v5.0.0-rc10
- Cleanup
- Removed unused structure in the auth package
- Updated some documentation in the
fsutilpackage
- Reworked the
authpackage- Authenticators depend on a
UserServiceinstead of executing DB query themselves - Encourage using user DTO instead of models
- This all results in removing a dependency between presentation and data layer
- Removed
FindColumns. The "username" and "password" fields are not marked with struct tags anymore: they are handled by a repository. - Reduced (but not eliminated) uses of reflection. Now only the password field from the DTO returned by the user service is retrieved using reflection.
- Take advantage of generics even more
- The request's context is now properly propagated by JWT and basic authenticators
- Authenticators depend on a
Pre-release v5.0.0-rc9
- Slog: the dev mode handler now uses a pointer for its mutex and shares the same mutex among all his clones.
Server.Stop()won't attempt to closesigChannelagain if the server has already been stopped. This method can this be called several times safely now.- Router
- Changed the subrouter matching so it doesn't work with prefix only. This will remove conflicts between two subrouters having a prefix starting with the same characters (e.g.:
/testand/test-2won't conflict anymore) - The router won't turn back and explore other branches if the subrouter matches but none of its routes do. This will fix some false matches.
- Fixed
/route defined at the main router being matched if a subrouter matches but none of its routes do and a trailing slash is present in the request URI.
- Changed the subrouter matching so it doesn't work with prefix only. This will remove conflicts between two subrouters having a prefix starting with the same characters (e.g.:
- Cleanup: removed some unused resources, outdated comments and updated incorrect documentation
- Validation
- Fixed a reflect error in
ArrayValidatorif the first element of the array is invalid (e.g.:nil) - Use error wrapping in
Unique/Existsvalidators for better error stacktraces - Add a timeout on the SQL query executed by the
ExistsArrayvalidator. - Remove suffix
[]from n-dimensional array elements field name in error messages.
- Fixed a reflect error in
Pre-release v5.0.0-rc8
- Improved docs
server.Stop()doesn't attempt to stop the server a second time if it was already stopped- Validation: added
validation.Contextaccessors for current element path and array element errors - Validation: added
validation.ContextmethodsAddValidationErrorandAddValidationErrorsso validators can merge additional errors that may be coming from nested validation validation.Context'sExtrafield is nevernil- Fixed
OPTIONSmethod not added to routes if their router inherited their CORS settings from parent router - Updated dependencies
- Improved language files unmarshal error messages
Pre-release v5.0.0-rc7
- Updated dependencies
- Improved thread-safety of server status
- Updated contribution resources (issue templates, etc) and license
Pre-release v5.0.0-rc6
slog: custom errors implementingslog.LogValuerare now handled correctly and will be added as reason attribute.- Added parameter name hints on
goyave.Handlerso IDEs automatically name request and response properly when auto-completing. testutil: when usingTestMiddleware, the cloned request sent to the middleware now uses the samecontext.Contextas the original request.- Updated dependencies and CI
Pre-release v5.0.0-rc5
- Added a name to special routes (the
notFoundandmethodNotAllowedroutes) so it is possible to know if there was no matched route from inside a global middleware. testutil.TestMiddlewarenow also copies therequest.Route.⚠️ The auth middleware is now only executed if the matched route (or one of its parents) have the metaauth.MetaAuthset totrue. This means theauth.Middlewareis now meant to be used as a global middleware. Routers and routes can be individually marked as requiring auth or not.
Pre-release v5.0.0-rc4
- Improvements to the
sessionpackage to make manual transaction (begin, commit, rollback) easier and to improve support on nested transaction (that can possibly involve multiple different services).- The
Sessioninterface now has aContext() context.Contextmethod. Begin()now also injects the transaction DB in the new session's context.Begin()andTransaction()now use the DB retrieved from the given context if available. This makes nested transactions possible even if the service is using the root session.
- The
Pre-release v5.0.0-rc3
-database.Paginator now uses a cloned statement for the count query to avoid modifying the original statement.
- Wrap errors using
errors.New()in many places that were not already doing it. - Added
errors.Errorf, which is a shortcut forerrors.New(fmt.Errorf()). ⚠️ errors.New()anderrors.NewSkip()now returnnilif givennilas argument.nilvalues in[]errorand[]anyreasons are now ignored.⚠️ errors.New(),errors.NewSkip()anderrors.Errorf()now returnerrorinterface instead of*errors.Errorto improve ability to compare tonil.- Added a safeguard on
Response.error()againstnilerrors. - Added a safeguard on
slog.Logger.logError()againstnilerrors. - Updated internal uses of the util
errorspackage according to the new changes described above.
Pre-release v5.0.0-rc2
- Removed the
directoryargument inrouter.Static. The static handler now uses the FS relative root directory as a base. Use a sub FS if you want to serve a sub directory. - Updated dependencies.
Pre-release v5.0.0-rc1
- Added new server options
- Added config entry
server.readHeaderTimeoutwhich represents the amount of time allowed to read request headers. - Added
Options.BaseContext, allowing to define the base context for the server. - Added
Options.ConnContext, allowing to modify the context used for new client connections. - Added
Options.ConnState, allowing to get notified when the client connection state changes. - Added
Options.MaxHeaderBytes, which controls the maximum number of bytes the server will read parsing the request header's keys and values, including the request line.
- Added config entry
- Improvements on the embedded resources support:
- Added a
fsutil.Embed.Submethod, allowing to get sub filesystems forembed.FS. fsutil.Embednow acceptsfs.ReadDirFSinstead ofembed.FS- The lang package loads from root FS directory instead of forcing
resources/lang, unless the FS implementsfsutil.WorkingDirDS
- Added a