fix(security): scope social account references

This commit is contained in:
ZacharyZhang-NY committed 2026-05-15 00:15:37 -04:00
1 parent 51d468e4c3
commit bde35c3518
9 files changed
+317 -44

No files matched your search

+2
View File
@@ -481,6 +481,7 @@ describe("AppDatabase", () => {
{ version: 56, name: "baseline_v56" },
{ version: 57, name: "task_leases_runtime_ownership" },
{ version: 58, name: "approval_policy_table" },
{ version: 59, name: "social_company_scope" },
]);
db.close();
@@ -494,6 +495,7 @@ describe("AppDatabase", () => {
{ version: 56, name: "baseline_v56" },
{ version: 57, name: "task_leases_runtime_ownership" },
{ version: 58, name: "approval_policy_table" },
{ version: 59, name: "social_company_scope" },
]);
});
@@ -175,6 +175,7 @@ describe("legacy to v56 baseline migration", () => {
{ version: 56, name: "baseline_v56" },
{ version: 57, name: "task_leases_runtime_ownership" },
{ version: 58, name: "approval_policy_table" },
{ version: 59, name: "social_company_scope" },
]);
expect(appDb.queryAll<{ companyId: string }>("select company_id as companyId from secrets where id = 'secret-1'")[0])
.toEqual({ companyId: "company-1" });
@@ -208,6 +209,7 @@ describe("legacy to v56 baseline migration", () => {
{ version: 56, name: "baseline_v56" },
{ version: 57, name: "task_leases_runtime_ownership" },
{ version: 58, name: "approval_policy_table" },
{ version: 59, name: "social_company_scope" },
]);
expect(appDb.queryAll("select id from budget_policies where scope_type = 'agent' and scope_id = 'agent-1'"))
.toHaveLength(1);
@@ -232,6 +234,7 @@ describe("legacy to v56 baseline migration", () => {
{ version: 56, name: "baseline_v56" },
{ version: 57, name: "task_leases_runtime_ownership" },
{ version: 58, name: "approval_policy_table" },
{ version: 59, name: "social_company_scope" },
]);
} finally {
appDb.close();
@@ -390,6 +393,7 @@ describe("legacy to v56 baseline migration", () => {
{ version: 56, name: "baseline_v56" },
{ version: 57, name: "task_leases_runtime_ownership" },
{ version: 58, name: "approval_policy_table" },
{ version: 59, name: "social_company_scope" },
]);
} finally {
appDb.close();
@@ -116,12 +116,13 @@ describe("legacy to v56 baseline migration", () => {
{ id: "task-inflight", requiresFilesystem: 1 },
]);
const migrations = appDb.queryAll<{ version: number; name: string }>(
"select version, name from schema_migrations where version in (56, 57, 58) order by version",
"select version, name from schema_migrations where version in (56, 57, 58, 59) order by version",
);
expect(migrations).toEqual([
{ version: 56, name: "baseline_v56" },
{ version: 57, name: "task_leases_runtime_ownership" },
{ version: 58, name: "approval_policy_table" },
{ version: 59, name: "social_company_scope" },
]);
} finally {
appDb.close();