2023-07-10 15:27:00 +02:00
|
|
|
package oidc
|
|
|
|
|
|
|
|
import (
|
|
|
|
"google.golang.org/grpc"
|
|
|
|
|
|
|
|
"github.com/zitadel/zitadel/internal/api/authz"
|
|
|
|
"github.com/zitadel/zitadel/internal/api/grpc/server"
|
2023-10-25 18:44:05 +03:00
|
|
|
"github.com/zitadel/zitadel/internal/api/oidc"
|
2023-07-10 15:27:00 +02:00
|
|
|
"github.com/zitadel/zitadel/internal/command"
|
|
|
|
"github.com/zitadel/zitadel/internal/query"
|
2023-09-13 14:43:01 +02:00
|
|
|
oidc_pb "github.com/zitadel/zitadel/pkg/grpc/oidc/v2beta"
|
2023-07-10 15:27:00 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
var _ oidc_pb.OIDCServiceServer = (*Server)(nil)
|
|
|
|
|
|
|
|
type Server struct {
|
|
|
|
oidc_pb.UnimplementedOIDCServiceServer
|
|
|
|
command *command.Commands
|
|
|
|
query *query.Queries
|
|
|
|
|
2023-10-25 18:44:05 +03:00
|
|
|
op *oidc.Server
|
2023-07-10 15:27:00 +02:00
|
|
|
externalSecure bool
|
|
|
|
}
|
|
|
|
|
|
|
|
type Config struct{}
|
|
|
|
|
|
|
|
func CreateServer(
|
|
|
|
command *command.Commands,
|
|
|
|
query *query.Queries,
|
2023-10-25 18:44:05 +03:00
|
|
|
op *oidc.Server,
|
2023-07-10 15:27:00 +02:00
|
|
|
externalSecure bool,
|
|
|
|
) *Server {
|
|
|
|
return &Server{
|
|
|
|
command: command,
|
|
|
|
query: query,
|
|
|
|
op: op,
|
|
|
|
externalSecure: externalSecure,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) RegisterServer(grpcServer *grpc.Server) {
|
|
|
|
oidc_pb.RegisterOIDCServiceServer(grpcServer, s)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) AppName() string {
|
|
|
|
return oidc_pb.OIDCService_ServiceDesc.ServiceName
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) MethodPrefix() string {
|
|
|
|
return oidc_pb.OIDCService_ServiceDesc.ServiceName
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) AuthMethods() authz.MethodMapping {
|
|
|
|
return oidc_pb.OIDCService_AuthMethods
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) RegisterGateway() server.RegisterGatewayFunc {
|
|
|
|
return oidc_pb.RegisterOIDCServiceHandler
|
|
|
|
}
|