Repository navigation
feat(auth): handle server-side deletion of inactive sessions - #33
Merged
Merged
Conversation
Remember the sessions signed into on each server, so a refused log in to one of them says the session no longer exists on the server and offers to create a new one. Send the push endpoint again after every new sign-in, and drop the Signal state of a deleted session when its name comes back with a new id. Follows MaxDac/Privee#178; no API change. Closes #32 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 82bbdd2c-9933-4e50-bf78-77857791af0c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Handles the server-side cleanup from MaxDac/Privee#178. The server now deletes inactive sessions, then answers their log in with
401 invalid_credentials. The API is unchanged and there is noapi_versionbump.KnownSessionStorerecords, encrypted undernoBackupFilesDir, the session names and ids signed into on each server (sessions.bin). If a log in to one of those names gets a 401 or 404, the auth screen says the session no longer exists on the server because it was deleted after inactivity. It also shows a Create a new session button that opens registration with the name already filled in. The message is translated into en, it, pt-PT, es and fr. Unknown names still get the generic "wrong credentials" message.PushEndpointSynckeeps the endpoint returned by the distributor and sends it again withPUT /api/app/pushafter every new sign-in. The existing register-on-sign-in flow is unchanged. The cached endpoint is cleared on sign-out and when the distributor unregisters the app.signal-<id>.bin. "Forget device" also removes the name from the store.ARCHITECTURE.mdandTECHNOLOGIES.md.E2EE is unaffected. No keys or content are added to logs, push payloads or backups.
Closes #32
Checklist
.jks,.env):core:*modules contain noandroid.*/androidx.*imports./gradlew test)Validation:
./gradlew test :app:lintDebug :app:assembleDebugpassed locally. New tests:KnownSessionStoreTest,PushEndpointSyncTest,AuthProblemTest, and aninvalid_credentialslog-in case inPriveeApiTest. Not done: an end-to-end run on an emulator against a local server.