mw

package
v0.65.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 32 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const RateLimiterDefaultUser = "_"

Variables

This section is empty.

Functions

func GRPCAuthInterceptor

func GRPCAuthInterceptor(providers AuthProvidersByEnv) grpc.UnaryServerInterceptor

func GRPCEnvInterceptor added in v0.65.0

func GRPCEnvInterceptor(resolver EnvResolver) 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 RateLimitersByEnv) grpc.UnaryServerInterceptor

func GRPCRecoverInterceptor

func GRPCRecoverInterceptor() grpc.UnaryServerInterceptor

func GRPCTraceInterceptor

func GRPCTraceInterceptor() grpc.UnaryServerInterceptor

func HTTPAuthInterceptor

func HTTPAuthInterceptor(providers AuthProvidersByEnv) func(next http.Handler) http.Handler

func HTTPEnvInterceptor added in v0.65.0

func HTTPEnvInterceptor(resolver EnvResolver) 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 RateLimitersByEnv) 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

func NewRateLimiters added in v0.65.0

func NewRateLimiters(apiToRateLimiters config.ApiToRateLimiters) (map[string]map[string]RateLimiter, error)

Types

type AuthProviders

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

func NewAuthProvider added in v0.65.0

func NewAuthProvider(ctx context.Context, options config.AuthOptions, env string) (AuthProviders, error)

type AuthProvidersByEnv added in v0.65.0

type AuthProvidersByEnv map[string]AuthProviders

AuthProvidersByEnv contains auth providers by env, empty env is root options.

type EnvResolver added in v0.65.0

type EnvResolver map[string]handlerEnvs

EnvResolver resolves env of the request for auth and rate limiting by api name. APIs not present in the resolver (userprofile, dashboards) or handlers without envs always use root options (empty env), env from the request is ignored for them.

func NewEnvResolver added in v0.65.0

func NewEnvResolver(handlers *config.Handlers) EnvResolver

NewEnvResolver collects envs of handlers that support envs.

type RateLimiter

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

type RateLimitersByEnv added in v0.65.0

type RateLimitersByEnv map[string]map[string]map[string]RateLimiter

RateLimitersByEnv contains rate limiters by env->api->user, empty env is root options.

Jump to

Keyboard shortcuts

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