mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-15 13:42:26 +03:00
Implement server whitelist
This commit is contained in:
parent
add73ec866
commit
b2ecd5648c
14 changed files with 332 additions and 0 deletions
|
@ -46,6 +46,12 @@ type FederationAPI struct {
|
|||
|
||||
// Should we prefer direct key fetches over perspective ones?
|
||||
PreferDirectFetch bool `yaml:"prefer_direct_fetch"`
|
||||
|
||||
// Enable servers whitelist function
|
||||
EnableWhitelist bool `yaml:"enable_whitelist"`
|
||||
|
||||
// The list of whitelisted servers
|
||||
WhitelistedServers []spec.ServerName `yaml:"whitelisted_servers"`
|
||||
}
|
||||
|
||||
func (c *FederationAPI) Defaults(opts DefaultOpts) {
|
||||
|
@ -73,6 +79,8 @@ func (c *FederationAPI) Defaults(opts DefaultOpts) {
|
|||
c.Database.ConnectionString = "file:federationapi.db"
|
||||
}
|
||||
}
|
||||
c.EnableWhitelist = false
|
||||
c.WhitelistedServers = make([]spec.ServerName, 0)
|
||||
}
|
||||
|
||||
func (c *FederationAPI) Verify(configErrs *ConfigErrors) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue