middlewares

package
v0.0.0-...-d4bbf0a Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPrincipal

func GetPrincipal(r *http.Request) *models.User

func NewFileTypeFilterMiddleware

func NewFileTypeFilterMiddleware(filter []string) func(http.Handler) http.Handler

func NewLoggingMiddleware

func NewLoggingMiddleware(logFunc logFunc, excludePrefixes []string) func(http.Handler) http.Handler

func NewPrincipalMiddleware

func NewPrincipalMiddleware() func(handler http.Handler) http.Handler

func NewSecurityMiddleware

func NewSecurityMiddleware() func(http.Handler) http.Handler

func NewSentryMiddleware

func NewSentryMiddleware() func(http.Handler) http.Handler

func SetPrincipal

func SetPrincipal(r *http.Request, user *models.User)

Types

type AuthenticateMiddleware

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

func NewAuthenticateMiddleware

func NewAuthenticateMiddleware(userService services.IUserService) *AuthenticateMiddleware

func (*AuthenticateMiddleware) Handler

func (*AuthenticateMiddleware) ServeHTTP

func (*AuthenticateMiddleware) WithOptionalFor

func (m *AuthenticateMiddleware) WithOptionalFor(paths ...string) *AuthenticateMiddleware

func (*AuthenticateMiddleware) WithRedirectErrorMessage

func (m *AuthenticateMiddleware) WithRedirectErrorMessage(message string) *AuthenticateMiddleware

func (*AuthenticateMiddleware) WithRedirectTarget

func (m *AuthenticateMiddleware) WithRedirectTarget(path string) *AuthenticateMiddleware

type LoggingMiddleware

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

func (*LoggingMiddleware) ServeHTTP

func (lg *LoggingMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request)

type PrincipalContainer

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

func (*PrincipalContainer) GetPrincipal

func (c *PrincipalContainer) GetPrincipal() *models.User

func (*PrincipalContainer) GetPrincipalIdentity

func (c *PrincipalContainer) GetPrincipalIdentity() string

func (*PrincipalContainer) SetPrincipal

func (c *PrincipalContainer) SetPrincipal(user *models.User)

type PrincipalMiddleware

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

func (*PrincipalMiddleware) ServeHTTP

func (p *PrincipalMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request)

type SecurityMiddleware

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

SecurityMiddleware is a handler to add some basic security headers to responses

func (*SecurityMiddleware) ServeHTTP

func (f *SecurityMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request)

type SentryMiddleware

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

SentryMiddleware is a wrapper around sentryhttp to include user information to traces

func (*SentryMiddleware) ServeHTTP

func (h *SentryMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request)

type SuffixFilterMiddleware

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

func (*SuffixFilterMiddleware) ServeHTTP

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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