Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/api-types/src/connections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 1 addition & 5 deletions packages/api-types/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
Loading