- core/internalauth:
-
switched from
github.com/dgrijalva/jwt-go
togithub.com/golang-jwt/jwt/v4
. this is a drop-in replacementuse search and replace to change the import path or add a replace statement to your go.mod:
replace ( github.com/dgrijalva/jwt-go v3.2.0+incompatible => github.com/golang-jwt/jwt/v4 v4.1.0 )
More details can be found here: https://github.com/golang-jwt/jwt/blob/main/MIGRATION_GUIDE.md
-
- core/auth:
- oauth.Identity includes Identity. This is a backwards-incompatible break
- license:
- Flamingo now uses the MIT license. The CLA has been removed.
- core/auth:
- Flamingo v3.2.0 provides a new auth package which makes authentication easier and more canonical.
- the old core/oauth is deprecated and provides a compatibility layer for core/auth.
- sessions:
- web.SessionStore provides programmatic access to web.Session
- flamingo.session.saveMode allows to define a more granular session save behaviour
- config loading:
- both routes.yml and routes.yaml are now supported
- framework/web:
- the framework router got a couple of stability updates.
- the web responder and responses don't fail anymore for uninitialized responses.
- error responses are wrapped with a http error message
- the flamingo.static.file controller needs a dir to not serve from root.
- errors:
- all errors are handled via Go's error package
- go 1.13/1.14:
- support for 1.12 has been dropped
-
"locale" package:
- the templatefunc __(key) is now returning a Label and instead additional parameters you need to use the label setters (see doc)
-
Deprecated Features are removed:
flamingo.me/dingo
need to be used now- support for responder.*Aware types is removed
-
framework/web.Response
is nowframework/web.Result
-
web.Request
is heavily condensed- Access to Params has changed
-
web.Session
does not expose.GS()
for the gorilla session anymore -
event.Subscriber
changes:- is getting
context.Context
as the first argument:Notify(ctx context.Context, e flamingo.Event)
event.Subscriber
are registered viaframework/flamingo.BindEventSubscriber(injector).To(...)
- There is no SubscriberWithContext anymore!
- is getting
-
several other Modules have been moved out of flamingo and exist as separate modules:
-
For all the stuff in this section: you may use the script
docs/updates/v3/renameimports.sh
for autoupdate the import paths in your project and to do some first replacements. -
moved modules outside of flamingo:
- flamingo/core/redirects
- flamingo/core/pugtemplate
- flamingo/core/form2
- flamingo/core/form (removed)
- flamingo/core/csrf
- flamingo/core/csp
- flamingo/core/captcha
-
restructures inside flamingo:
core/requestTask
is renamed tocore/requesttask
core/canonicalUrl
is renamed tocore/canonicalurl
core/cmd
package moved toframework/cmd
and the cmd have been moved to the packages they belong toframework/router
package merged intoframework/web
framework/event
package merged intoframework/flamingo
framework/template
package merged intoframework/flamingo
:- instead of
template.BindFunc
andtemplate.BindCtxFunc
you have to useflamingo.BindTemplateFunc
- instead of
framework/session
package merged intoframework/flamingo
:- instead of using the module
session.Module
useflamingo.SessionMdule
- instead of using the module
-
-
flamingo now uses go mod - we encourage to use it also in the projects:
- Init the project
go mod init YOURMODULEPATH
- If you want to link the flamingo core to your project (because you are working on the core also)
- Option 1:
edit "go.mod" and add this lines (make sure to not commit them to git)
replace ( flamingo.me/flamingo/v3 => ../../PATHTOFLAMINGO flamingo.me/flamingo-commerce/v3 => ../../PATHTOFLAMINGO )
- Option 2:
use
go mod vendor
and link the modules after this from vendor folder
- Option 1:
edit "go.mod" and add this lines (make sure to not commit them to git)
- Init the project
-
Prefixrouter configuration: rename prefixrouter.baseurl in flamingo.router.path
web.Responder
is now used- instead of injecting
in a controller you need to inject
responder.JSONAware responder.RenderAware responder.RedirectAware
And use the Methods of the Responder:responder *web.Responder
c.responder.Data()
c.responder.Render()
c.responder.Redirect()
- instead of injecting
dingo
is moved out toflamingo.me/dingo
and we recommend to use the Inject() methods instead of public properties.