feat(authz): ADR-0066 D3 field-level requiredPermissions (+ D5 confirmation)#2240
Merged
Conversation
…mation)
- spec: FieldSchema.requiredPermissions: string[] (passes through Field.* builders).
- plugin-security: a field whose requiredPermissions aren't all held by the caller's
systemPermissions is masked on read and denied on write (AND-gate, strictest-wins
over permission-set field grants). getObjectSecurityMeta now reads per-field
requiredPermissions; foldFieldRequiredPermissions folds unmet ones into the
FieldMasker map as {readable:false,editable:false}, reusing maskResults +
detectForbiddenWrites — no masker signature change.
- liveness: classify field.requiredPermissions (live). api-surface unchanged.
- Tests: spec field (+3) + middleware read-mask/write-deny (+4).
D5 (package-seeded admin-maintainable per-object secure defaults) needs no new
code: stack.permissions already seeds sys_permission_set (incl. per-object +
per-field grants), admin-editable in Setup — it composes with D2 (private) + D1
(capability seeding). cloud sys_license is the worked example. Delegated admin (#9)
remains future per the ADR.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Deployment failed with the following error: View Documentation: https://vercel.com/docs/accounts/team-members-and-roles |
Contributor
📓 Docs Drift CheckThis PR changes 2 package(s): 91 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements ADR-0066 D3 field-level
requiredPermissionsand confirms D5 (package-seeded policies) needs no new code.D3 field-level (new)
FieldSchema.requiredPermissions: string[]— passes through theField.*builders.requiredPermissionsaren't all covered by the caller'ssystemPermissionsis masked on read and denied on write — an AND-gate, strictest-wins over permission-set field grants.getObjectSecurityMetanow also reads per-field requirements;foldFieldRequiredPermissionsfolds unmet ones into the FieldMasker map as{readable:false, editable:false}, reusingmaskResults+detectForbiddenWrites(no masker signature change).field.requiredPermissionsclassifiedlive. api-surface unchanged.D5 (confirmed — no code)
stack.permissionsalready seeds permission sets intosys_permission_set(incl. per-object and per-field grants), admin-editable in Setup. It composes with D2 (access:'private') + D1 (capability registry) to express a package's per-object secure default that's locked on install and tunable thereafter — cloudsys_licenseis the worked example. Delegated admin (#9) stays future per the ADR.Tests
spec field (+3: accepts/passthrough/optional) + middleware (+4: read-mask when capability missing / no-mask when held / write-deny / write-allow). plugin-security + spec full-DTS builds green; liveness ✓.
🤖 Generated with Claude Code