Skip to content

Commit 913aa6b

Browse files
committed
test(runtime): pin the new-similar source-package limb on its own
Claude-Session: https://claude.ai/code/session_01FEkQ5khiLzZmecWFfjSZLc Co-authored-by: Claude <noreply@anthropic.com>
1 parent d5d32a0 commit 913aa6b

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎packages/runtime/src/domains/permission-set-clone.test.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ const OWNED_SET = { name: 'own_reader', label: 'Own Reader', objects: { account:
6262
/** An environment-authored set that grants on a platform object only. */
6363
const SYS_ONLY_SET = { name: 'sys_only', label: 'Sys Only', objects: { sys_user: { allowRead: true } } };
6464

65-
const CATALOG: TestSecurityCatalog = { permissions: [PACKAGED, ENV_SET, OWNED_SET, SYS_ONLY_SET] };
65+
/** A set `crm` ships that grants on a platform object only: its package is the one thing out of an island's reach. */
66+
const CRM_SYS_SET = { name: 'crm_user_reader', label: 'CRM User Reader', objects: { sys_user: { allowRead: true } }, _packageId: 'crm' };
67+
68+
const CATALOG: TestSecurityCatalog = { permissions: [PACKAGED, ENV_SET, OWNED_SET, SYS_ONLY_SET, CRM_SYS_SET] };
6669

6770
/**
6871
* The package registry the door reads: `crm` is a booted CODE package
@@ -407,6 +410,9 @@ describe('the permission-set clone door — refusals', () => {
407410
it('a given writable target that cannot reach the source\'s package is 409, with no save', async () => {
408411
const res = await refusal({}, PACKAGED.name, { name: 'x_copy', label: 'X', package: 'com.acme.island' }, 409, 'RESOURCE_CONFLICT');
409412
expect(String((res as any).response.body.error.message)).toContain("'crm'");
413+
// The source-package limb alone: every object this set grants on is a
414+
// platform object, so only its package is out of the island's reach.
415+
await refusal({}, CRM_SYS_SET.name, { name: 'y_copy', label: 'Y', package: 'com.acme.island' }, 409, 'RESOURCE_CONFLICT');
410416
});
411417

412418
it('a given target that cannot reach an object the set grants on is 409, even for an environment-authored source', async () => {

0 commit comments

Comments
 (0)