Skip to content

fix(admin): restore account access and remove duplicate rows - #7818

Merged
bokelley merged 1 commit into
mainfrom
boston-v23
Sep 30, 2026
Merged

bokelley merged 1 commit into
mainfrom
boston-v23

Conversation

@bokelley

@bokelley bokelley commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Keep the credential-selected organization when a platform admin opens another account's detail page or API endpoint. Admin URL and payload organization IDs identify target accounts; an explicit conflicting organization header still fails authentication.
  • Select one pending task and one open invoice per organization in account list views, so multiple action items do not multiply account rows.
  • Add auth and database regression tests for both failures.

Validation

  • npx vitest run --config server/vitest.config.ts server/tests/unit/authorization-epoch-session.test.ts server/tests/unit/require-admin-cross-tenant.test.ts (193 tests passed)
  • npx tsc --project server/tsconfig.json --noEmit (passed)
  • Precommit suite (runs on commit)
  • Database integration regression runs in CI; local Postgres is unavailable in this workspace.

Expert review

  • Security reviewer: no reachable privilege escalation or tenant isolation issue; tenant API keys retain their existing route guard.
  • Code reviewer: ready to push; joins preserve one row per organization and fixture satisfies migration constraints.

Open workspace in Conductor

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Approve

Approve — admin auth org-selection fix with no blocking or medium findings.

What I checked:

  • Admin auth change keeps the caller's own credential org while treating URL/payload org IDs as targets; conflicting x-organization-id headers fail closed (403). No privilege escalation — admin authority is user-based (WG membership) and all admin routes remain independently requireAdmin-guarded.
  • LATERAL LIMIT 1 joins de-duplicate account rows correctly with all referenced columns selected and deterministic ordering.
  • Both FK tables cascade on org delete, so the new integration tests clean up correctly.
  • No protocol surface touched (static/schemas/source/**, docs/reference/**, dist/**), so schema↔docs coherence, changeset, oneOf, and artifact-immutability gates do not apply. This is an admin/app-only change.

High-risk flag: true only because server/src/routes/admin/accounts.ts (modified) matches server/src/routes/**. Per the decision rules, a modified high-risk file with no medium-or-higher findings is presumed safe — not an escalation trigger.

Gates: gated_paths: false; no no-auto-approve team match. review_decision is REVIEW_REQUIRED, but no gate (path-based or prose) applies to force escalation. No critical/high/medium findings, so rows 1–8 do not fire; falls through to row 9.

@bokelley
bokelley merged commit 84eaaed into main Sep 30, 2026
31 checks passed
@bokelley
bokelley deleted the boston-v23 branch September 30, 2026 18:57
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