From bb0cd1fd6dc2a8b8ec3c8262259b97431d3fe828 Mon Sep 17 00:00:00 2001 From: Lugossy Zoltan Date: Tue, 13 Aug 2024 14:06:36 +0200 Subject: [PATCH] proxy; pass MaxTokenLifetime for expiration check Forgot to pass MaxTokenLifetime to fullmesh client to include it in the endpoint expiration check. --- cmd/proxy/internal/client/fullmesh.go | 2 +- cmd/proxy/internal/service/client.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/proxy/internal/client/fullmesh.go b/cmd/proxy/internal/client/fullmesh.go index 5d30afcd..f013a055 100644 --- a/cmd/proxy/internal/client/fullmesh.go +++ b/cmd/proxy/internal/client/fullmesh.go @@ -167,7 +167,7 @@ func (fmnsc *FullMeshNetworkServiceClient) checkEndpointExpiration() { logger := fmnsc.logger.WithValues("func", "checkEndpointExpiration") for name, endpoint := range fmnsc.networkServiceEndpoints { if fmnsc.ctx.Err() != nil { - // If context is closed FullMeshNetworkServiceClient.Close() is expected anyways to clen up... + // If context is closed FullMeshNetworkServiceClient.Close() is expected anyways to clean up... return } // Endpoint is considered expired if based on its ExpirationTime it's diff --git a/cmd/proxy/internal/service/client.go b/cmd/proxy/internal/service/client.go index 77fd8bc4..25089d64 100644 --- a/cmd/proxy/internal/service/client.go +++ b/cmd/proxy/internal/service/client.go @@ -1,5 +1,6 @@ /* Copyright (c) 2021-2023 Nordix Foundation +Copyright (c) 2024 OpenInfra Foundation Europe Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -57,6 +58,7 @@ func GetNSC(ctx context.Context, ConnectTo: config.ConnectTo, APIClient: nsmAPIClient, MonitorConnectionClient: monitorConnectionClient, + MaxTokenLifetime: config.MaxTokenLifetime, } // Note: naming the interface is left to NSM (refer to getNameFromConnection()) // However NSM does not seem to ensure uniqueness either. Might need to revisit...