aboutsummaryrefslogtreecommitdiff
path: root/serverkeyapi/storage/postgres
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2020-06-16 13:11:20 +0100
committerGitHub <noreply@github.com>2020-06-16 13:11:20 +0100
commit57b7fa3db801c27190bfd143cfebe98e3d76a6ae (patch)
tree0bc045b74be45987855dd2cf7358c83955cad7b0 /serverkeyapi/storage/postgres
parent67ad6618139a495a80800a2145d9ba319c5d0c5d (diff)
More server key updates, tests (#1129)
* More key tweaks * Start testing stuff * Move responsibility for generating local keys into server key API, don't register prom in caches unless needed, start tests * Don't store our own keys in the database * Don't store our own keys in the database * Don't run tests for now * Tweak caching behaviour, update tests * Update comments, add fixes from forward-merge * Debug logging * Debug logging * Perform final comparison against original set of requests * oops * Fetcher timeouts * Fetcher timeouts * missing func * Tweaks * Update gomatrixserverlib * Fix Federation API test * Break up FetchKeys * Add comments to caching * Add URL check in test * Partially revert "Move responsibility for generating local keys into server key API, don't register prom in caches unless needed, start tests" This reverts commit d7eb54c5b30b2f6a9d6514b643e32e6ad2b602f3. * Fix federation API test * Fix internal cache stuff again * Fix server key API test * Update comments * Update comments from review * Fix lint
Diffstat (limited to 'serverkeyapi/storage/postgres')
-rw-r--r--serverkeyapi/storage/postgres/keydb.go23
1 files changed, 0 insertions, 23 deletions
diff --git a/serverkeyapi/storage/postgres/keydb.go b/serverkeyapi/storage/postgres/keydb.go
index 32cdf951..aaa4409b 100644
--- a/serverkeyapi/storage/postgres/keydb.go
+++ b/serverkeyapi/storage/postgres/keydb.go
@@ -17,7 +17,6 @@ package postgres
import (
"context"
- "time"
"golang.org/x/crypto/ed25519"
@@ -51,28 +50,6 @@ func NewDatabase(
if err != nil {
return nil, err
}
- // Store our own keys so that we don't end up making HTTP requests to find our
- // own keys
- index := gomatrixserverlib.PublicKeyLookupRequest{
- ServerName: serverName,
- KeyID: serverKeyID,
- }
- value := gomatrixserverlib.PublicKeyLookupResult{
- VerifyKey: gomatrixserverlib.VerifyKey{
- Key: gomatrixserverlib.Base64Bytes(serverKey),
- },
- ValidUntilTS: gomatrixserverlib.AsTimestamp(time.Now().Add(100 * 365 * 24 * time.Hour)),
- ExpiredTS: gomatrixserverlib.PublicKeyNotExpired,
- }
- err = d.StoreKeys(
- context.Background(),
- map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.PublicKeyLookupResult{
- index: value,
- },
- )
- if err != nil {
- return nil, err
- }
return d, nil
}