mirror of
https://github.com/zitadel/zitadel.git
synced 2025-10-09 07:35:30 +00:00
fix: start server and gateway
This commit is contained in:
28
pkg/admin/api/api.go
Normal file
28
pkg/admin/api/api.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/caos/zitadel/internal/api/grpc/server"
|
||||
"github.com/caos/zitadel/pkg/admin/api/grpc"
|
||||
)
|
||||
|
||||
type API struct {
|
||||
grpcServer grpc.Server
|
||||
gateway grpc.Gateway
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
GRPCServer grpc.Config
|
||||
Gateway grpc.GatewayConfig
|
||||
}
|
||||
|
||||
func Start(ctx context.Context, conf *Config) error {
|
||||
api := &API{
|
||||
grpcServer: *grpc.StartServer(conf.GRPCServer),
|
||||
gateway: *grpc.StartGateway(conf.Gateway),
|
||||
}
|
||||
server.StartServer(ctx, &api.grpcServer)
|
||||
server.StartGateway(ctx, &api.gateway)
|
||||
|
||||
return nil
|
||||
}
|
@@ -1,7 +0,0 @@
|
||||
package api
|
||||
|
||||
import "github.com/caos/zitadel/internal/api/grpc"
|
||||
|
||||
type Config struct {
|
||||
GRPC *grpc.Config
|
||||
}
|
@@ -6,7 +6,7 @@ import (
|
||||
"google.golang.org/grpc"
|
||||
|
||||
utils_auth "github.com/caos/zitadel/internal/api/auth"
|
||||
utils_grpc "github.com/caos/zitadel/internal/api/grpc"
|
||||
"github.com/caos/zitadel/internal/api/grpc/server/middleware"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -37,5 +37,5 @@ var AdminService_AuthMethods = utils_auth.MethodMapping{
|
||||
}
|
||||
|
||||
func AdminService_Authorization_Interceptor(verifier utils_auth.TokenVerifier, authConf *utils_auth.Config) grpc.UnaryServerInterceptor {
|
||||
return utils_grpc.AuthorizationInterceptor(verifier, authConf, AdminService_AuthMethods)
|
||||
return middleware.AuthorizationInterceptor(verifier, authConf, AdminService_AuthMethods)
|
||||
}
|
||||
|
Reference in New Issue
Block a user