Check peer expiration after ACL check (#714)

Bug 1: When calculating the network map, peers added by a setup key
were falling under expiration logic while they shouldn't.

Bug 2: Peers HTTP API didn't return expired peers for non-admin users
because of the expired peer check in the ACL logic.

The fix applies peer expiration checks outside of the ACL logic.
This commit is contained in:
Misha Bragin
2023-03-02 12:45:10 +01:00
committed by GitHub
parent 1bda8fd563
commit fe22eb3b98
3 changed files with 20 additions and 7 deletions

View File

@ -55,6 +55,7 @@ func TestPeer_LoginExpired(t *testing.T) {
peer := &Peer{
LoginExpirationEnabled: c.expirationEnabled,
LastLogin: c.lastLogin,
UserID: userID,
}
expired, _ := peer.LoginExpired(c.accountSettings.PeerLoginExpiration)