Repository navigation
[Fusion] Add the operation authorization middleware with denial decisions and the denial error contract - #39
Open
michaelstaib wants to merge 17 commits into
Open
michaelstaib wants to merge 17 commits into
michaelstaib wants to merge 17 commits into
Conversation
This was referenced Oct 7, 2026
michaelstaib
added this pull request to stack #50
October 8, 2026 20:50
michaelstaib
force-pushed
the
mst/auth-middleware
branch
from
October 9, 2026 00:00
df7d67e to
6d50be3
Compare
…ions and the denial error contract
… name the evaluation failure
…s of conjunctions
…valuating policies
…n value completion
…cipal reaches an unresolved policy
… for the variable set
…tor and the authorization evaluator
…scalation responses
…n arrays instead of hash sets
…al in the defer agreement tests and share the payload reader
michaelstaib
force-pushed
the
mst/auth-middleware
branch
from
October 9, 2026 04:49
6d50be3 to
8d8ffbd
Compare
… in the authorization execution tests
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.
Ticket: hc-fork-2-jzk.4 (Authorization middleware, decisions and error contract)
Stacked on #38. This PR's diff is against
mst/auth-gateway-options.OperationAuthorizationMiddlewareruns after planning. For each variable set it evaluates every policy once with all its occurrences, builds one immutableAuthorizationDecisions, and sets the synthetic$__fusion_auth_Nvariables the planner emitted. There is no re-planning. An unprotected operation costs one null check.@defer(if: false)) are skipped.directive,policy(named policies only) andrequiredScopes(@requiresScopesonly) from the first denying descriptor.RejectRequestOn) are request errors with nodatakey and nothing fetched, pluscoordinatewhen attributed.OperationPlan.Authorizationis built once per plan. The plan JSON, the plan id andOperationPlanner.Versionare unchanged.History: two agents were lost to network errors along the way, and the work was recovered and continued. It took two review rounds. Review found two real bugs, both fixed and tested: nested variables were not resolved for policy arguments, and
@defer(if: false)produced phantom duplicate policy entries.Verified at 3a8312c:
dotnet build src/All.slnx: 0 errors.Not verified:
ErrorHandlingMode.Haltwith denials.Minor review notes, not fixed:
@defer(if:). The reviewer probed it and it behaved correctly.IReadOnlyCollection.DeliveryGroup.IsActive.Existing gateway behavior found while reviewing, not caused by this PR:
@skipand@includeselections are returned after unconditional ones, which is not request order. One snapshot here pins that order.@defernested inside@defer(if: false)is never delivered.