Documentation
¶
Index ¶
Constants ¶
View Source
const MaxBodySize = 1 * 1024 * 1024
MaxBodySize is the maximum size of HTTP request body: 1MB.
Variables ¶
View Source
var DependencySet = wire.NewSet( wire.Struct(new(CORSMiddleware), "*"), wire.Struct(new(CORSMatcher), "*"), wire.Bind(new(CORSOriginMatcher), new(*CORSMatcher)), wire.Struct(new(PanicMiddleware), "*"), wire.Struct(new(SentryMiddleware), "*"), wire.Struct(new(BodyLimitMiddleware), "*"), )
View Source
var PanicMiddlewareLogger = slogutil.NewLogger("panic-middleware")
Functions ¶
Types ¶
type BodyLimitMiddleware ¶
type BodyLimitMiddleware struct {
}
type CORSMatcher ¶
type CORSMatcher struct {
Config *config.HTTPConfig
OAuthConfig *config.OAuthConfig
SAMLConfig *config.SAMLConfig
CORSAllowedOrigins config.CORSAllowedOrigins
}
func (*CORSMatcher) PrepareOriginMatcher ¶
func (m *CORSMatcher) PrepareOriginMatcher(r *http.Request) (*originmatcher.T, error)
type CORSMiddleware ¶
type CORSMiddleware struct {
Matcher CORSOriginMatcher
}
CORSMiddleware provides CORS headers by matching request origin with the configured allowed origins The allowed origins are provided through app config and environment variable
type CORSOriginMatcher ¶
type CORSOriginMatcher interface {
PrepareOriginMatcher(r *http.Request) (*originmatcher.T, error)
}
type PanicMiddleware ¶
type PanicMiddleware struct{}
type SentryMiddleware ¶
type SentryMiddleware struct {
SentryHub *getsentry.Hub
TrustProxy config.TrustProxy
}
Click to show internal directories.
Click to hide internal directories.