From 9f3078e32bd149d1038ee8fcb276d7f71a2eb6d4 Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Fri, 1 Sep 2017 13:08:32 +0100 Subject: [PATCH] Add config for trusted ID servers --- dendrite-config.yaml | 5 +++++ .../matrix-org/dendrite/common/config/config.go | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/dendrite-config.yaml b/dendrite-config.yaml index a91429c22..2bf14b5de 100644 --- a/dendrite-config.yaml +++ b/dendrite-config.yaml @@ -12,6 +12,11 @@ matrix: private_key: "/etc/dendrite/matrix_key.pem" # The x509 certificates used by the federation listeners for this server federation_certificates: ["/etc/dendrite/server.pem"] + # The list of identity servers trusted to verify third party identifiers by this server. + trusted_third_party_id_servers: + - vector.im + - matrix.org + - riot.im # The media repository config media: diff --git a/src/github.com/matrix-org/dendrite/common/config/config.go b/src/github.com/matrix-org/dendrite/common/config/config.go index 8d76a03d4..86234b8da 100644 --- a/src/github.com/matrix-org/dendrite/common/config/config.go +++ b/src/github.com/matrix-org/dendrite/common/config/config.go @@ -70,6 +70,10 @@ type Dendrite struct { // by remote servers. // Defaults to 24 hours. KeyValidityPeriod time.Duration `yaml:"key_validity_period"` + // List of domains that the server will trust as identity servers to + // verify third-party identifiers. + // Defaults to an empty array. + TrustedIDServers []string `yaml:"trusted_third_party_id_servers"` } `yaml:"matrix"` // The configuration specific to the media repostitory. @@ -273,6 +277,10 @@ func (config *Dendrite) setDefaults() { config.Matrix.KeyValidityPeriod = 24 * time.Hour } + if config.Matrix.TrustedIDServers == nil { + config.Matrix.TrustedIDServers = []string{} + } + if config.Media.MaxThumbnailGenerators == 0 { config.Media.MaxThumbnailGenerators = 10 }