Skip to content

[Fusion] Rewrite Apollo Federation authorization directives into the Fusion source directives - #26

Merged
michaelstaib merged 1 commit into
mst/policy-v2from
mst/auth-federation-intake
Oct 6, 2026
Merged

michaelstaib merged 1 commit into
mst/policy-v2from
mst/auth-federation-intake

Conversation

@michaelstaib

Copy link
Copy Markdown
Owner

Ticket: hc-fork-2-hdw.2 (Federation intake rewrite for auth directives)

Stacked on #25. This PR's diff is against mst/auth-composition-merger.

  • New TransformAuthDirectivesToFusion step. It rewrites Apollo @authenticated, @requiresScopes and @policy into the Fusion source directives on the same member, then strips the Apollo definitions.
    • Identity resolves through the @link imports, including federation 2.5+ namespaces, as renames and renamed imports.
    • The string value of each Scope and Policy literal is read, and the group structure is kept.
  • The three names are removed from the unsupported-directive set. @composeDirective is still rejected.
  • Canonical definitions are injected into FusionBuiltIns.SourceSchemaDirectives and ignored if the source schema declares its own.

Verified:

  • Fusion.Composition.ApolloFederation.Tests: 236/236.
  • Fusion.Composition.Tests: 3432/3432.
  • Nitro CLI Fusion command tests: 1928/1928.
  • The reviewer also composed Apollo-printed SDL, namespaced names, scalar and enum placements, and as renames through SchemaComposer in a scratch probe.

Not verified: dotnet build src/All.slnx, and federation v1 subgraphs.

Minor review notes, not fixed:

  • An unqualified @policy and the other two names are treated as auth directives even when they are not imported. This fails closed, and I sent it to the planner.
  • No SchemaComposer test uses Apollo-printed SDL; the probe covered it.
  • Apollo empty groups still compose to no requirement. hdw.5 adds the rule that fails them.
  • The test named for an incompatible declaration actually uses a compatible one.
  • Some comments explain rationale.

Copilot AI balanced review requested due to automatic review settings October 5, 2026 10:56

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-federation-intake branch 4 times, most recently from 58769a2 to 3761155 Compare October 6, 2026 05:29
Base automatically changed from mst/auth-composition-merger to mst/policy-v2 October 6, 2026 17:04
@michaelstaib
michaelstaib force-pushed the mst/auth-federation-intake branch from 3761155 to f8b8b93 Compare October 6, 2026 17:04
@michaelstaib
michaelstaib merged commit e84b660 into mst/policy-v2 Oct 6, 2026
1 check passed
@michaelstaib
michaelstaib deleted the mst/auth-federation-intake branch October 6, 2026 17:08
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