mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-05 08:47:35 +08:00
Merge pull request #1510 from gravitl/feature_v0.15.1_accesskeysisolation
Feature v0.15.1 accesskeysisolation
This commit is contained in:
@@ -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,
|
||||
|
Reference in New Issue
Block a user