INNER CODE UNIT · Go
func
pace/bricks · tools/testserver/simplemath/main.go:17
func (*GrpcAuthBackend) AuthorizeStream(ctx context.Context) (context.Context, error) {
return ctx, nil
}
func (*GrpcAuthBackend) AuthorizeUnary(ctx context.Context) (context.Context, error) {
token, ok := security.GetTokenFromContext(ctx)
if ok {
log.Ctx(ctx).Debug().Msgf("Token: %v", token.GetValue())
} else {
return nil, fmt.Errorf("unauthenticated")
}
return ctx, nil
}
type SimpleMathServer struct {
math.UnimplementedMathServiceServer
}