MCPcopy Index your code
hub / github.com/PasarGuard/node / validateApiKeyMiddleware

Function validateApiKeyMiddleware

controller/rpc/middleware.go:46–59  ·  view source on GitHub ↗
(s *Service)

Source from the content-addressed store, hash-verified

44}
45
46func validateApiKeyMiddleware(s *Service) grpc.UnaryServerInterceptor {
47 return func(
48 ctx context.Context,
49 req interface{},
50 info *grpc.UnaryServerInfo,
51 handler grpc.UnaryHandler,
52 ) (interface{}, error) {
53 if err := validateApiKey(ctx, s); err != nil {
54 return nil, err
55 }
56
57 return handler(ctx, req)
58 }
59}
60
61func validateApiKeyStreamMiddleware(s *Service) grpc.StreamServerInterceptor {
62 return func(

Callers 1

ConditionalMiddlewareFunction · 0.85

Calls 1

validateApiKeyFunction · 0.85

Tested by

no test coverage detected