fix: platform hardening — security, API contracts, UX, tests#22
Open
Javaris500 wants to merge 1 commit into
Open
fix: platform hardening — security, API contracts, UX, tests#22Javaris500 wants to merge 1 commit into
Javaris500 wants to merge 1 commit into
Conversation
…test coverage Resolves issues #17, #18, #19, #20 and addresses 18 audit findings across 6 phases. Security (Phase 2): - Add authorization checks to org/workspace/user controllers - Fix WorkspaceAuth plug to check :id on workspace routes - Scope workspace.activate to current user only (was archiving all users) - Add workspace scoping to session controller (show/transcript/message/stream) - Fix agent index fallback leaking all agents for new users API contracts (Phase 1 & 4): - Fix workspace creation 422 (client sends directory, backend expects path) - Fix response unwrapping for sessions, issues, projects, goals, workspaces - Fix session chain key mismatch (chain vs sessions) - Remove dead sessions.create() — no backend route exists UX stability (Phase 3): - Add token refresh + redirect to /auth on 401 expiry - Add .catch() error handler to initializeAuth() with retry UI Hardening (Phase 5): - Fix dashboard auto-refresh interval leak on unmount - Strengthen email validation regex (was only checking for @) - Safe integer parsing across 19 controllers (parse_int helper) - Wrap org creation + membership in Ecto.Multi transaction - Move API keys from localStorage to sessionStorage on web builds - Align TypeScript types with actual backend responses Foundation (Phase 6): - Add 7 new test files (46 tests, 0 failures, 0 regressions) - Extract shared API base URL config (client.ts, sse.ts, websocket.ts) - Disable rate limiter in test env for reliable test execution Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
Full platform audit and hardening across 6 phases (18 tasks). Resolves issues #17, #18, #19, #20 and addresses 14 additional findings from a comprehensive security and edge-case audit.
55 files changed, 46 new tests, 0 regressions.
Phase 1 — Unblock Users
directory, backend expectspath){entity: data}but client was reading flatPhase 2 — Security
WorkspaceAuthplug to check:idparam on workspace routes (was only checkingworkspace_id)workspace.activateto current user — was archiving every workspace in the DBPhase 3 — UX Stability
/authon 401 (was silently failing).catch()toinitializeAuth()with error UI and retry button (was hanging forever)Phase 4 — Data Accuracy
chainvssessions)sessions.create()(no backend route, never called from UI)Phase 5 — Hardening
~r/@/to proper format checkparse_int/2) across 19 controllers (prevents 500 on?limit=abc)Ecto.MultitransactionlocalStoragetosessionStorageon web buildsPhase 6 — Foundation
config.tsfor API base URL (was hardcoded in 3 files)Test plan
mix compile --warnings-as-errorspasses cleanSee
docs/AUDIT-CHECKLIST.mdfor the full audit with per-issue explanations.🤖 Generated with Claude Code