2024-04-09 19:21:21 +02:00
|
|
|
package action
|
2024-02-15 06:39:10 +01:00
|
|
|
|
|
|
|
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"
|
2024-08-12 22:32:01 +02:00
|
|
|
"github.com/zitadel/zitadel/internal/config/systemdefaults"
|
2024-02-15 06:39:10 +01:00
|
|
|
"github.com/zitadel/zitadel/internal/query"
|
2025-04-02 16:53:06 +02:00
|
|
|
action "github.com/zitadel/zitadel/pkg/grpc/action/v2beta"
|
2024-02-15 06:39:10 +01:00
|
|
|
)
|
|
|
|
|
2025-04-02 16:53:06 +02:00
|
|
|
var _ action.ActionServiceServer = (*Server)(nil)
|
2024-02-15 06:39:10 +01:00
|
|
|
|
|
|
|
type Server struct {
|
2025-04-02 16:53:06 +02:00
|
|
|
action.UnimplementedActionServiceServer
|
2024-08-12 22:32:01 +02:00
|
|
|
systemDefaults systemdefaults.SystemDefaults
|
2024-02-26 11:49:43 +01:00
|
|
|
command *command.Commands
|
|
|
|
query *query.Queries
|
|
|
|
ListActionFunctions func() []string
|
|
|
|
ListGRPCMethods func() []string
|
|
|
|
ListGRPCServices func() []string
|
2024-02-15 06:39:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
type Config struct{}
|
|
|
|
|
|
|
|
func CreateServer(
|
2024-08-12 22:32:01 +02:00
|
|
|
systemDefaults systemdefaults.SystemDefaults,
|
2024-02-15 06:39:10 +01:00
|
|
|
command *command.Commands,
|
|
|
|
query *query.Queries,
|
2024-02-26 11:49:43 +01:00
|
|
|
listActionFunctions func() []string,
|
|
|
|
listGRPCMethods func() []string,
|
|
|
|
listGRPCServices func() []string,
|
2024-02-15 06:39:10 +01:00
|
|
|
) *Server {
|
|
|
|
return &Server{
|
2024-08-12 22:32:01 +02:00
|
|
|
systemDefaults: systemDefaults,
|
2024-02-26 11:49:43 +01:00
|
|
|
command: command,
|
|
|
|
query: query,
|
|
|
|
ListActionFunctions: listActionFunctions,
|
|
|
|
ListGRPCMethods: listGRPCMethods,
|
|
|
|
ListGRPCServices: listGRPCServices,
|
2024-02-15 06:39:10 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) RegisterServer(grpcServer *grpc.Server) {
|
2025-04-02 16:53:06 +02:00
|
|
|
action.RegisterActionServiceServer(grpcServer, s)
|
2024-02-15 06:39:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) AppName() string {
|
2025-04-02 16:53:06 +02:00
|
|
|
return action.ActionService_ServiceDesc.ServiceName
|
2024-02-15 06:39:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) MethodPrefix() string {
|
2025-04-02 16:53:06 +02:00
|
|
|
return action.ActionService_ServiceDesc.ServiceName
|
2024-02-15 06:39:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) AuthMethods() authz.MethodMapping {
|
2025-04-02 16:53:06 +02:00
|
|
|
return action.ActionService_AuthMethods
|
2024-02-15 06:39:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) RegisterGateway() server.RegisterGatewayFunc {
|
2025-04-02 16:53:06 +02:00
|
|
|
return action.RegisterActionServiceHandler
|
2024-04-09 19:21:21 +02:00
|
|
|
}
|