mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-12 09:23:09 -06:00
Warn loudly when app service requests unimplemented options
This commit is contained in:
parent
e015f1410b
commit
b8be4c66c2
|
|
@ -21,6 +21,7 @@ import (
|
|||
"regexp"
|
||||
"strings"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
yaml "gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
|
|
@ -169,6 +170,7 @@ func appendExclusiveNamespaceRegexs(
|
|||
|
||||
// checkErrors checks for any configuration errors amongst the loaded
|
||||
// application services according to the application service spec.
|
||||
// nolint: gocyclo
|
||||
func checkErrors(config *Dendrite) (err error) {
|
||||
var idMap = make(map[string]bool)
|
||||
var tokenMap = make(map[string]bool)
|
||||
|
|
@ -189,6 +191,9 @@ func checkErrors(config *Dendrite) (err error) {
|
|||
|
||||
// Check if GroupID for the users namespace is in the correct format
|
||||
if key == "users" && namespace.GroupID != "" {
|
||||
// TODO: Remove once group_id is implemented
|
||||
log.Warn("WARNING: Application service option group_id is currently unimplemented")
|
||||
|
||||
correctFormat := groupIDRegexp.MatchString(namespace.GroupID)
|
||||
if !correctFormat {
|
||||
return configErrors([]string{fmt.Sprintf(
|
||||
|
|
@ -230,6 +235,15 @@ func checkErrors(config *Dendrite) (err error) {
|
|||
)})
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Remove once group_id is implemented
|
||||
if appservice.RateLimited {
|
||||
log.Warn("WARNING: Application service option rate_limited is currently unimplemented")
|
||||
}
|
||||
// TODO: Remove once protocols is implemented
|
||||
if len(appservice.Protocols) > 0 {
|
||||
log.Warn("WARNING: Application service option protocols is currently unimplemented")
|
||||
}
|
||||
}
|
||||
|
||||
return setupRegexps(config)
|
||||
|
|
|
|||
Loading…
Reference in a new issue