From 3b22656d836790c4f73d1e9603c388879fc49dad Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Wed, 17 Apr 2024 11:09:57 -0400 Subject: [PATCH] chore: add api key for tunnel connection --- cmd/flipt/main.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cmd/flipt/main.go b/cmd/flipt/main.go index ba6d425543..dbdaa9a772 100644 --- a/cmd/flipt/main.go +++ b/cmd/flipt/main.go @@ -374,18 +374,19 @@ func run(ctx context.Context, logger *zap.Logger, cfg *config.Config) error { tunnel := fmt.Sprintf("%s-%s.%s", cfg.Server.Cloud.Instance, cfg.Server.Cloud.Organization, cfg.Server.Cloud.Address) tunnelServer := &client.Server{ - TunnelGroup: tunnel, - Handler: httpServer.Handler, + TunnelGroup: tunnel, + Handler: httpServer.Handler, + Authenticator: client.BearerAuthenticator(cfg.Server.Cloud.Authentication.ApiKey), } // starts QUIC tunnel server to connect to Cloud g.Go(func() error { defer tunnelServer.Close() - logger.Info("tunnel available", zap.String("address", tunnel), zap.Int("port", cfg.Server.Cloud.Port)) + logger.Info("cloud tunnel available", zap.String("address", tunnel), zap.Int("port", cfg.Server.Cloud.Port)) if err := tunnelServer.DialAndServe(ctx, fmt.Sprintf("%s:%d", tunnel, cfg.Server.Cloud.Port)); !errors.Is(err, http.ErrServerClosed) { - return fmt.Errorf("tunnel server: %w", err) + return fmt.Errorf("cloud tunnel server: %w", err) } return nil