Fix: reject revoked tokens on all replicas when Redis writes fail
This commit is contained in:
+20
-17
@@ -1,7 +1,7 @@
|
||||
# ./gradlew test (Testcontainers: postgres:17.6-alpine3.22, redis:8.4.0-alpine)
|
||||
total: 68 tests, 0 failed
|
||||
total: 70 tests, 0 failed
|
||||
|
||||
infrastructure.controllers.authentication.AuthenticationControllerTest: 9 tests, 0 failed, 7.132 s
|
||||
infrastructure.controllers.authentication.AuthenticationControllerTest: 9 tests, 0 failed, 3.509 s
|
||||
- logout revokes only the current token
|
||||
- Bearer token cannot open a session
|
||||
- password containing a colon and non-ASCII characters works
|
||||
@@ -11,19 +11,19 @@ infrastructure.controllers.authentication.AuthenticationControllerTest: 9 tests,
|
||||
- valid Basic credentials open a session
|
||||
- missing or malformed Basic header returns 401
|
||||
- wrong password and unknown user get the same 401
|
||||
infrastructure.controllers.chat.ChatControllerTest: 6 tests, 0 failed, 2.173 s
|
||||
infrastructure.controllers.chat.ChatControllerTest: 6 tests, 0 failed, 1.078 s
|
||||
- member can read own chat and members keep their order
|
||||
- unknown member is rejected before anything is written
|
||||
- foreign chat returns 404 for non-member
|
||||
- cursor issued to another user is rejected
|
||||
- chat list contains only own chats and is paginated
|
||||
- invalid member lists are rejected with 400
|
||||
infrastructure.controllers.health.HealthControllerTest: 2 tests, 0 failed, 0.127 s
|
||||
infrastructure.controllers.health.HealthControllerTest: 2 tests, 0 failed, 0.102 s
|
||||
- live returns 200
|
||||
- ready returns 200 when database is reachable
|
||||
infrastructure.controllers.message.MessageConcurrencyTest: 1 tests, 0 failed, 0.285 s
|
||||
infrastructure.controllers.message.MessageConcurrencyTest: 1 tests, 0 failed, 0.230 s
|
||||
- parallel senders produce exactly N unique messages
|
||||
infrastructure.controllers.message.MessageControllerTest: 7 tests, 0 failed, 1.826 s
|
||||
infrastructure.controllers.message.MessageControllerTest: 7 tests, 0 failed, 1.020 s
|
||||
- foreign chat returns 404 when sending
|
||||
- last page has null next_cursor
|
||||
- pagination walks all messages exactly once
|
||||
@@ -31,7 +31,7 @@ infrastructure.controllers.message.MessageControllerTest: 7 tests, 0 failed, 1.8
|
||||
- empty text returns 400 invalid_request
|
||||
- history that is an exact multiple of limit ends with null next_cursor
|
||||
- foreign cursor returns 400
|
||||
infrastructure.controllers.message.MessageIdempotencyTest: 7 tests, 0 failed, 3.269 s
|
||||
infrastructure.controllers.message.MessageIdempotencyTest: 7 tests, 0 failed, 2.500 s
|
||||
- expired key can be used for a new message
|
||||
- key scope is user and chat
|
||||
- same key with another body is a conflict
|
||||
@@ -39,7 +39,7 @@ infrastructure.controllers.message.MessageIdempotencyTest: 7 tests, 0 failed, 3.
|
||||
- retry with the same key and body returns the original message
|
||||
- retry by a former outsider is still checked for access
|
||||
- concurrent retries create exactly one message
|
||||
infrastructure.controllers.user.UserControllerTest: 11 tests, 0 failed, 1.668 s
|
||||
infrastructure.controllers.user.UserControllerTest: 11 tests, 0 failed, 0.917 s
|
||||
- password shorter than 12 code points returns 400
|
||||
- concurrent registrations of one username create exactly one user
|
||||
- X-User-Id alone gives no access
|
||||
@@ -51,37 +51,40 @@ infrastructure.controllers.user.UserControllerTest: 11 tests, 0 failed, 1.668 s
|
||||
- Basic credentials are rejected on business endpoints
|
||||
- me returns the session owner
|
||||
- X-User-Id does not override bearer identity
|
||||
infrastructure.repositories.authentication.session.cache.RedisSessionCacheRepositoryTest: 3 tests, 0 failed, 0.091 s
|
||||
infrastructure.repositories.authentication.session.cache.RedisSessionCacheRepositoryTest: 3 tests, 0 failed, 0.124 s
|
||||
- cached session round-trips and expires together with the session
|
||||
- revoke replaces a cached session with a tombstone
|
||||
- late cache fill cannot overwrite a tombstone
|
||||
infrastructure.repositories.chat.ExposedChatRepositoryTest: 2 tests, 0 failed, 0.498 s
|
||||
infrastructure.repositories.chat.ExposedChatRepositoryTest: 2 tests, 0 failed, 0.233 s
|
||||
- chat row is rolled back when inserting members fails
|
||||
- successful creation commits the chat and every member
|
||||
infrastructure.services.authentication.SessionLookupSingleFlightTest: 4 tests, 0 failed, 1.122 s
|
||||
infrastructure.services.authentication.CrossReplicaRevocationTest: 2 tests, 0 failed, 11.634 s
|
||||
- unconfirmed logout makes every replica bypass the cache
|
||||
- logout waits for paused Redis writes and then no replica accepts the token
|
||||
infrastructure.services.authentication.SessionLookupSingleFlightTest: 4 tests, 0 failed, 1.091 s
|
||||
- request arriving after logout does not join a lookup started before it
|
||||
- without single-flight every concurrent miss queries the database
|
||||
- with single-flight concurrent misses share one database lookup
|
||||
- lookup that finished before a request arrived is not reused
|
||||
infrastructure.services.hashing.DefaultHashingServiceTest: 4 tests, 0 failed, 0.418 s
|
||||
infrastructure.services.hashing.DefaultHashingServiceTest: 4 tests, 0 failed, 0.170 s
|
||||
- passwords differing only after 72 bytes are distinguished
|
||||
- validates the right password and rejects a wrong one
|
||||
- malformed hash is rejected instead of throwing
|
||||
- hash is a salted Argon2id PHC string
|
||||
plugins.CorsTest: 2 tests, 0 failed, 0.119 s
|
||||
plugins.CorsTest: 2 tests, 0 failed, 0.129 s
|
||||
- page of the API itself may call it
|
||||
- unknown origin is rejected
|
||||
plugins.DatabaseMigrationTest: 1 tests, 0 failed, 0.188 s
|
||||
plugins.DatabaseMigrationTest: 1 tests, 0 failed, 0.185 s
|
||||
- re-running migrations applies nothing and keeps data
|
||||
plugins.DependencyFailureTest: 5 tests, 0 failed, 13.637 s
|
||||
plugins.DependencyFailureTest: 5 tests, 0 failed, 25.701 s
|
||||
- without PostgreSQL requests fail with a bounded 503
|
||||
- logout during a Redis outage survives an API restart
|
||||
- logout during a Redis outage is not undone by a stale cached copy
|
||||
- without Redis requests bypass the cache
|
||||
- hanging Redis costs one command timeout and recovers
|
||||
plugins.InstanceIdTest: 1 tests, 0 failed, 0.245 s
|
||||
plugins.InstanceIdTest: 1 tests, 0 failed, 0.087 s
|
||||
- every response names the replica
|
||||
plugins.SessionCacheTest: 3 tests, 0 failed, 0.953 s
|
||||
plugins.SessionCacheTest: 3 tests, 0 failed, 0.624 s
|
||||
- emptied cache falls back to PostgreSQL
|
||||
- first authenticated request fills the cache
|
||||
- logout leaves a tombstone and the token is rejected
|
||||
|
||||
Reference in New Issue
Block a user