-
- Downloads
Modify StoreKeyFetcher to read from server_keys_json. (#15417)
Before this change: * `PerspectivesKeyFetcher` and `ServerKeyFetcher` write to `server_keys_json`. * `PerspectivesKeyFetcher` also writes to `server_signature_keys`. * `StoreKeyFetcher` reads from `server_signature_keys`. After this change: * `PerspectivesKeyFetcher` and `ServerKeyFetcher` write to `server_keys_json`. * `PerspectivesKeyFetcher` also writes to `server_signature_keys`. * `StoreKeyFetcher` reads from `server_keys_json`. This results in `StoreKeyFetcher` now using the results from `ServerKeyFetcher` in addition to those from `PerspectivesKeyFetcher`, i.e. keys which are directly fetched from a server will now be pulled from the database instead of refetched. An additional minor change is included to avoid creating a `PerspectivesKeyFetcher` (and checking it) if no `trusted_key_servers` are configured. The overall impact of this should be better usage of cached results: * If a server has no trusted key servers configured then it should reduce how often keys are fetched. * if a server's trusted key server does not have a requested server's keys cached then it should reduce how often keys are directly fetched.
Showing
- changelog.d/15417.bugfix 1 addition, 0 deletionschangelog.d/15417.bugfix
- synapse/crypto/keyring.py 15 additions, 15 deletionssynapse/crypto/keyring.py
- synapse/rest/key/v2/remote_key_resource.py 1 addition, 1 deletionsynapse/rest/key/v2/remote_key_resource.py
- synapse/storage/databases/main/keys.py 87 additions, 12 deletionssynapse/storage/databases/main/keys.py
- tests/crypto/test_keyring.py 31 additions, 31 deletionstests/crypto/test_keyring.py
- tests/storage/test_keys.py 8 additions, 8 deletionstests/storage/test_keys.py
- tests/unittest.py 16 additions, 9 deletionstests/unittest.py
- tests/utils.py 3 additions, 0 deletionstests/utils.py
changelog.d/15417.bugfix
0 → 100644
Please register or sign in to comment