Merge pull request #1510 from gravitl/feature_v0.15.1_accesskeysisolation

Feature v0.15.1 accesskeysisolation
This commit is contained in:
Alex Feiszli
2022-09-02 14:35:53 -04:00
committed by GitHub
2 changed files with 15 additions and 0 deletions

View File

@@ -304,6 +304,12 @@ func getNetworkNodes(w http.ResponseWriter, r *http.Request) {
return
}
for _, node := range nodes {
if len(node.NetworkSettings.AccessKeys) > 0 {
node.NetworkSettings.AccessKeys = []models.AccessKey{} // not to be sent back to client; client already knows how to join the network
}
}
//Returns all the nodes in JSON format
logger.Log(2, r.Header.Get("user"), "fetched nodes on network", networkName)
w.WriteHeader(http.StatusOK)
@@ -380,6 +386,10 @@ func getNode(w http.ResponseWriter, r *http.Request) {
return
}
if len(node.NetworkSettings.AccessKeys) > 0 {
node.NetworkSettings.AccessKeys = []models.AccessKey{} // not to be sent back to client; client already knows how to join the network
}
response := models.NodeGet{
Node: node,
Peers: peerUpdate.Peers,