Multiplayer agent harness for work.
Classify the auth broker's nonce claim as a system write (#55)
Joshua France07e001b6494c
diff --git a/src/api/user-scoped-routes.ts b/src/api/user-scoped-routes.tsindex 6a4deb73d..032788fe0 100644--- a/src/api/user-scoped-routes.ts+++ b/src/api/user-scoped-routes.ts@@ -87,6 +87,7 @@ const SYSTEM: Rule[] = [pat("POST", "/v1/grants/revoke"),pat("POST", "/v1/blobs"),pat("POST", "/v1/egress-audit"),+ pat("POST", "/v1/auth/broker/claim"),pat("PUT", "/v1/deployment-layer"),pat("POST", "/v1/session-cap"),pat("POST", "/v1/keychain/drops/:id"),diff --git a/test/portal-identity-gate.test.ts b/test/portal-identity-gate.test.tsindex 546ba7382..f352027ce 100644--- a/test/portal-identity-gate.test.ts+++ b/test/portal-identity-gate.test.ts@@ -11,6 +11,8 @@ import { mintSignedPayload } from "../src/auth/signed-token.ts";import { verifyCapabilityToken } from "../src/auth/capability-token.ts";import { testConfig } from "./support/test-config.ts";import { scopeId } from "../src/types.ts";+import { isUnclassifiedWrite } from "../src/api/user-scoped-routes.ts";+import { authBrokerRoutes } from "../src/api/routes/auth-broker.ts";const SOURCE = "shared-source-auth-secret-for-tests-0001";const CAP = "core-only-capability-secret-for-tests-01";@@ -300,3 +302,18 @@ describe("user-scoped routes require a portal-verified actor when enforcement isassert.equal(claims?.scopeId, "personal:U1");});});++describe("service-to-service writes are classified", () => {+ it("every auth:source write route is classified, so production gating cannot demand a portal identity from a plugin", () => {+ const unclassified = authBrokerRoutes+ .filter((route) => "path" in route && route.auth === "source")+ .map((route) => route as { method: string; path: string })+ .filter((route) => isUnclassifiedWrite(route.method, route.path))+ .map((route) => `${route.method} ${route.path}`);+ assert.deepEqual(+ unclassified,+ [],+ "an unclassified write requires a portal identity under REQUIRE_SIGNED_PORTAL_IDENTITY; add it to SYSTEM in user-scoped-routes.ts",+ );+ });+});