logout

package
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FeatureId = security.FeatureId("Logout", security.FeatureOrderLogout)
)
View Source
var Module = &bootstrap.Module{
	Name:       "logout",
	Precedence: security.MinSecurityPrecedence + 20,
	Options: []fx.Option{
		fx.Invoke(register),
	},
}

Functions

This section is empty.

Types

type ConditionalLogoutHandler

type ConditionalLogoutHandler interface {
	// ShouldLogout returns error if logging out cannot be performed.
	ShouldLogout(context.Context, *http.Request, http.ResponseWriter, security.Authentication) error
}

ConditionalLogoutHandler is a supplementary interface for LogoutHandler. It's capable of cancelling/delaying logout process before any LogoutHandler is executed. When non-nil error is returned and logout middleware is configured with an security.AuthenticationEntryPoint, the entry point is used to delay the logout process In case of multiple ConditionalLogoutHandler, returning error by any handler would immediately terminate the process

type DefaultLogoutHandler

type DefaultLogoutHandler struct{}

func (DefaultLogoutHandler) HandleLogout

type LogoutConfigurer

type LogoutConfigurer struct {
}

func (*LogoutConfigurer) Apply

type LogoutFeature

type LogoutFeature struct {
	// contains filtered or unexported fields
}

func Configure

func Configure(ws security.WebSecurity) *LogoutFeature

Configure security.Feature entrypoint, used for modifying existing configuration in given security.WebSecurity

func New

func New() *LogoutFeature

New Standard security.Feature entrypoint, DSL style. Used with security.WebSecurity

func (*LogoutFeature) AddEntryPoint

func (f *LogoutFeature) AddEntryPoint(entryPoint security.AuthenticationEntryPoint) *LogoutFeature

AddEntryPoint is used when ConditionalLogoutHandler decide cancel/delay logout process

func (*LogoutFeature) AddErrorHandler

func (f *LogoutFeature) AddErrorHandler(errorHandler security.AuthenticationErrorHandler) *LogoutFeature

AddErrorHandler overrides ErrorUrl

func (*LogoutFeature) AddLogoutHandler

func (f *LogoutFeature) AddLogoutHandler(logoutHandler LogoutHandler) *LogoutFeature

func (*LogoutFeature) AddSuccessHandler

func (f *LogoutFeature) AddSuccessHandler(successHandler security.AuthenticationSuccessHandler) *LogoutFeature

AddSuccessHandler overrides SuccessUrl

func (*LogoutFeature) ErrorUrl

func (f *LogoutFeature) ErrorUrl(errorUrl string) *LogoutFeature

func (*LogoutFeature) Identifier

func (f *LogoutFeature) Identifier() security.FeatureIdentifier

Identifier Standard security.Feature entrypoint

func (*LogoutFeature) LogoutHandlers

func (f *LogoutFeature) LogoutHandlers(logoutHandlers ...LogoutHandler) *LogoutFeature

LogoutHandlers override default handler

func (*LogoutFeature) LogoutUrl

func (f *LogoutFeature) LogoutUrl(logoutUrl string) *LogoutFeature

func (*LogoutFeature) SuccessUrl

func (f *LogoutFeature) SuccessUrl(successUrl string) *LogoutFeature

type LogoutHandler

type LogoutHandler interface {
	// HandleLogout is the method MW would use to perform logging out actions.
	// In case of multiple LogoutHandler are registered, implementing class can terminate logout by implementing ConditionalLogoutHandler
	// If the returned error is security.ErrorSubTypeAuthWarning, the success handler is used with returned error added to the context
	HandleLogout(context.Context, *http.Request, http.ResponseWriter, security.Authentication) error
}

type LogoutMiddleware

type LogoutMiddleware struct {
	// contains filtered or unexported fields
}

func NewLogoutMiddleware

func NewLogoutMiddleware(successHandler security.AuthenticationSuccessHandler,
	errorHandler security.AuthenticationErrorHandler,
	entryPoint security.AuthenticationEntryPoint,
	logoutHandlers ...LogoutHandler) *LogoutMiddleware

func (*LogoutMiddleware) LogoutHandlerFunc

func (mw *LogoutMiddleware) LogoutHandlerFunc() gin.HandlerFunc

type Warnings

type Warnings []error

func GetWarnings

func GetWarnings(ctx context.Context) Warnings

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL