Documentation
¶
Index ¶
- Constants
- func GRPCAuthInterceptor(providers AuthProvidersByEnv) grpc.UnaryServerInterceptor
- func GRPCEnvInterceptor(resolver EnvResolver) grpc.UnaryServerInterceptor
- func GRPCLogInterceptor(l *tracing.Logger) grpc.UnaryServerInterceptor
- func GRPCMetricInterceptor() grpc.UnaryServerInterceptor
- func GRPCProcessHeadersInterceptor() grpc.UnaryServerInterceptor
- func GRPCRateLimitInterceptor(rateLimiters RateLimitersByEnv) grpc.UnaryServerInterceptor
- func GRPCRecoverInterceptor() grpc.UnaryServerInterceptor
- func GRPCTraceInterceptor() grpc.UnaryServerInterceptor
- func HTTPAuthInterceptor(providers AuthProvidersByEnv) func(next http.Handler) http.Handler
- func HTTPEnvInterceptor(resolver EnvResolver) func(next http.Handler) http.Handler
- func HTTPLogInterceptor(l *tracing.Logger) func(next http.Handler) http.Handler
- func HTTPMetricInterceptor() func(next http.Handler) http.Handler
- func HTTPNotFoundInterceptor() func(next http.Handler) http.Handler
- func HTTPProcessHeadersInterceptor() func(next http.Handler) http.Handler
- func HTTPRateLimitInterceptor(rateLimiters RateLimitersByEnv) func(next http.Handler) http.Handler
- func HTTPRecoverInterceptor() func(next http.Handler) http.Handler
- func HTTPTraceInterceptor() func(next http.Handler) http.Handler
- func NewRateLimiters(apiToRateLimiters config.ApiToRateLimiters) (map[string]map[string]RateLimiter, error)
- type AuthProviders
- type AuthProvidersByEnv
- type EnvResolver
- type RateLimiter
- type RateLimitersByEnv
Constants ¶
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 HTTPRateLimitInterceptor ¶
func HTTPRateLimitInterceptor(rateLimiters RateLimitersByEnv) 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.