Releases: go-goyave/goyave
Releases · go-goyave/goyave
Release v3.8.0
- Added
helper.Map
. Thanks to @agbaraka for the contribution! - Added
router.Group
, which is an alias forrouter.Subrouter("")
, aimed at improving route definition readability. - Address generation outputs
127.0.0.1
if0.0.0.0
is set as server host. - Added validation
Rule.IsType()
andRule.IsTypeDependent()
. - Added
route.BuildURI()
to be able to generate a full URI without the host and protocol prefix. - Added various accessors for routes and routers.
- Fixed timing attack on config basic authenticator.
- Exported
goyave.NewRouter()
. - Minor memory improvements by re-aligning some structure fields.
- Added support for custom JWT claims. (
jwt.GenerateTokenWithClaims()
). Thanks to @Morishiri for the contribution! - Added
JWTController.TokenFunc
to let developers define their own token generation logic. Thanks to @Morishiri for the contribution! - Added support for RSA and ECDSA JWT signatures.
- Added
JWTAuthenticator.ClaimName
. This field defines what is the name if the claim used as an ID. JWTAuthenticator
now adds token claims torequest.Extra
if the provided token is valid. (key:"jwt_claims"
)JWTController.Login
now returns401 Unauthorized
instead of422 Unprocessable Entity
if provided credentials are invalid.
Release v3.7.1
- Don't parse body if
Content-Type
is not set. Query params are still parsed. This change should drastically improve performance on requests with no body. - Set
request.Data
tonil
(meaning parse failed) if query params couldn't be parsed.
Release v3.7.0
- Added
Optional
flag toBasicAuthenticator
andJWTAuthenticator
. - Added support for
database.options
for the SQLite driver. - Added
response.Hijack()
. Therefore,*goyave.Response
now implementshttp.Hijacker
. Note that status handlers and middleware (requests finalization step in their lifecycle) will still work for hijacked connections. - Added websocket support.
- Added shutdown hooks.
- Added
goyave.BaseURL()
. - Added
config.LoadJSON()
. This can be used to load configuration from an embedded configuration file using Go's 1.16 embed directive. - Static file serving will no longer print "no such file or directory" to the error logger.
- Static file serving optimization: check file existence once instead of twice.
Release v3.6.0
- Set content type to
application/json; charset=utf-8
instead ofapplication/json
when usingresponse.JSON()
. - Added default behavior for
HEAD
method: allGET
routes can now match the HTTPHEAD
method. This fixes405 Method Not Allowed
when requesting an URL with theHEAD
method when no route explicitly matches theHEAD
method. See the HEAD routing advice for more details. - Added
request.ToStruct()
, which puts the request's data into the given structure.
Release v3.5.0
Release v3.4.0
- Type-dependent rules validating integers (via the "integer" type rule) now share their validation message with the "numeric" type.
- Added paginators.
- Added
helper.EscapeLike()
. - Performance improvement by caching critical config entries (
protocol
,maxUploadSize
anddefaultLanguage
). This change leads to about 18% more requests per second. However, these entries cannot be dynamically changed anymore: a server restart will be needed.
Release v3.3.1
- Fixed a bug in the validatior: the original value of type-converted fields was always used, leading to wrong validation of subsequent type-dependent rules.
Release v3.3.0
- Added
request.Extra
. Thank you @gmgalvan for your contribution! TestSuite
now runs auto migrations if they're enabled before running the tests.TestSuite
don't load config anymore if it's already loaded. This allows you to load a test configuration file usingLoadFrom()
before callinggoyave.RunTest()
.response.JSON()
doesn't remove hidden fields anymore. The use ofjson:"-"
makes more sense and saves some execution time. Removing hidden fields manually is still possible.
Release v3.2.0
- Added a way to customize the request's body field used by
JWTController
for the authentication process. (By default, "username" and "password" are used) - Added a new validation rule:
unique
. - Added
helper.Only()
. filesystem.File.Save()
now creates directories if needed.
Release v3.1.0
- Added support for validating objects (
map[string]interface{}
). - Added
request.Object()
accessor.