mirror of
https://github.com/matrix-org/dendrite
synced 2024-12-14 16:23:50 +01:00
Use ServerKeyAPI as keyring (#1110)
* Use ServerKeyAPI as keyring * Update fetcher name for debug logs
This commit is contained in:
parent
464718c3e6
commit
d9d6f4568c
1 changed files with 8 additions and 4 deletions
|
@ -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(
|
||||||
|
@ -84,5 +88,5 @@ func (s *ServerKeyAPI) FetchKeys(
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ServerKeyAPI) FetcherName() string {
|
func (s *ServerKeyAPI) FetcherName() string {
|
||||||
return s.OurKeyRing.KeyDatabase.FetcherName()
|
return fmt.Sprintf("ServerKeyAPI (wrapping %q)", s.OurKeyRing.KeyDatabase.FetcherName())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue