2024-08-14 17:18:14 +03:00
|
|
|
package webkey
|
|
|
|
|
|
|
|
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"
|
2025-04-02 16:53:06 +02:00
|
|
|
webkey "github.com/zitadel/zitadel/pkg/grpc/webkey/v2beta"
|
2024-08-14 17:18:14 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
type Server struct {
|
2025-04-02 16:53:06 +02:00
|
|
|
webkey.UnimplementedWebKeyServiceServer
|
2024-08-14 17:18:14 +03:00
|
|
|
command *command.Commands
|
|
|
|
query *query.Queries
|
|
|
|
}
|
|
|
|
|
|
|
|
func CreateServer(
|
|
|
|
command *command.Commands,
|
|
|
|
query *query.Queries,
|
|
|
|
) *Server {
|
|
|
|
return &Server{
|
|
|
|
command: command,
|
|
|
|
query: query,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) RegisterServer(grpcServer *grpc.Server) {
|
2025-04-02 16:53:06 +02:00
|
|
|
webkey.RegisterWebKeyServiceServer(grpcServer, s)
|
2024-08-14 17:18:14 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) AppName() string {
|
2025-04-02 16:53:06 +02:00
|
|
|
return webkey.WebKeyService_ServiceDesc.ServiceName
|
2024-08-14 17:18:14 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) MethodPrefix() string {
|
2025-04-02 16:53:06 +02:00
|
|
|
return webkey.WebKeyService_ServiceDesc.ServiceName
|
2024-08-14 17:18:14 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) AuthMethods() authz.MethodMapping {
|
2025-04-02 16:53:06 +02:00
|
|
|
return webkey.WebKeyService_AuthMethods
|
2024-08-14 17:18:14 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) RegisterGateway() server.RegisterGatewayFunc {
|
2025-04-02 16:53:06 +02:00
|
|
|
return webkey.RegisterWebKeyServiceHandler
|
2024-08-14 17:18:14 +03:00
|
|
|
}
|