diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2021-08-18 12:07:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-18 12:07:09 +0100 |
commit | 614e67280defda4a9156f620f2751e3ef136da81 (patch) | |
tree | ee1f1ce88768d0179b2dbd73ea40877cc507e55b /keyserver/storage/tables/interface.go | |
parent | 1bee1ae2048051b52bc5b5084808a0418c0def04 (diff) |
Delete device keys/signatures from key server when deleting devices (#1979)
* Delete device keys/signatures from key server when deleting device from user API
* Move loop to within database transaction
* Don't fall over deleting no rows
Diffstat (limited to 'keyserver/storage/tables/interface.go')
-rw-r--r-- | keyserver/storage/tables/interface.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/keyserver/storage/tables/interface.go b/keyserver/storage/tables/interface.go index 0649b680..612eeb86 100644 --- a/keyserver/storage/tables/interface.go +++ b/keyserver/storage/tables/interface.go @@ -39,6 +39,7 @@ type DeviceKeys interface { SelectMaxStreamIDForUser(ctx context.Context, txn *sql.Tx, userID string) (streamID int32, err error) CountStreamIDsForUser(ctx context.Context, userID string, streamIDs []int64) (int, error) SelectBatchDeviceKeys(ctx context.Context, userID string, deviceIDs []string) ([]api.DeviceMessage, error) + DeleteDeviceKeys(ctx context.Context, txn *sql.Tx, userID, deviceID string) error DeleteAllDeviceKeys(ctx context.Context, txn *sql.Tx, userID string) error } @@ -62,4 +63,5 @@ type CrossSigningKeys interface { type CrossSigningSigs interface { SelectCrossSigningSigsForTarget(ctx context.Context, txn *sql.Tx, targetUserID string, targetKeyID gomatrixserverlib.KeyID) (r types.CrossSigningSigMap, err error) UpsertCrossSigningSigsForTarget(ctx context.Context, txn *sql.Tx, originUserID string, originKeyID gomatrixserverlib.KeyID, targetUserID string, targetKeyID gomatrixserverlib.KeyID, signature gomatrixserverlib.Base64Bytes) error + DeleteCrossSigningSigsForTarget(ctx context.Context, txn *sql.Tx, targetUserID string, targetKeyID gomatrixserverlib.KeyID) error } |