Skip to content

Commit 9138536

Browse files
hotlongCopilot
andcommitted
fix(runtime): force requireAuth on ObjectOS multi-tenant host
Auto-enable based on tierEnabled('auth') only triggers when the host stack declares the auth tier. On ObjectOS the auth tier lives inside each per-project artifact (via AuthProxyPlugin), so the host stack's tier list is empty and requireAuth defaulted to false — leaving anonymous /api/v1/data/* open on CF (reproduced live at crm.objectos.app). Force api.requireAuth: true in createObjectOSStack so anonymous data access on the host returns 401 regardless of how individual project artifacts declare auth. Also bumps wrangler image tag. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 7dcde27 commit 9138536

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

apps/objectos/wrangler.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ compatibility_flags = ["nodejs_compat"]
4444
# rebuild + re-push to ship a new version, then run `wrangler deploy`.
4545
[[containers]]
4646
class_name = "ObjectOSContainer"
47-
image = "registry.cloudflare.com/2846eb40a60f4738e292b90dcd8cce10/objectos:95c95d09"
47+
image = "registry.cloudflare.com/2846eb40a60f4738e292b90dcd8cce10/objectos:7dcde27c"
4848
max_instances = 5
4949
instance_type = "standard-1"
5050

packages/runtime/src/cloud/objectos-stack.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export interface ObjectOSStackConfig {
6666

6767
export interface ObjectOSStackResult {
6868
plugins: any[];
69-
api: { enableProjectScoping: true; projectResolution: 'auto' };
69+
api: { enableProjectScoping: true; projectResolution: 'auto'; requireAuth: true };
7070
}
7171

7272
/**
@@ -237,6 +237,12 @@ export async function createObjectOSStack(config: ObjectOSStackConfig): Promise<
237237
api: {
238238
enableProjectScoping: true,
239239
projectResolution: 'auto',
240+
// ObjectOS is multi-tenant: anonymous /api/v1/data/* must never
241+
// leak per-project data across organisations. AuthProxyPlugin
242+
// verifies upstream tokens and populates ctx.userId; requireAuth
243+
// turns missing userId into 401 at the REST layer before the
244+
// request reaches the per-project kernel.
245+
requireAuth: true,
240246
},
241247
};
242248
}

0 commit comments

Comments
 (0)