Documentation ¶
Index ¶
- Variables
- func DefaultHeadersMiddleware(deps DefaultHeadersDependency) router.MiddlewareFunc
- func GetRealIP(deps RealIPDependency, r router.Request) string
- func LoggingMiddleware(realIPDeps RealIPDependency, tracingDeps TracingDependency) router.MiddlewareFunc
- func NewAdminAuth(mainCtx context.Context, deps AdminAuthDependency) router.MiddlewareFunc
- func NewNormalAuth(mainCtx context.Context, deps NormalAuthDependency, ...) router.MiddlewareFunc
- func RealIPMiddleware(deps RealIPDependency) router.MiddlewareFunc
- func SentryMiddleware(deps SentryDependency) router.MiddlewareFunc
- func TracingMiddleware(realIPDeps RealIPDependency, deps TracingDependency) router.MiddlewareFunc
- type AdminAuthDependency
- type DefaultHeadersDependency
- type NormalAuthDependency
- type RealIPDependency
- type SentryDependency
- type TracingDependency
Constants ¶
This section is empty.
Variables ¶
var ( // ErrAuthRejection : auth rejection ErrAuthRejection = domain.NewErrorWithCode("dsps.auth.rejected") )
Functions ¶
func DefaultHeadersMiddleware ¶
func DefaultHeadersMiddleware(deps DefaultHeadersDependency) router.MiddlewareFunc
DefaultHeadersMiddleware is middleware to set some headers by default
func GetRealIP ¶
func GetRealIP(deps RealIPDependency, r router.Request) string
GetRealIP returns end-user IP address information if available. If not available, returns ""
func LoggingMiddleware ¶
func LoggingMiddleware(realIPDeps RealIPDependency, tracingDeps TracingDependency) router.MiddlewareFunc
LoggingMiddleware is middleware for logging
func NewAdminAuth ¶
func NewAdminAuth(mainCtx context.Context, deps AdminAuthDependency) router.MiddlewareFunc
NewAdminAuth creates middleware for authentication
func NewNormalAuth ¶
func NewNormalAuth(mainCtx context.Context, deps NormalAuthDependency, channelOf func(context.Context, router.MiddlewareArgs) (domain.Channel, error)) router.MiddlewareFunc
NewNormalAuth creates middleware for authentication
func RealIPMiddleware ¶
func RealIPMiddleware(deps RealIPDependency) router.MiddlewareFunc
RealIPMiddleware initialize middleware for real IP handling. Because "github.com/natureglobal/realip" is http.Handler middleware, this method wraps http.Handler
func SentryMiddleware ¶
func SentryMiddleware(deps SentryDependency) router.MiddlewareFunc
SentryMiddleware traces incoming HTTP request/response
func TracingMiddleware ¶
func TracingMiddleware(realIPDeps RealIPDependency, deps TracingDependency) router.MiddlewareFunc
TracingMiddleware traces incoming HTTP request/response
Types ¶
type AdminAuthDependency ¶
type AdminAuthDependency interface { RealIPDependency GetAdminAuthConfig() *config.AdminAuthConfig }
AdminAuthDependency is to inject required objects to the middleware
type DefaultHeadersDependency ¶
DefaultHeadersDependency is to inject required objects to the middleware
type NormalAuthDependency ¶
type NormalAuthDependency interface { GetStorage() domain.Storage DiscloseAuthRejectionDetail() bool }
NormalAuthDependency is to inject required objects to the middleware
type RealIPDependency ¶
type RealIPDependency interface { // If empty, RealIPMiddleware does nothing. GetIPHeaderName() string GetTrustedProxyRanges() []domain.CIDR }
RealIPDependency is to inject required objects to the middleware
type SentryDependency ¶
SentryDependency is to inject required objects to the middleware
type TracingDependency ¶
TracingDependency is to inject required objects to the middleware