Riddhi Shah ec1ae5eca1 [OSS] Supported dataplane features gRPC endpoint
Adds a new gRPC service and endpoint to return the list of supported
consul dataplane features. The Consul Dataplane will use this API to
customize its interaction with that particular server.
2022-04-05 07:38:58 -07:00

34 lines
755 B
Go

package dataplane
import (
"github.com/hashicorp/consul/acl"
"github.com/hashicorp/consul/agent/structs"
"github.com/hashicorp/consul/proto-public/pbdataplane"
"github.com/hashicorp/go-hclog"
"google.golang.org/grpc"
)
type Server struct {
Config
}
type Config struct {
Logger hclog.Logger
ACLResolver ACLResolver
}
//go:generate mockery -name ACLResolver -inpkg
type ACLResolver interface {
ResolveTokenAndDefaultMeta(string, *structs.EnterpriseMeta, *acl.AuthorizerContext) (acl.Authorizer, error)
}
func NewServer(cfg Config) *Server {
return &Server{cfg}
}
var _ pbdataplane.DataplaneServiceServer = (*Server)(nil)
func (s *Server) Register(grpcServer *grpc.Server) {
pbdataplane.RegisterDataplaneServiceServer(grpcServer, s)
}