Skip to content

Commit 007e903

Browse files
Prevent storing auth token in CNS state file (#739)
This change prevents the subnet auth token getting saved in the CNS state file.
1 parent db8724e commit 007e903

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cns/restserver/util.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,15 @@ func (service *HTTPRestService) saveNetworkContainerGoalState(req cns.CreateNetw
125125
hostVersion = "-1"
126126
}
127127

128+
// Remove the auth token before saving the containerStatus to cns json file
129+
createNetworkContainerRequest := req
130+
createNetworkContainerRequest.AuthorizationToken = ""
131+
128132
service.state.ContainerStatus[req.NetworkContainerid] =
129133
containerstatus{
130134
ID: req.NetworkContainerid,
131135
VMVersion: req.Version,
132-
CreateNetworkContainerRequest: req,
136+
CreateNetworkContainerRequest: createNetworkContainerRequest,
133137
HostVersion: hostVersion,
134138
VfpUpdateComplete: vfpUpdateComplete}
135139

0 commit comments

Comments
 (0)