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 { func (s *ServerKeyAPI) KeyRing() *gomatrixserverlib.KeyRing {
// Return a real keyring - one that has the real database and real // Return a keyring that forces requests to be proxied through the
// fetchers. // below functions. That way we can enforce things like validity
return &s.OurKeyRing // and keeping the cache up-to-date.
return &gomatrixserverlib.KeyRing{
KeyDatabase: s,
KeyFetchers: []gomatrixserverlib.KeyFetcher{s},
}
} }
func (s *ServerKeyAPI) StoreKeys( func (s *ServerKeyAPI) StoreKeys(