Peer management login (#83)

* feature: replace RegisterPeer with Login method that does both - registration and login

* test: add management login test

* feature: add WiretrusteeConfig to the Login response to configure peer global config

* feature: add client peer login support

* fix: missing parts

* chore: update go deps

* feature: support Management Service gRPC endpoints [CLIENT]

* feature: finalize client sync with management

* fix: management store peer key lower case restore

* fix: management returns peer ip without a mask

* refactor: remove cmd pkg

* fix: invalid tun interface name on mac

* fix: timeout when calling management client

* fix: tests and lint errors

* fix: golang-test workflow

* fix: client service tests

* fix: iface build

* feature: detect management scheme on startup

* chore: better logs for management

* fix: goreleaser

* fix: lint errors

* fix: signal TLS

* fix: direct Wireguard connection

* chore: verbose logging on direct connection
This commit is contained in:
Mikhail Bragin
2021-08-15 16:56:26 +02:00
committed by GitHub
parent 80de6a75d5
commit 877ad97a96
34 changed files with 1139 additions and 783 deletions
+2 -2
View File
@@ -70,7 +70,7 @@ func restore(file string) (*FileStore, error) {
store.SetupKeyId2AccountId[strings.ToLower(setupKeyId)] = accountId
}
for _, peer := range account.Peers {
store.PeerKeyId2AccountId[strings.ToLower(peer.Key)] = accountId
store.PeerKeyId2AccountId[peer.Key] = accountId
}
}
@@ -90,7 +90,7 @@ func (s *FileStore) GetPeer(peerKey string) (*Peer, error) {
accountId, accountIdFound := s.PeerKeyId2AccountId[peerKey]
if !accountIdFound {
return nil, status.Errorf(codes.Internal, "account not found")
return nil, status.Errorf(codes.NotFound, "peer not found")
}
account, err := s.GetAccount(accountId)