Skip to content

Commit 4232f48

Browse files
refactor(server): remove legacy administration surfaces (#34)
Remove unused server administration routes, role scaffolding, and proxy admin settings while preserving authentication and coding CLI commands. Cover removed routes, legacy claims, and retained network policy. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
1 parent 3c06750 commit 4232f48

10 files changed

Lines changed: 217 additions & 887 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/app-server.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,23 @@ The supported contract covers:
4141
| GET, DELETE | `/sessions/{id}` | Read/delete an in-memory session |
4242
| POST, GET | `/sessions/{id}/messages` | Store/list messages, no model inference |
4343

44-
Other development endpoints, including files, terminals, admin, SSE, and
44+
Other development endpoints, including files, terminals, SSE, and
4545
WebSockets, are not yet part of this stable schema. Authentication applies to
4646
them too. A configured server API key is an operator credential, not a
47-
multi-tenant sandbox. JWT admin routes require the `admin` role; ordinary
48-
authenticated routes operate on the server's workspace. Do not host mutually
49-
untrusted tenants in one process.
47+
multi-tenant sandbox. Authenticated routes operate on the server's workspace.
48+
Do not host mutually untrusted tenants in one process.
49+
50+
The legacy `/api/v1/admin/*` API has been removed, including global statistics,
51+
bulk session operations, CSV exports, and share administration. These paths
52+
return 404 after authentication; unauthenticated requests still fail authentication.
53+
Legacy JWT role/profile claims are ignored and grant no additional capabilities.
54+
Use the existing CLI session, export, and stats commands for your own local data.
55+
Session sharing and automatic expired-share cleanup remain available.
56+
57+
The unused network-proxy `admin_url` and
58+
`dangerously_allow_non_loopback_admin` settings have also been removed. Older
59+
configuration files may still contain these unknown fields, but they have no
60+
effect. Proxy domain/IP filtering, network modes, and sandbox protections remain.
5061

5162
Send `Authorization: ApiKey <server key>` or `Authorization: Bearer <JWT>`.
5263
JWTs require issuer `Cortex` and audience `cortex-api`.

scripts/readiness/qa.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,16 @@ def call(method, path, body=None, authenticated=True, headers=None):
8484
pass
8585
check(time.monotonic() < deadline, "Local server readiness timed out")
8686
time.sleep(.1)
87-
for path in ["/sessions", "/metrics", "/admin/stats", "/ws", "/health/sessions"]:
87+
for path in ["/sessions", "/metrics", "/ws", "/health/sessions"]:
8888
check(call("GET", path, authenticated=False)[0] == 401, "Authentication boundary failed")
89+
for method, path in [
90+
("GET", "/admin/stats"), ("GET", "/admin/stats/sessions"),
91+
("GET", "/admin/stats/usage"), ("GET", "/admin/sessions"),
92+
("POST", "/admin/sessions/bulk"), ("GET", "/admin/sessions/export"),
93+
("GET", "/admin/shares"), ("POST", "/admin/shares/cleanup"),
94+
]:
95+
body = {"session_ids": [], "action": "delete"} if method == "POST" else None
96+
check(call(method, path, body)[0] == 404, "Removed administration endpoint remains available")
8997
check(call("GET", "/sessions", headers={"Authorization": "ApiKey invalid-fixture"})[0] == 401, "Invalid key was accepted")
9098
status, headers, session = call("POST", "/sessions", {"model": "local-qa"})
9199
check(status == 200, "Session creation failed")
@@ -132,7 +140,7 @@ def call(method, path, body=None, authenticated=True, headers=None):
132140
"server.local_readiness", "server.authentication", "server.session_crud",
133141
"server.message_storage", "server.correlation", "server.metrics",
134142
"dast.body_limit", "dast.cors", "dast.workspace_traversal", "dast.symlink_escape",
135-
"server.file_crud", "dast.file_mutations",
143+
"server.file_crud", "dast.file_mutations", "dast.removed_admin_routes",
136144
]
137145

138146
def run(bin_dir):

0 commit comments

Comments
 (0)