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

Function LocalKeys

federationapi/routing/keys.go:133–139  ·  view source on GitHub ↗

LocalKeys returns the local keys for the server. See https://matrix.org/docs/spec/server_server/unstable.html#publishing-keys

(cfg *config.FederationAPI)

Source from the content-addressed store, hash-verified

131// LocalKeys returns the local keys for the server.
132// See https://matrix.org/docs/spec/server_server/unstable.html#publishing-keys
133func LocalKeys(cfg *config.FederationAPI) util.JSONResponse {
134 keys, err := localKeys(cfg, time.Now().Add(cfg.Matrix.KeyValidityPeriod))
135 if err != nil {
136 return util.ErrorResponse(err)
137 }
138 return util.JSONResponse{Code: http.StatusOK, JSON: keys}
139}
140
141func localKeys(cfg *config.FederationAPI, validUntil time.Time) (*gomatrixserverlib.ServerKeys, error) {
142 var keys gomatrixserverlib.ServerKeys

Callers 1

SetupFunction · 0.85

Calls 2

localKeysFunction · 0.85
AddMethod · 0.80

Tested by

no test coverage detected