Factor out keyring initialisation (#329)

Take the keyring init from the client-api-server and the monolith out to a
shared file
This commit is contained in:
Richard van der Hoff 2017-11-13 18:39:09 +00:00 committed by GitHub
parent 90396b5620
commit bf855a7e5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 14 deletions

View file

@ -98,13 +98,7 @@ func main() {
log.Panicf("Failed to setup key database(%q): %s", cfg.Database.ServerKey, err.Error())
}
keyRing := gomatrixserverlib.KeyRing{
KeyFetchers: []gomatrixserverlib.KeyFetcher{
// TODO: Use perspective key fetchers for production.
&gomatrixserverlib.DirectKeyFetcher{Client: federation.Client},
},
KeyDatabase: keyDB,
}
keyRing := keydb.CreateKeyRing(federation.Client, keyDB)
kafkaConsumer, err := sarama.NewConsumer(cfg.Kafka.Addresses, nil)
if err != nil {