mw

package
v0.45.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const RateLimiterDefaultUser = "_"

Variables

This section is empty.

Functions

func GRPCAuthInterceptor

func GRPCAuthInterceptor(providers *AuthProviders) grpc.UnaryServerInterceptor

func GRPCLogInterceptor

func GRPCLogInterceptor(l *tracing.Logger) grpc.UnaryServerInterceptor

func GRPCMetricInterceptor

func GRPCMetricInterceptor() grpc.UnaryServerInterceptor

func GRPCProcessHeadersInterceptor

func GRPCProcessHeadersInterceptor() grpc.UnaryServerInterceptor

func GRPCRateLimitInterceptor

func GRPCRateLimitInterceptor(rateLimiters map[string]map[string]RateLimiter) grpc.UnaryServerInterceptor

func GRPCRecoverInterceptor

func GRPCRecoverInterceptor() grpc.UnaryServerInterceptor

func GRPCTraceInterceptor

func GRPCTraceInterceptor() grpc.UnaryServerInterceptor

func HTTPAuthInterceptor

func HTTPAuthInterceptor(providers *AuthProviders) func(next http.Handler) http.Handler

func HTTPLogInterceptor

func HTTPLogInterceptor(l *tracing.Logger) func(next http.Handler) http.Handler

func HTTPMetricInterceptor

func HTTPMetricInterceptor() func(next http.Handler) http.Handler

func HTTPNotFoundInterceptor

func HTTPNotFoundInterceptor() func(next http.Handler) http.Handler

func HTTPProcessHeadersInterceptor

func HTTPProcessHeadersInterceptor() func(next http.Handler) http.Handler

func HTTPRateLimitInterceptor

func HTTPRateLimitInterceptor(rateLimiters map[string]map[string]RateLimiter) func(next http.Handler) http.Handler

func HTTPRecoverInterceptor

func HTTPRecoverInterceptor() func(next http.Handler) http.Handler

func HTTPTraceInterceptor

func HTTPTraceInterceptor() func(next http.Handler) http.Handler

Types

type AuthProviders

type AuthProviders struct {
	JwtProvider  auth.JWTProvider
	OidcProvider auth.OIDCProvider
}

func NewAuthProviders

func NewAuthProviders(
	ctx context.Context,
	jwtSecretKey string, oidcCfg *config.OIDC,
	cacheCfg config.Cache,
) (AuthProviders, error)

type RateLimiter

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

func NewRateLimiter

func NewRateLimiter(api string, cfg config.RateLimiter) (RateLimiter, error)

Jump to

Keyboard shortcuts

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