Skip to content

Commit 9903d68

Browse files
committed
chore(spec): regenerate api-surface, export-origins and the permission reference for the owner-binding judge
Claude-Session: https://claude.ai/code/session_01YRp5z4kK6vgYkrdH97ztsy Co-authored-by: Claude <noreply@anthropic.com>
1 parent 6b048c0 commit 9903d68

4 files changed

Lines changed: 14 additions & 4 deletions

File tree

‎content/docs/references/security/permission.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ const result = AdminScopeSchema.parse(data);
117117
| **name** | `string` | ✅ | Permission set name, unique per organization (lowercase snake_case) |
118118
| **label** | `string` | optional | Display label |
119119
| **description** | `string` | optional | Human-readable description shown in Setup |
120-
| **packageId** | `string` | optional | [ADR-0086 D3] Owning package id for a package-shipped set (absent = env-authored); the metadata save, restore and publish doors refuse a value that disagrees with the package the set is saved into |
120+
| **packageId** | `string` | optional | [ADR-0086 D3] Owning package id for a package-shipped set (absent = env-authored); a value that disagrees with the package that ships the set, or that it is saved into, is refused by the stack schema (defineStack, os validate, os build), the package registration, and the metadata save, restore and publish doors |
121121
| **managedBy** | `Enum<'package' \| 'platform' \| 'user'>` | optional | [ADR-0086 D3] Record provenance: package (upgrade-owned metadata) vs platform/user (env config) |
122122
| **isDefault** | `boolean` | optional (default: `false`) | [ADR-0090 D5] App baseline for the everyone position: app-level sets are auto-bound at boot (guarded, idempotent); package-level sets become install-time suggestions an admin confirms |
123123
| **objects** | `Record<string, { allowCreate?: boolean; allowRead?: boolean; allowEdit?: boolean; allowDelete?: boolean; … }>` | ✅ | Entity permissions |

‎packages/spec/api-surface/security.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@
5656
"PLATFORM_CAPABILITY_NAMES (const)",
5757
"PUBLIC_FORM_SERVER_MANAGED_FIELDS (const)",
5858
"PermissionSet (type)",
59+
"PermissionSetOwnerBindingDoor (type)",
60+
"PermissionSetOwnerBindingRefusal (interface)",
5961
"PermissionSetParsed (type)",
6062
"PermissionSetSchema (const)",
6163
"PlatformCapability (interface)",
@@ -90,6 +92,7 @@
9092
"defineSharingRule (function)",
9193
"describeAnchorForbiddenBits (function)",
9294
"describeHighPrivilegeBits (function)",
95+
"judgePermissionSetOwnerBinding (function)",
9396
"normalizeTenancyPosture (function)",
9497
"objectPermissionGrants (function)",
9598
"permissionForm (const)",

‎packages/spec/export-origins/security.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555
"PLATFORM_CAPABILITY_NAMES": "src/security/capabilities.ts#PLATFORM_CAPABILITY_NAMES (const)",
5656
"PUBLIC_FORM_SERVER_MANAGED_FIELDS": "src/security/public-form.ts#PUBLIC_FORM_SERVER_MANAGED_FIELDS (const)",
5757
"PermissionSet": "src/security/permission.zod.ts#PermissionSet (type)",
58+
"PermissionSetOwnerBindingDoor": "src/security/permission-set-owner-binding.ts#PermissionSetOwnerBindingDoor (type)",
59+
"PermissionSetOwnerBindingRefusal": "src/security/permission-set-owner-binding.ts#PermissionSetOwnerBindingRefusal (interface)",
5860
"PermissionSetParsed": "src/security/permission.zod.ts#PermissionSetParsed (type)",
5961
"PermissionSetSchema": "src/security/permission.zod.ts#PermissionSetSchema (const)",
6062
"PlatformCapability": "src/security/capabilities.ts#PlatformCapability (interface)",
@@ -85,6 +87,7 @@
8587
"defineSharingRule": "src/security/sharing.zod.ts#defineSharingRule (function)",
8688
"describeAnchorForbiddenBits": "src/security/high-privilege.ts#describeAnchorForbiddenBits (function)",
8789
"describeHighPrivilegeBits": "src/security/high-privilege.ts#describeHighPrivilegeBits (function)",
90+
"judgePermissionSetOwnerBinding": "src/security/permission-set-owner-binding.ts#judgePermissionSetOwnerBinding (function)",
8891
"normalizeTenancyPosture": "src/security/tenancy-posture.ts#normalizeTenancyPosture (function)",
8992
"objectPermissionGrants": "src/security/permission.zod.ts#objectPermissionGrants (function)",
9093
"permissionForm": "src/security/permission.form.ts#permissionForm (const)",

‎packages/spec/src/stack-permission-set-owner-binding.test.ts‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,11 @@ describe('[ADR-0086 D3] a release artifact\'s sets are judged against the packag
9393
const twoPackages = (coreKey?: string) => composeStacks([
9494
defineStack({ manifest: manifest(CRM), permissions: [set('crm_member', coreKey)] } as never, { strict: false }),
9595
defineStack({ manifest: manifest('com.acme.orders', { type: 'module' }), permissions: [set('orders_member')] } as never),
96-
], { manifest: 'preserve' }) as unknown as Record<string, unknown> & { packages: Array<{ manifest: Record<string, unknown> }> };
96+
], { manifest: 'preserve' }) as unknown as {
97+
manifest: { id: string };
98+
packages: Array<{ manifest: Record<string, unknown> }>;
99+
[key: string]: unknown;
100+
};
97101

98102
it('a body\'s set is judged against that body\'s own id', () => {
99103
const artifact = twoPackages(OTHER);
@@ -106,7 +110,7 @@ describe('[ADR-0086 D3] a release artifact\'s sets are judged against the packag
106110

107111
it('a top-level set no body declares is the residual, judged against the artifact\'s `manifest.id`', () => {
108112
const artifact = { ...twoPackages(), permissions: [set('stray_member', OTHER)] };
109-
const owner = String((artifact.manifest as { id: string }).id);
113+
const owner = artifact.manifest.id;
110114
expect(ownerIssues(artifact)).toEqual([['permissions.0.packageId', expect.stringContaining(`from package '${owner}'`)]]);
111115
// CONTROL: the residual declaring the artifact's own id.
112116
expect(ownerIssues({ ...twoPackages(), permissions: [set('stray_member', owner)] })).toEqual([]);
@@ -119,7 +123,7 @@ describe('[ADR-0086 D3] a release artifact\'s sets are judged against the packag
119123
// names the body that ships it — is no disagreement.
120124
const artifact = twoPackages(CRM);
121125
const flattened = { ...artifact, permissions: [set('crm_member', CRM), set('orders_member')] };
122-
expect(String((flattened.manifest as { id: string }).id)).not.toBe(CRM);
126+
expect(flattened.manifest.id).not.toBe(CRM);
123127
expect(ownerIssues(flattened)).toEqual([]);
124128
});
125129
});

0 commit comments

Comments
 (0)