Documentation ¶
Index ¶
- func GetPrincipal(r *http.Request) *models.User
- func NewFileTypeFilterMiddleware(filter []string) func(http.Handler) http.Handler
- func NewLoggingMiddleware(logFunc logFunc, excludePrefixes []string) func(http.Handler) http.Handler
- func NewPrincipalMiddleware() func(handler http.Handler) http.Handler
- func NewSecurityMiddleware() func(http.Handler) http.Handler
- func NewSentryMiddleware() func(http.Handler) http.Handler
- func SetPrincipal(r *http.Request, user *models.User)
- type AuthenticateMiddleware
- func (m *AuthenticateMiddleware) Handler(h http.Handler) http.Handler
- func (m *AuthenticateMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
- func (m *AuthenticateMiddleware) WithOptionalFor(paths ...string) *AuthenticateMiddleware
- func (m *AuthenticateMiddleware) WithOptionalForMethods(methods ...string) *AuthenticateMiddleware
- func (m *AuthenticateMiddleware) WithRedirectErrorMessage(message string) *AuthenticateMiddleware
- func (m *AuthenticateMiddleware) WithRedirectTarget(path string) *AuthenticateMiddleware
- type LoggingMiddleware
- type PrincipalContainer
- type PrincipalMiddleware
- type SecurityMiddleware
- type SentryMiddleware
- type SuffixFilterMiddleware
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLoggingMiddleware ¶
Types ¶
type AuthenticateMiddleware ¶
type AuthenticateMiddleware struct {
// contains filtered or unexported fields
}
func NewAuthenticateMiddleware ¶
func NewAuthenticateMiddleware(userService services.IUserService) *AuthenticateMiddleware
func (*AuthenticateMiddleware) Handler ¶
func (m *AuthenticateMiddleware) Handler(h http.Handler) http.Handler
func (*AuthenticateMiddleware) ServeHTTP ¶
func (m *AuthenticateMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
func (*AuthenticateMiddleware) WithOptionalFor ¶
func (m *AuthenticateMiddleware) WithOptionalFor(paths ...string) *AuthenticateMiddleware
func (*AuthenticateMiddleware) WithOptionalForMethods ¶
func (m *AuthenticateMiddleware) WithOptionalForMethods(methods ...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 ¶
func (f *SuffixFilterMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.