mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-12-15 23:13:50 -05:00
Implement access token expiry (#5660)
Record how long an access token is valid for, and raise a soft-logout once it expires.
This commit is contained in:
parent
24aa0e0a5b
commit
5f158ec039
14 changed files with 255 additions and 33 deletions
|
|
@ -57,7 +57,7 @@ class RegistrationStoreTestCase(unittest.TestCase):
|
|||
def test_add_tokens(self):
|
||||
yield self.store.register_user(self.user_id, self.pwhash)
|
||||
yield self.store.add_access_token_to_user(
|
||||
self.user_id, self.tokens[1], self.device_id
|
||||
self.user_id, self.tokens[1], self.device_id, valid_until_ms=None
|
||||
)
|
||||
|
||||
result = yield self.store.get_user_by_access_token(self.tokens[1])
|
||||
|
|
@ -72,9 +72,11 @@ class RegistrationStoreTestCase(unittest.TestCase):
|
|||
def test_user_delete_access_tokens(self):
|
||||
# add some tokens
|
||||
yield self.store.register_user(self.user_id, self.pwhash)
|
||||
yield self.store.add_access_token_to_user(self.user_id, self.tokens[0])
|
||||
yield self.store.add_access_token_to_user(
|
||||
self.user_id, self.tokens[1], self.device_id
|
||||
self.user_id, self.tokens[0], device_id=None, valid_until_ms=None
|
||||
)
|
||||
yield self.store.add_access_token_to_user(
|
||||
self.user_id, self.tokens[1], self.device_id, valid_until_ms=None
|
||||
)
|
||||
|
||||
# now delete some
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue