Skip to content
This repository was archived by the owner on Aug 30, 2025. It is now read-only.

Commit 05ff874

Browse files
committed
wires up api key service to mux
1 parent 1533e3d commit 05ff874

File tree

1 file changed

+13
-0
lines changed
  • backend/internal/cmds/mgmt/serve/connect

1 file changed

+13
-0
lines changed

backend/internal/cmds/mgmt/serve/connect/cmd.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
neosynclogger "github.com/nucleuscloud/neosync/backend/internal/logger"
2727
"github.com/nucleuscloud/neosync/backend/internal/nucleusdb"
2828
clientmanager "github.com/nucleuscloud/neosync/backend/internal/temporal/client-manager"
29+
v1alpha1_apikeyservice "github.com/nucleuscloud/neosync/backend/services/mgmt/v1alpha1/api-key-service"
2930
v1alpha1_authservice "github.com/nucleuscloud/neosync/backend/services/mgmt/v1alpha1/auth-service"
3031
v1alpha1_connectionservice "github.com/nucleuscloud/neosync/backend/services/mgmt/v1alpha1/connection-service"
3132
v1alpha1_jobservice "github.com/nucleuscloud/neosync/backend/services/mgmt/v1alpha1/job-service"
@@ -77,6 +78,7 @@ func serve(ctx context.Context) error {
7778
mgmtv1alpha1connect.ConnectionServiceName,
7879
mgmtv1alpha1connect.JobServiceName,
7980
mgmtv1alpha1connect.TransformersServiceName,
81+
mgmtv1alpha1connect.ApiKeyServiceName,
8082
}
8183

8284
checker := grpchealth.NewStaticChecker(services...)
@@ -214,6 +216,7 @@ func serve(ctx context.Context) error {
214216
api.Handle(
215217
mgmtv1alpha1connect.NewAuthServiceHandler(
216218
authService,
219+
// auth service uses non-standard interceptors as we don't want to include the auth interceptor in this service
217220
connect.WithInterceptors(
218221
otelconnect.NewInterceptor(),
219222
logger_interceptor.NewInterceptor(logger),
@@ -222,6 +225,16 @@ func serve(ctx context.Context) error {
222225
),
223226
)
224227

228+
apiKeyService := v1alpha1_apikeyservice.New(&v1alpha1_apikeyservice.Config{
229+
IsAuthEnabled: isAuthEnabled,
230+
}, db, useraccountService)
231+
api.Handle(
232+
mgmtv1alpha1connect.NewApiKeyServiceHandler(
233+
apiKeyService,
234+
stdInterceptorConnectOpt,
235+
),
236+
)
237+
225238
mux.Handle("/", api)
226239

227240
httpServer := http.Server{

0 commit comments

Comments
 (0)