Documentation ¶
Index ¶
- Constants
- type RedirectURLMaker
- type SecurityMiddleware
- func (m *SecurityMiddleware) HandleIfGranted(action web.Action, permission string) web.Action
- func (m *SecurityMiddleware) HandleIfGrantedWithFallback(action web.Action, fallback web.Action, permission string) web.Action
- func (m *SecurityMiddleware) HandleIfLoggedIn(action web.Action) web.Action
- func (m *SecurityMiddleware) HandleIfLoggedOut(action web.Action) web.Action
- func (m *SecurityMiddleware) HandleIfNotGranted(action web.Action, permission string) web.Action
- func (m *SecurityMiddleware) HandleIfNotGrantedWithFallback(action web.Action, fallback web.Action, permission string) web.Action
- func (m *SecurityMiddleware) Inject(r *web.Responder, s application.SecurityService, u RedirectURLMaker, ...)
- func (m *SecurityMiddleware) RedirectToLoginFallback(ctx context.Context, req *web.Request) web.Result
- func (m *SecurityMiddleware) RedirectToLogoutFallback(ctx context.Context, req *web.Request) web.Result
Constants ¶
View Source
const ( // ReferrerRedirectStrategy strategy to redirect to the supplied referrer ReferrerRedirectStrategy = "referrer" //PathRedirectStrategy strategy to redirect to the supplied path PathRedirectStrategy = "path" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RedirectURLMaker ¶
RedirectURLMaker helper function
type SecurityMiddleware ¶
type SecurityMiddleware struct {
// contains filtered or unexported fields
}
SecurityMiddleware to be used to secure controllers/routes
func (*SecurityMiddleware) HandleIfGranted ¶
HandleIfGranted allows a controller to be used with a given permission
func (*SecurityMiddleware) HandleIfGrantedWithFallback ¶
func (m *SecurityMiddleware) HandleIfGrantedWithFallback(action web.Action, fallback web.Action, permission string) web.Action
HandleIfGrantedWithFallback is HandleIfGranted with a fallback action
func (*SecurityMiddleware) HandleIfLoggedIn ¶
func (m *SecurityMiddleware) HandleIfLoggedIn(action web.Action) web.Action
HandleIfLoggedIn allows a controller to be used for logged in users
func (*SecurityMiddleware) HandleIfLoggedOut ¶
func (m *SecurityMiddleware) HandleIfLoggedOut(action web.Action) web.Action
HandleIfLoggedOut allows a controller to be used for logged out users
func (*SecurityMiddleware) HandleIfNotGranted ¶
HandleIfNotGranted allows a controller not to be used with a given permission
func (*SecurityMiddleware) HandleIfNotGrantedWithFallback ¶
func (m *SecurityMiddleware) HandleIfNotGrantedWithFallback(action web.Action, fallback web.Action, permission string) web.Action
HandleIfNotGrantedWithFallback is HandleIfNotGranted with a fallback action
func (*SecurityMiddleware) Inject ¶
func (m *SecurityMiddleware) Inject(r *web.Responder, s application.SecurityService, u RedirectURLMaker, l flamingo.Logger, cfg *struct { LoginPathHandler string `inject:"config:security.loginPath.handler"` LoginPathRedirectStrategy string `inject:"config:security.loginPath.redirectStrategy"` LoginPathRedirectPath string `inject:"config:security.loginPath.redirectPath"` AuthenticatedHomepageStrategy string `inject:"config:security.authenticatedHomepage.strategy"` AuthenticatedHomepagePath string `inject:"config:security.authenticatedHomepage.path"` EventLogging bool `inject:"config:security.eventLogging"` })
Inject dependencies
func (*SecurityMiddleware) RedirectToLoginFallback ¶
func (m *SecurityMiddleware) RedirectToLoginFallback(ctx context.Context, req *web.Request) web.Result
RedirectToLoginFallback fallback helper action
func (*SecurityMiddleware) RedirectToLogoutFallback ¶
func (m *SecurityMiddleware) RedirectToLogoutFallback(ctx context.Context, req *web.Request) web.Result
RedirectToLogoutFallback fallback helper action
Click to show internal directories.
Click to hide internal directories.