netbird/management/server
Misha Bragin f984b8a091
Proactively expire peers' login per account (#698)
Goals:

Enable peer login expiration when adding new peer
Expire peer's login when the time comes
The account manager triggers peer expiration routine in future if the
following conditions are true:

peer expiration is enabled for the account
there is at least one peer that has expiration enabled and is connected
The time of the next expiration check is based on the nearest peer expiration.
Account manager finds a peer with the oldest last login (auth) timestamp and
calculates the time when it has to run the routine as a sum of the configured
peer login expiration duration and the peer's last login time.

When triggered, the expiration routine checks whether there are expired peers.
The management server closes the update channel of these peers and updates
network map of other peers to exclude expired peers so that the expired peers
are not able to connect anywhere.

The account manager can reschedule or cancel peer expiration in the following cases:

when admin changes account setting (peer expiration enable/disable)
when admin updates the expiration duration of the account
when admin updates peer expiration (enable/disable)
when peer connects (Sync)
P.S. The network map calculation was updated to exclude peers that have login expired.
2023-02-27 16:44:26 +01:00
..
activity Fix login expiration enum in OpenAPI (#694) 2023-02-16 15:36:36 +01:00
http Fix login expiration enum in OpenAPI (#694) 2023-02-16 15:36:36 +01:00
idp Add IdP metrics (#521) 2022-10-22 13:29:39 +02:00
jwtclaims Feature: add custom id claim (#667) 2023-02-03 21:47:20 +01:00
metrics Use Peer.ID instead of Peer.Key as peer identifier (#664) 2023-02-03 10:33:28 +01:00
mock_server Add Account HTTP API (#691) 2023-02-16 12:00:41 +01:00
status Replace gRPC errors in business logic with internal ones (#558) 2022-11-11 20:36:45 +01:00
telemetry Add gRPC metrics (#522) 2022-10-22 15:06:54 +02:00
testdata Replace IP allocation logic (#342) 2022-05-29 22:43:39 +02:00
account_test.go Proactively expire peers' login per account (#698) 2023-02-27 16:44:26 +01:00
account.go Proactively expire peers' login per account (#698) 2023-02-27 16:44:26 +01:00
config.go Feature: add custom id claim (#667) 2023-02-03 21:47:20 +01:00
dns_test.go Use Peer.ID instead of Peer.Key as peer identifier (#664) 2023-02-03 10:33:28 +01:00
dns.go Simplify event storing with one generic method (#662) 2023-01-24 10:17:24 +01:00
event_test.go Add system activity tracking and event store (#636) 2023-01-02 15:11:32 +01:00
event.go Simplify event storing with one generic method (#662) 2023-01-24 10:17:24 +01:00
file_store_test.go Use Peer.ID instead of Peer.Key as peer identifier (#664) 2023-02-03 10:33:28 +01:00
file_store.go Add account settings (#686) 2023-02-13 15:07:15 +01:00
group.go Use Peer.ID instead of Peer.Key as peer identifier (#664) 2023-02-03 10:33:28 +01:00
grpcserver.go Proactively expire peers' login per account (#698) 2023-02-27 16:44:26 +01:00
management_proto_test.go Adding --external-ip-map and --dns-resolver-address and shorthand flags (#652) 2023-01-17 19:16:50 +01:00
management_suite_test.go Move management server to a separate directory (#67) 2021-07-24 16:14:29 +02:00
management_test.go Add system activity tracking and event store (#636) 2023-01-02 15:11:32 +01:00
nameserver_test.go Add more activity events (#663) 2023-01-25 16:29:59 +01:00
nameserver.go Add more activity events (#663) 2023-01-25 16:29:59 +01:00
network_test.go Replace IP allocation logic (#342) 2022-05-29 22:43:39 +02:00
network.go Replace gRPC errors in business logic with internal ones (#558) 2022-11-11 20:36:45 +01:00
peer_test.go Proactively expire peers' login per account (#698) 2023-02-27 16:44:26 +01:00
peer.go Proactively expire peers' login per account (#698) 2023-02-27 16:44:26 +01:00
route_test.go Use Peer.ID instead of Peer.Key as peer identifier (#664) 2023-02-03 10:33:28 +01:00
route.go Use Peer.ID instead of Peer.Key as peer identifier (#664) 2023-02-03 10:33:28 +01:00
rule.go Simplify event storing with one generic method (#662) 2023-01-24 10:17:24 +01:00
scheduler_test.go Proactively expire peers' login per account (#698) 2023-02-27 16:44:26 +01:00
scheduler.go Proactively expire peers' login per account (#698) 2023-02-27 16:44:26 +01:00
setupkey_test.go Simplify event storing with one generic method (#662) 2023-01-24 10:17:24 +01:00
setupkey.go Simplify event storing with one generic method (#662) 2023-01-24 10:17:24 +01:00
store.go Use Peer.ID instead of Peer.Key as peer identifier (#664) 2023-02-03 10:33:28 +01:00
turncredentials_test.go Rename module to netbirdio/netbird (#288) 2022-03-26 12:08:54 +01:00
turncredentials.go Proactively expire peers' login per account (#698) 2023-02-27 16:44:26 +01:00
updatechannel_test.go Use select for turn credentials and peers update (#443) 2022-08-27 12:57:03 +02:00
updatechannel.go Proactively expire peers' login per account (#698) 2023-02-27 16:44:26 +01:00
user.go Simplify event storing with one generic method (#662) 2023-01-24 10:17:24 +01:00