mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-15 18:25:13 +00:00
fix: start server and gateway
This commit is contained in:
+4
-2
@@ -3,9 +3,9 @@ package admin
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/caos/logging"
|
||||
app "github.com/caos/zitadel/internal/admin"
|
||||
"github.com/caos/zitadel/internal/api/auth"
|
||||
"github.com/caos/zitadel/internal/errors"
|
||||
"github.com/caos/zitadel/pkg/admin/api"
|
||||
)
|
||||
|
||||
@@ -15,5 +15,7 @@ type Config struct {
|
||||
}
|
||||
|
||||
func Start(ctx context.Context, config *Config, authZ *auth.Config) error {
|
||||
return errors.ThrowUnimplemented(nil, "ADMIN-n8vw5", "not implemented yet") //TODO: implement
|
||||
err := api.Start(ctx, config.API)
|
||||
logging.Log("MAIN-BmOLI").OnError(err).Panic("unable to start api")
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -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