2024-02-15 05:39:10 +00:00
|
|
|
package execution
|
|
|
|
|
|
|
|
import (
|
|
|
|
"google.golang.org/grpc"
|
|
|
|
|
|
|
|
"github.com/zitadel/zitadel/internal/api/authz"
|
|
|
|
"github.com/zitadel/zitadel/internal/api/grpc/server"
|
|
|
|
"github.com/zitadel/zitadel/internal/command"
|
|
|
|
"github.com/zitadel/zitadel/internal/query"
|
|
|
|
execution "github.com/zitadel/zitadel/pkg/grpc/execution/v3alpha"
|
|
|
|
)
|
|
|
|
|
|
|
|
var _ execution.ExecutionServiceServer = (*Server)(nil)
|
|
|
|
|
|
|
|
type Server struct {
|
|
|
|
execution.UnimplementedExecutionServiceServer
|
2024-02-26 10:49:43 +00:00
|
|
|
command *command.Commands
|
|
|
|
query *query.Queries
|
|
|
|
ListActionFunctions func() []string
|
|
|
|
ListGRPCMethods func() []string
|
|
|
|
ListGRPCServices func() []string
|
2024-02-15 05:39:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Config struct{}
|
|
|
|
|
|
|
|
func CreateServer(
|
|
|
|
command *command.Commands,
|
|
|
|
query *query.Queries,
|
2024-02-26 10:49:43 +00:00
|
|
|
listActionFunctions func() []string,
|
|
|
|
listGRPCMethods func() []string,
|
|
|
|
listGRPCServices func() []string,
|
2024-02-15 05:39:10 +00:00
|
|
|
) *Server {
|
|
|
|
return &Server{
|
2024-02-26 10:49:43 +00:00
|
|
|
command: command,
|
|
|
|
query: query,
|
|
|
|
ListActionFunctions: listActionFunctions,
|
|
|
|
ListGRPCMethods: listGRPCMethods,
|
|
|
|
ListGRPCServices: listGRPCServices,
|
2024-02-15 05:39:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) RegisterServer(grpcServer *grpc.Server) {
|
|
|
|
execution.RegisterExecutionServiceServer(grpcServer, s)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) AppName() string {
|
|
|
|
return execution.ExecutionService_ServiceDesc.ServiceName
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) MethodPrefix() string {
|
|
|
|
return execution.ExecutionService_ServiceDesc.ServiceName
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) AuthMethods() authz.MethodMapping {
|
|
|
|
return execution.ExecutionService_AuthMethods
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) RegisterGateway() server.RegisterGatewayFunc {
|
|
|
|
return execution.RegisterExecutionServiceHandler
|
|
|
|
}
|