MCPcopy Create free account
hub / github.com/daodst/chat / StoreKeys

Method StoreKeys

federationapi/inthttp/client.go:562–578  ·  view source on GitHub ↗
(
	_ context.Context,
	results map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.PublicKeyLookupResult,
)

Source from the content-addressed store, hash-verified

560}
561
562func (s *httpFederationInternalAPI) StoreKeys(
563 _ context.Context,
564 results map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.PublicKeyLookupResult,
565) error {
566 // Run in a background context - we don't want to stop this work just
567 // because the caller gives up waiting.
568 ctx := context.Background()
569 request := api.InputPublicKeysRequest{
570 Keys: make(map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.PublicKeyLookupResult),
571 }
572 response := api.InputPublicKeysResponse{}
573 for req, res := range results {
574 request.Keys[req] = res
575 s.cache.StoreServerKey(req, res)
576 }
577 return s.InputPublicKeys(ctx, &request, &response)
578}
579
580func (s *httpFederationInternalAPI) FetchKeys(
581 _ context.Context,

Callers 1

AddRoutesFunction · 0.45

Calls 2

InputPublicKeysMethod · 0.95
StoreServerKeyMethod · 0.65

Tested by

no test coverage detected