Repository navigation
Add explicit ancestor authorization assertions - #54
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 62a5e15f72
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6c5dadc3b7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
@gql.authorize.byAncestor({reason})dispositions for reviewed structural child fields@gql.authorize(Policy.check)policies direct and field-localbyAncestorfield crosses a policy or allowed resolver outcome{scope: Fields}API completelySemantics
byAncestorcan be placed on a concrete object type as a default for its immediate GraphQL fields, including separately declared resolver fields, or directly on one field. It is intentionally non-recursive: returned object types must declare their own disposition. A direct field policy, public declaration, or resolver outcome overrides a type-level default; an explicit field-level assertion cannot be combined with a direct disposition.The proof is path-sensitive. Lists and nullability are transparent, while unions and interface return types fan out to concrete objects. A shared type fails if any entry path reaches it without an earlier policy or allowed resolver outcome. Public fields are not authorization boundaries. Interface annotations and subscriptions remain unsupported until their inheritance and per-event semantics are defined.
Mutation root fields still require a pre-resolver policy before a payload can rely on ancestor authorization.
Performance
Policies execute only where declared, exactly once per normal GraphQL field execution. Structural descendants do not reevaluate the policy. Static analysis propagates only nearest possible boundaries, preventing boundary sets from growing with schema depth while retaining deterministic audit provenance.
Coverage
Fixtures cover:
Validation
opam exec --switch=5.3.0 -- make testopam exec --switch=5.3.0 -- make checkformatnpm run buildgit diff --check