mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-20 21:33:19 -06:00
Revert "Perform server key API operations using new context"
This reverts commit 02172223f5.
This commit is contained in:
parent
02172223f5
commit
8c7350d4dd
|
|
@ -70,10 +70,9 @@ func (s *httpServerKeyInternalAPI) FetcherName() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *httpServerKeyInternalAPI) StoreKeys(
|
func (s *httpServerKeyInternalAPI) StoreKeys(
|
||||||
_ context.Context,
|
ctx context.Context,
|
||||||
results map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.PublicKeyLookupResult,
|
results map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.PublicKeyLookupResult,
|
||||||
) error {
|
) error {
|
||||||
ctx := context.Background()
|
|
||||||
request := InputPublicKeysRequest{
|
request := InputPublicKeysRequest{
|
||||||
Keys: make(map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.PublicKeyLookupResult),
|
Keys: make(map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.PublicKeyLookupResult),
|
||||||
}
|
}
|
||||||
|
|
@ -86,10 +85,9 @@ func (s *httpServerKeyInternalAPI) StoreKeys(
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *httpServerKeyInternalAPI) FetchKeys(
|
func (s *httpServerKeyInternalAPI) FetchKeys(
|
||||||
_ context.Context,
|
ctx context.Context,
|
||||||
requests map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.Timestamp,
|
requests map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.Timestamp,
|
||||||
) (map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.PublicKeyLookupResult, error) {
|
) (map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.PublicKeyLookupResult, error) {
|
||||||
ctx := context.Background()
|
|
||||||
result := make(map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.PublicKeyLookupResult)
|
result := make(map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.PublicKeyLookupResult)
|
||||||
request := QueryPublicKeysRequest{
|
request := QueryPublicKeysRequest{
|
||||||
Requests: make(map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.Timestamp),
|
Requests: make(map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.Timestamp),
|
||||||
|
|
|
||||||
|
|
@ -25,19 +25,17 @@ func (s *ServerKeyAPI) KeyRing() *gomatrixserverlib.KeyRing {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ServerKeyAPI) StoreKeys(
|
func (s *ServerKeyAPI) StoreKeys(
|
||||||
_ context.Context,
|
ctx context.Context,
|
||||||
results map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.PublicKeyLookupResult,
|
results map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.PublicKeyLookupResult,
|
||||||
) error {
|
) error {
|
||||||
ctx := context.Background()
|
|
||||||
// Store any keys that we were given in our database.
|
// Store any keys that we were given in our database.
|
||||||
return s.OurKeyRing.KeyDatabase.StoreKeys(ctx, results)
|
return s.OurKeyRing.KeyDatabase.StoreKeys(ctx, results)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ServerKeyAPI) FetchKeys(
|
func (s *ServerKeyAPI) FetchKeys(
|
||||||
_ context.Context,
|
ctx context.Context,
|
||||||
requests map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.Timestamp,
|
requests map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.Timestamp,
|
||||||
) (map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.PublicKeyLookupResult, error) {
|
) (map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.PublicKeyLookupResult, error) {
|
||||||
ctx := context.Background()
|
|
||||||
results := map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.PublicKeyLookupResult{}
|
results := map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.PublicKeyLookupResult{}
|
||||||
// First consult our local database and see if we have the requested
|
// First consult our local database and see if we have the requested
|
||||||
// keys. These might come from a cache, depending on the database
|
// keys. These might come from a cache, depending on the database
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue