mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-14 13:22:26 +03:00
Implement server whitelist
This commit is contained in:
parent
add73ec866
commit
b2ecd5648c
14 changed files with 332 additions and 0 deletions
|
@ -112,6 +112,12 @@ func NewFederationInternalAPI(
|
|||
}
|
||||
}
|
||||
|
||||
// IsWhitelistedOrAny checks if the server is whitelisted or the whitelist is disabled, so we can connect to any server
|
||||
func (a *FederationInternalAPI) IsWhitelistedOrAny(s spec.ServerName) bool {
|
||||
stats := a.statistics.ForServer(s)
|
||||
return stats.Whitelisted() || !a.cfg.EnableWhitelist
|
||||
}
|
||||
|
||||
func (a *FederationInternalAPI) IsBlacklistedOrBackingOff(s spec.ServerName) (*statistics.ServerStatistics, error) {
|
||||
stats := a.statistics.ForServer(s)
|
||||
if stats.Blacklisted() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue