peer: save PublicIP instead of publicEndpoint / add multi-coord gRPCs

This commit is contained in:
Benedict 2022-04-13 12:39:55 +02:00 committed by Benedict Schlüter
parent 55a1aa783f
commit f0e35a43d4
31 changed files with 1216 additions and 666 deletions

View file

@ -123,22 +123,22 @@ func TestStoreWrapperPeerInterface(t *testing.T) {
internalIP := "10.118.2.0"
validPeer := peer.Peer{
PublicEndpoint: ip,
VPNPubKey: key[:],
VPNIP: internalIP,
PublicIP: ip,
VPNPubKey: key[:],
VPNIP: internalIP,
}
require.NoError(stwrapper.PutPeer(validPeer))
data, err := stwrapper.GetPeers()
require.NoError(err)
require.Equal(1, len(data))
assert.Equal(ip, data[0].PublicEndpoint)
assert.Equal(ip, data[0].PublicIP)
assert.Equal(key[:], data[0].VPNPubKey)
assert.Equal(internalIP, data[0].VPNIP)
invalidPeer := peer.Peer{
PublicEndpoint: ip,
VPNPubKey: key[:],
VPNIP: "",
PublicIP: ip,
VPNPubKey: key[:],
VPNIP: "",
}
assert.Error(stwrapper.PutPeer(invalidPeer))
}