auth

package
v1.7.7 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

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

func SetTokenValidator(validator func(token string) bool)

SetTokenValidator sets the token validation function. This should be called during initialization before the server starts processing requests.

Types

This section is empty.

Jump to

Keyboard shortcuts

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