mirror of
https://github.com/zitadel/zitadel.git
synced 2025-10-23 20:29:07 +00:00
fix: start server and gateway
This commit is contained in:
28
pkg/auth/api/api.go
Normal file
28
pkg/auth/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/auth/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"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -127,5 +127,5 @@ var AuthService_AuthMethods = utils_auth.MethodMapping{
|
||||
}
|
||||
|
||||
func AuthService_Authorization_Interceptor(verifier utils_auth.TokenVerifier, authConf *utils_auth.Config) grpc.UnaryServerInterceptor {
|
||||
return utils_grpc.AuthorizationInterceptor(verifier, authConf, AuthService_AuthMethods)
|
||||
return middleware.AuthorizationInterceptor(verifier, authConf, AuthService_AuthMethods)
|
||||
}
|
||||
|
@@ -2,10 +2,10 @@ package auth
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/caos/logging"
|
||||
|
||||
"github.com/caos/zitadel/internal/api/auth"
|
||||
app "github.com/caos/zitadel/internal/auth"
|
||||
"github.com/caos/zitadel/internal/errors"
|
||||
"github.com/caos/zitadel/pkg/auth/api"
|
||||
)
|
||||
|
||||
@@ -15,5 +15,7 @@ type Config struct {
|
||||
}
|
||||
|
||||
func Start(ctx context.Context, config *Config, authZ *auth.Config) error {
|
||||
return errors.ThrowUnimplemented(nil, "AUTH-l7Hdx", "not implemented yet") //TODO: implement
|
||||
err := api.Start(ctx, config.API)
|
||||
logging.Log("MAIN-BmOLI").OnError(err).Panic("unable to start api")
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user