diff --git a/packages/api-types/src/connections.ts b/packages/api-types/src/connections.ts index 676dc6ac..4c0ca2d 100644 --- a/packages/api-types/src/connections.ts +++ b/packages/api-types/src/connections.ts @@ -28,10 +28,13 @@ export type CreateConnectionRequest = z.infer< typeof CreateConnectionRequestSchema >; +// org_id and project_id are intentionally omitted from the wire response — +// the backend's serializeConnection() strips them. Callers already know +// their own org/project from the auth context, and leaking either across +// a poorly-scoped proxy would be a cross-tenant signal we'd rather not +// emit by default. export const ConnectionRowSchema = z.object({ id: z.string(), - org_id: z.string(), - project_id: z.string().nullable(), user_id: z.string(), server_id: z.string(), auth_type: AuthTypeSchema, diff --git a/packages/api-types/src/index.test.ts b/packages/api-types/src/index.test.ts index 9c1e6a8..94728da 100644 --- a/packages/api-types/src/index.test.ts +++ b/packages/api-types/src/index.test.ts @@ -116,12 +116,10 @@ describe("projects", () => { }); describe("connections", () => { - it("accepts a connected ConnectionRow", () => { + it("accepts a connected ConnectionRow (no org_id / project_id — the backend strips them)", () => { expect( ConnectionRowSchema.parse({ id: "ca_abc", - org_id: "org_123", - project_id: "prj_abcdef0123456789", user_id: "dashboard", server_id: "asaas", auth_type: "api_key", @@ -139,8 +137,6 @@ describe("connections", () => { it("rejects ConnectionRow with unknown status", () => { const res = ConnectionRowSchema.safeParse({ id: "ca_abc", - org_id: "org_123", - project_id: null, user_id: "x", server_id: "asaas", auth_type: "api_key",