Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TokenUnaryInterceptor ¶
func TokenUnaryInterceptor( unauthorizedRequests []string, tokenValidator func(ctx context.Context, token string) (string, error), ) func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
TokenUnaryInterceptor returns a UnaryServerInterceptor that validates the access token and set the user id in the context. unauthorizedRequests is a list of requests that do not require authentication. tokenValidator is a function that validates the access token and returns the user id. This function is going to be used by all the services that need to validate the access token in a unary request.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.