Skip to content

Add per-app data API, scoped app sessions and app data contract - #1

Merged
Indoworkspace merged 1 commit into
mainfrom
feat/app-data-api
Nov 15, 2026
Merged

Indoworkspace merged 1 commit into
mainfrom
feat/app-data-api

Conversation

@Indoworkspace

Copy link
Copy Markdown
Owner

Adds the per-app data layer for Sankalp, Eyesearch and Eyebrowse.

What it adds

  • Panel surface (/api/v1/me/apps...): list, read, pause, revoke one app, clear, export.
  • App surface (/api/v1/app/...): identity, state, preferences, saved, history, logout.
  • Sign-in hand-off: /api/v1/me/apps/{app}/authorize mints a 60-second single-use code bound to a PKCE challenge and a registered redirect prefix; /api/v1/app/session exchanges it for a 30-day app-scoped token stored only as a SHA-256 digest.
  • Per-app sessions (APP#<KEY>#SESSION#<id>) so one app can be signed out without touching the others.
  • Server-side URL sanitising (query string and fragment stripped), 500-entry history cap, 200 KB box cap.
  • connected is 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.py runs 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 check passes.

Not verified
Nothing has been run against real DynamoDB or deployed. sam build has 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.

@Indoworkspace
Indoworkspace merged commit c3d66bd into main Nov 15, 2026
@Indoworkspace
Indoworkspace deleted the feat/app-data-api branch November 15, 2026 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant