Repository navigation
fix(organization): accept only keys and console sessions on organization routes - #14779
Conversation
…ion routes Organization routes resolve the organization from the project in the request, so a project session reached them with roles built from the project's own teams. Outside the console project, require an API key or a console session in admin mode, which the shared API hook checks against the organization's platform membership. Co-Authored-By: Claude <[email protected]>
|
Review complete. No blocking issues — approved ✅; 1 nitpick below. 🧹 Nitpicks (1) — 🟢 1 low
The change introduces an init hook in
Reviewed commit: 6a4a13b |
🟢 Tier S · Ready to merge
Organization routes now reject project end-user sessions on non-console projects while allowing API keys and console admin-mode sessions. The new E2E test exercises the rejected project-session routes and verifies successful key listing through admin mode and a project API key. Latest changes: The latest commit removes the
📂 Walkthrough · 2
Reviewed the commits since |
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
Co-Authored-By: Claude <[email protected]>
Security rulesNo new WARNING or ERROR findings from security rules. 6 existing findings tracked in
|
…ook answers first The key routes need key scopes a project session never holds, so the scope check refuses them before the organization hook runs. Co-Authored-By: Claude <[email protected]>
|
Re the tenki nitpick on asserting the error type: the list and get routes now also assert |
…ion routes (backport #14779) On a non-console project, a project session whose project team shared the organization ID counted as organization membership. Outside the console, organization routes now accept only API keys and console sessions in admin mode. The organization key routes do not exist on 1.9, so their test calls are dropped. (cherry picked from commit bf06dcb)
…ion routes (backport #14779) On a non-console project, a project session whose project team shared the organization ID counted as organization membership. Outside the console, organization routes now accept only API keys and console sessions in admin mode. The organization key routes do not exist on 1.9, so their test calls are dropped. (cherry picked from commit bf06dcb)
…ion routes (backport #14779) On a non-console project, a project session whose project team shared the organization ID counted as organization membership. Outside the console, organization routes now accept only API keys and console sessions in admin mode. The organization key routes do not exist on 1.9, so their test calls are dropped. (cherry picked from commit bf06dcb)
…ion routes (backport #14779) On a non-console project, a project session whose project team shared the organization ID counted as organization membership. Outside the console, organization routes now accept only API keys and console sessions in admin mode. The organization key routes do not exist on 1.9, so their test calls are dropped. (cherry picked from commit bf06dcb)
…ion routes (backport #14779) On a non-console project, a project session whose project team shared the organization ID counted as organization membership. Outside the console, organization routes now accept only API keys and console sessions in admin mode. The organization key routes do not exist on 1.9, so their test calls are dropped. (cherry picked from commit bf06dcb)
…ole-sessions fix(organization): accept only keys and console sessions on organization routes (cherry picked from commit bf06dcb)
Summary
Organization routes (
/v1/organization/*) resolve the organization from the project named in the request. Outside the console project they now require an API key or a console session in admin mode, so a project end-user session is refused and organization access is always checked against the organization's platform membership rather than the project's own teams.Changes
Organization/Http/Init.php: refuse requests on a non-console project that carry neither an API key nor admin mode, withuser_unauthorized. Console project requests and key-authorized requests are unchanged; admin-mode requests continue through the shared API hook's membership check.Tests
tests/e2e/Services/Organization/ProjectsCustomClientTest.php: a project user who owns a project team whose ID matches the organization ID gets 401 on organization project list, get, key list and key create; a console admin-mode session and a project API key still list keys. E2E is verified by the Organization CI lane.Related: appwrite-labs/cloud#6666