Use ServerKeyAPI as keyring

This commit is contained in:
Neil Alexander 2020-06-10 10:36:53 +01:00
parent 85ac8a3f5b
commit c5f9bb685c

View file

@ -17,9 +17,13 @@ type ServerKeyAPI struct {
}
func (s *ServerKeyAPI) KeyRing() *gomatrixserverlib.KeyRing {
// Return a real keyring - one that has the real database and real
// fetchers.
return &s.OurKeyRing
// Return a keyring that forces requests to be proxied through the
// below functions. That way we can enforce things like validity
// and keeping the cache up-to-date.
return &gomatrixserverlib.KeyRing{
KeyDatabase: s,
KeyFetchers: []gomatrixserverlib.KeyFetcher{s},
}
}
func (s *ServerKeyAPI) StoreKeys(