mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-23 10:56:45 +00:00
# Which Problems Are Solved
As part of our efforts to simplify the structure and versions of our
APIs, were moving all existing v2beta endpoints to v2 and deprecate
them. They will be removed in Zitadel V5.
# How the Problems Are Solved
- This PR moves the internal permission v2beta service and its endpoints
to a corresponding v2 version. The v2beta service and endpoints are
deprecated.
- The docs are moved to the new GA service and its endpoints. The v2beta
is not displayed anymore.
- The comments and have been improved and, where not already done, moved
from swagger annotations to proto.
- All required fields have been marked with (google.api.field_behavior)
= REQUIRED and validation rules have been added where missing.
- Listing administrators of a project grant can now be done with the
`ProjectGrant` (`project_id` and `organization_id`) instead of a
`project_id`, which corresponds to creation of the administrator ship of
such grant.
- formatted using `buf`
# Additional Changes
None
# Additional Context
- part of https://github.com/zitadel/zitadel/issues/10772
- requires backport to v4.x
---------
Co-authored-by: Gayathri Vijayan <66356931+grvijayan@users.noreply.github.com>
(cherry picked from commit 0f2a349ec1)
60 lines
1.8 KiB
Go
60 lines
1.8 KiB
Go
package internal_permission
|
|
|
|
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/internal_permission/v2"
|
|
"github.com/zitadel/zitadel/pkg/grpc/internal_permission/v2/internal_permissionconnect"
|
|
)
|
|
|
|
var _ internal_permissionconnect.InternalPermissionServiceHandler = (*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 internal_permissionconnect.NewInternalPermissionServiceHandler(s, connect.WithInterceptors(interceptors...))
|
|
}
|
|
|
|
func (s *Server) FileDescriptor() protoreflect.FileDescriptor {
|
|
return internal_permission.File_zitadel_internal_permission_v2_internal_permission_service_proto
|
|
}
|
|
|
|
func (s *Server) AppName() string {
|
|
return internal_permission.InternalPermissionService_ServiceDesc.ServiceName
|
|
}
|
|
|
|
func (s *Server) MethodPrefix() string {
|
|
return internal_permission.InternalPermissionService_ServiceDesc.ServiceName
|
|
}
|
|
|
|
func (s *Server) AuthMethods() authz.MethodMapping {
|
|
return internal_permission.InternalPermissionService_AuthMethods
|
|
}
|