From b8be4c66c2b68369d33bb4e3ba9e8da9c4239b06 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Tue, 5 Jun 2018 15:56:06 +0100 Subject: [PATCH] Warn loudly when app service requests unimplemented options --- .../dendrite/common/config/appservice.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/github.com/matrix-org/dendrite/common/config/appservice.go b/src/github.com/matrix-org/dendrite/common/config/appservice.go index 5ae673357..ab39583cc 100644 --- a/src/github.com/matrix-org/dendrite/common/config/appservice.go +++ b/src/github.com/matrix-org/dendrite/common/config/appservice.go @@ -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)