mirror of
https://github.com/netbirdio/netbird.git
synced 2025-08-18 02:50:43 +02:00
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:
@@ -1498,6 +1498,7 @@ func TestAccount_GetExpiredPeers(t *testing.T) {
|
||||
LoginExpired: false,
|
||||
},
|
||||
LastLogin: time.Now().Add(-30 * time.Minute),
|
||||
UserID: userID,
|
||||
},
|
||||
"peer-2": {
|
||||
ID: "peer-2",
|
||||
@@ -1508,6 +1509,7 @@ func TestAccount_GetExpiredPeers(t *testing.T) {
|
||||
LoginExpired: false,
|
||||
},
|
||||
LastLogin: time.Now().Add(-2 * time.Hour),
|
||||
UserID: userID,
|
||||
},
|
||||
|
||||
"peer-3": {
|
||||
@@ -1519,6 +1521,7 @@ func TestAccount_GetExpiredPeers(t *testing.T) {
|
||||
LoginExpired: false,
|
||||
},
|
||||
LastLogin: time.Now().Add(-1 * time.Hour),
|
||||
UserID: userID,
|
||||
},
|
||||
},
|
||||
expectedPeers: map[string]struct{}{
|
||||
|
Reference in New Issue
Block a user