Skip to content

[Fusion] Reject empty authorization groups in source schemas - #27

Merged
michaelstaib merged 1 commit into
mst/policy-v2from
mst/auth-reject-empty-groups
Oct 6, 2026
Merged

michaelstaib merged 1 commit into
mst/policy-v2from
mst/auth-reject-empty-groups

Conversation

@michaelstaib

Copy link
Copy Markdown
Owner

Ticket: hc-fork-2-hdw.5 (Reject empty authorization groups in source schemas)

Stacked on #26. This PR's diff is against mst/auth-federation-intake.

An empty AND group is satisfied by anyone, so it would let every caller through. AuthorizationDirectiveArgumentRule now rejects these with INVALID_AUTHORIZATION_DIRECTIVE_ARGUMENT:

  • an empty outer list,
  • an empty inner group,
  • an empty or whitespace-only string.

This covers @requiresScopes and @policy on fields and types, and Apollo intake hits the same rule. AuthorizationGroups.Reduce no longer skips empty factors.

Also carried from the #26 review:

  • A test for a truly incompatible own declaration (a different argument name).
  • The compatible-declaration test is renamed to match what it checks.

Verified:

  • dotnet build src/All.slnx: 0 errors.
  • Fusion.Composition.Tests: 3448/3448.
  • Fusion.Composition.ApolloFederation.Tests: 240/240.
  • Nitro CLI Fusion command tests: 1928/1928.

Minor review notes, not fixed:

Copilot AI balanced review requested due to automatic review settings October 5, 2026 11:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@michaelstaib
michaelstaib added this pull request to stack #28 October 5, 2026 17:35
@michaelstaib
michaelstaib force-pushed the mst/auth-reject-empty-groups branch 2 times, most recently from 41c265f to 63a687f Compare October 5, 2026 23:01
@michaelstaib
michaelstaib force-pushed the mst/auth-reject-empty-groups branch from 63a687f to 74780e1 Compare October 6, 2026 04:01
@michaelstaib
michaelstaib force-pushed the mst/auth-reject-empty-groups branch 2 times, most recently from 800ab7b to e94b468 Compare October 6, 2026 17:04
Base automatically changed from mst/auth-federation-intake to mst/policy-v2 October 6, 2026 17:08
@michaelstaib
michaelstaib force-pushed the mst/auth-reject-empty-groups branch from e94b468 to 961d427 Compare October 6, 2026 17:08
@michaelstaib
michaelstaib merged commit 31cf52a into mst/policy-v2 Oct 6, 2026
1 check passed
@michaelstaib
michaelstaib deleted the mst/auth-reject-empty-groups branch October 6, 2026 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants