package authorization import ( "net/http" "connectrpc.com/connect" "google.golang.org/protobuf/reflect/protoreflect" "github.com/zitadel/zitadel/internal/api/authz" "github.com/zitadel/zitadel/internal/command" "github.com/zitadel/zitadel/internal/config/systemdefaults" "github.com/zitadel/zitadel/internal/domain" "github.com/zitadel/zitadel/internal/query" "github.com/zitadel/zitadel/pkg/grpc/authorization/v2" "github.com/zitadel/zitadel/pkg/grpc/authorization/v2/authorizationconnect" ) var _ authorizationconnect.AuthorizationServiceHandler = (*Server)(nil) type Server struct { systemDefaults systemdefaults.SystemDefaults command *command.Commands query *query.Queries checkPermission domain.PermissionCheck } func CreateServer( systemDefaults systemdefaults.SystemDefaults, command *command.Commands, query *query.Queries, checkPermission domain.PermissionCheck, ) *Server { return &Server{ systemDefaults: systemDefaults, command: command, query: query, checkPermission: checkPermission, } } func (s *Server) RegisterConnectServer(interceptors ...connect.Interceptor) (string, http.Handler) { return authorizationconnect.NewAuthorizationServiceHandler(s, connect.WithInterceptors(interceptors...)) } func (s *Server) FileDescriptor() protoreflect.FileDescriptor { return authorization.File_zitadel_authorization_v2_authorization_service_proto } func (s *Server) AppName() string { return authorization.AuthorizationService_ServiceDesc.ServiceName } func (s *Server) MethodPrefix() string { return authorization.AuthorizationService_ServiceDesc.ServiceName } func (s *Server) AuthMethods() authz.MethodMapping { return authorization.AuthorizationService_AuthMethods }