Documentation
¶
Index ¶
- Variables
- func ServerAuthStreamInterceptor(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, ...) error
- func ServerAuthUnaryInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (interface{}, error)
- func SetTokenValidator(validator func(token string) bool)
Constants ¶
This section is empty.
Variables ¶
View Source
var TokenValidator func(token string) bool
Deprecated: Use SetTokenValidator instead. TokenValidator is maintained for backward compatibility. It must be set during initialization before the server starts serving.
Functions ¶
func ServerAuthStreamInterceptor ¶
func ServerAuthStreamInterceptor(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error
ServerAuthStreamInterceptor is a streaming RPC server interceptor that validates auth via the request's metadata. It blocks the stream if auth fails.
func ServerAuthUnaryInterceptor ¶
func ServerAuthUnaryInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
ServerAuthUnaryInterceptor is a unary RPC server interceptor that validates auth via the request's metadata. It blocks the RPC call if auth fails.
func SetTokenValidator ¶ added in v1.7.1
SetTokenValidator sets the token validation function. This should be called during initialization before the server starts processing requests.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.