From 153bfbbea579dfa10e8e804036f17c1a33b6fe80 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Fri, 18 Feb 2022 11:31:05 +0000 Subject: Merge both user API databases into one (#2186) * Merge user API databases into one * Remove DeviceDatabase from config * Fix tests * Try that again * Clean up keyserver device keys when the devices no longer exist in the user API * Tweak ordering * Fix UserExists flag, device check * Allow including empty entries so we can clean them up * Remove logging --- userapi/api/api_logintoken.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'userapi/api/api_logintoken.go') diff --git a/userapi/api/api_logintoken.go b/userapi/api/api_logintoken.go index f3aa037e..e2207bb5 100644 --- a/userapi/api/api_logintoken.go +++ b/userapi/api/api_logintoken.go @@ -19,6 +19,13 @@ import ( "time" ) +// DefaultLoginTokenLifetime determines how old a valid token may be. +// +// NOTSPEC: The current spec says "SHOULD be limited to around five +// seconds". Since TCP retries are on the order of 3 s, 5 s sounds very low. +// Synapse uses 2 min (https://github.com/matrix-org/synapse/blob/78d5f91de1a9baf4dbb0a794cb49a799f29f7a38/synapse/handlers/auth.py#L1323-L1325). +const DefaultLoginTokenLifetime = 2 * time.Minute + type LoginTokenInternalAPI interface { // PerformLoginTokenCreation creates a new login token and associates it with the provided data. PerformLoginTokenCreation(ctx context.Context, req *PerformLoginTokenCreationRequest, res *PerformLoginTokenCreationResponse) error -- cgit v1.2.3