Implement server whitelist

This commit is contained in:
enaix 2025-01-16 12:31:37 +03:00
parent add73ec866
commit b2ecd5648c
14 changed files with 332 additions and 0 deletions

View file

@ -49,6 +49,11 @@ type Database interface {
RemoveAllServersFromBlacklist() error
IsServerBlacklisted(serverName spec.ServerName) (bool, error)
AddServerToWhitelist(serverName spec.ServerName) error
RemoveServerFromWhitelist(serverName spec.ServerName) error
RemoveAllServersFromWhitelist() error
IsServerWhitelisted(serverName spec.ServerName) (bool, error)
// Adds the server to the list of assumed offline servers.
// If the server already exists in the table, nothing happens and returns success.
SetServerAssumedOffline(ctx context.Context, serverName spec.ServerName) error