From 57641c22fffe8317671e115d29f58d791585c443 Mon Sep 17 00:00:00 2001 From: Ashvin Deodhar Date: Tue, 24 Nov 2020 11:45:31 -0800 Subject: [PATCH] Prevent storing auth token in CNS state file --- cns/restserver/util.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cns/restserver/util.go b/cns/restserver/util.go index 2af74d14c1..1ca49b8de9 100644 --- a/cns/restserver/util.go +++ b/cns/restserver/util.go @@ -125,11 +125,15 @@ func (service *HTTPRestService) saveNetworkContainerGoalState(req cns.CreateNetw hostVersion = "-1" } + // Remove the auth token before saving the containerStatus to cns json file + createNetworkContainerRequest := req + createNetworkContainerRequest.AuthorizationToken = "" + service.state.ContainerStatus[req.NetworkContainerid] = containerstatus{ ID: req.NetworkContainerid, VMVersion: req.Version, - CreateNetworkContainerRequest: req, + CreateNetworkContainerRequest: createNetworkContainerRequest, HostVersion: hostVersion, VfpUpdateComplete: vfpUpdateComplete}