Repository navigation
Add per-app data API, scoped app sessions and app data contract - #1
Merged
Merged
Conversation
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.
Adds the per-app data layer for Sankalp, Eyesearch and Eyebrowse.
What it adds
/api/v1/me/apps...): list, read, pause, revoke one app, clear, export./api/v1/app/...): identity, state, preferences, saved, history, logout./api/v1/me/apps/{app}/authorizemints a 60-second single-use code bound to a PKCE challenge and a registered redirect prefix;/api/v1/app/sessionexchanges it for a 30-day app-scoped token stored only as a SHA-256 digest.APP#<KEY>#SESSION#<id>) so one app can be signed out without touching the others.connectedis no longer hardcoded true; it now reflects a live app session.Isolation
The app key is taken from the token, never from the path, so there is no URL an app can call that names another app. An app token on the panel door returns 403 and an account session on the app door returns 403.
Verification
python3 backend/tests/app_data_smoke.pyruns the whole flow against an in-memory table (no AWS, no production data) and covers 40 checks: unregistered redirect refused, wrong PKCE refused, code replay refused, query strings stripped, Eyebrowse data never appearing in the Eyesearch box, revoked token dying immediately, and account deletion removing every app item. All pass.npm run checkpasses.Not verified
Nothing has been run against real DynamoDB or deployed.
sam buildhas not been run.Files
backend/app/config.py,backend/app/main.py,backend/app/repository.py,backend/tests/app_data_smoke.py,docs/app-data-contract.md.