Repository navigation
Add policy support - #10495
Merged
Merged
Add policy support#10495
Conversation
…ives (#23) * Add the authenticated, requiresScopes and policy source schema directives * Use a const interpolated directive name in the authorization directive ToString methods
…rization (#25) * [Fusion] Merge the source authorization directives into fusion__authorization and drop authorize from composition * [Fusion] Parse fusion__authorization and collect authorization usage when loading the composite schema * [Fusion] Update Nitro CLI composite schema snapshots for fusion__authorization * [Fusion] Validate and coerce the source authorization directive arguments during composition * [Fusion] Add the authorization argument rule to the source schema rule set guard test * [Fusion] Add a test for the policies group count warning in the authorization directive rule * [Fusion] Move MergedAuthorization into its own file * [Fusion] Move the authorization group count threshold onto the authorization directive rule * [Fusion] Make the authorization usage an immutable flags and policy name snapshot
…Fusion source directives (#26)
…and return types during composition (#29) * [Fusion] Inherit authorization requirements across interfaces, types and return types during composition * [Fusion] Keep authorization requirements on the canonical node field during composition * [Fusion] Format the authorization error row in the composition log codes table * [Fusion] Keep scope and policy requirements when combining authorization requirements during composition * [Fusion] Propagate authorization requirements to interfaces through fields only during composition * [Fusion] Update the Fusion authorization directive test snapshot for requirements flattened onto fields * [Fusion] Document bare Apollo Federation authorization directives in the composition guide * [Fusion] Fix the AUTHORIZATION_INHERITED explanation to describe field-level upward propagation * [Fusion] Move InheritedAuthorization into its own file
… their authorization requirements (#30) * [Fusion] Fail composition when a field reads protected fields through @require or a lookup key without their authorization requirements * [Fusion] Check lookup keys of union and interface lookups against each possible type for authorization requirements * [Fusion] Check nested choices in lookup keys against each possible type for authorization requirements
…rough ThrowHelper (#35)
…orization check (#36)
…ode conditions in the planner (#37) * [Fusion] Add a HasAuthorization flag to execution output fields * [Fusion] Mark deniable selections with synthetic skip variables and node conditions in the planner * [Fusion] Update HasAuthorization expectations for flattened authorization requirements * [Fusion] Fix requirement selections being skipped while their consumer node still runs * [Fusion] Move the synthetic authorization variable prefix to its only reader * [Fusion] Require the policy resolver on OperationPlanner and make Operation authorization set-once * [Fusion] Sort the authorization using directive in planner tests and benchmarks
…lidation (#38) * [Fusion] Add gateway authorization options and fail-closed startup validation * [Fusion] Resolve authentication schemes from ASP.NET Core and write the WWW-Authenticate challenge on 401 * [Fusion] Remove the duplicate IPolicyResolver registration from the operation planner services * [Fusion] Fail startup when the schema uses authorization and the host exposes no authentication schemes * [Fusion] Declare the default scope claim name once and assert the ParamName of the empty scope claim name * [Fusion] Assert the response status in the gateway startup tests * [Fusion] Validate the authorization Schemes option independently of authorization usage * [Fusion] Document the empty Schemes list and test the authorization validation opt-out * [Fusion] Shorten the Schemes option summary to two sentences * [Fusion] Fix the WWW-Authenticate challenge advertising scheme registration names instead of HTTP authentication schemes * [Fusion] Reject empty WWW-Authenticate challenges in the authorization options * [Fusion] Fix the scheme challenges default not compiling on .NET 8 and .NET 9 * [Fusion] Rename the authentication scheme catalog to a per-scheme lookup
…ions and the denial error contract (#39) * [Fusion] Throw when a policy answers a policy entry more than once * [Fusion] Add the operation authorization middleware with denial decisions and the denial error contract * [Fusion] Use immutable collections in the authorization evaluator and name the evaluation failure * [Fusion] Combine the policy names of a selection as alternative groups of conjunctions * [Fusion] Resolve variables nested in input objects and lists before evaluating policies * [Fusion] Use the shared resource message for the non-null violation in value completion * [Fusion] Remove the forwarding constructor of the variable value collection * [Fusion] Build the authorization requirements of an operation plan once per plan * [Fusion] Fail the request with a generic error when an anonymous principal reaches an unresolved policy * [Fusion] Snapshot the full results of the policy group and skip authorization tests * [Fusion] Test denied non-null selections under the null error handling mode * [Fusion] Skip the policy entries of incremental plans that do not run for the variable set * [Fusion] Share one incremental plan activation rule between the executor and the authorization evaluator * [Fusion] Test denials under conditional defer and snapshot the full escalation responses * [Fusion] Track active delivery groups and running incremental plans in arrays instead of hash sets * [Fusion] Snapshot the escalation transport responses, assert the denial in the defer agreement tests and share the payload reader * [Fusion] Use the authentication scheme lookup with a Bearer challenge in the authorization execution tests * [Fusion] Rename the authorization Boolean type from variableType to booleanType * [Fusion] Rename the gateway authorization engine types and namespace to the policy engine names * [Fusion] Keep policy decisions out of VariableValueCollection and add policy variables after coercion * [Fusion] Move the operation policy plan onto OperationPlan as PolicyPlan
…ebuild it on parse (#72)
…ore execution (#42) * [Fusion] Record every policy decision of a variable set in an audit scope committed before execution * [Fusion] Test the audit trail scopes, entries and commit order * [Fusion] Test that conditional defer records each audit entry once * [Fusion] Use immutable snapshots and DirectiveNames in the audit trail test helpers * [Fusion] Expose an invocation id on the audit trail and make the audit scope base internal * [Fusion] Record the unauthenticated reason on the anonymous @authenticated audit entry * [Fusion] Commit the audit scope with the failure reason when a policy evaluation faults * [Fusion] Test that a faulted or canceled policy evaluation commits or skips the audit scope * [Fusion] Add the AuditTrailSource that the lazy audit trail creation uses * [Fusion] Create the audit trail lazily on the first protected variable set * [Fusion] Test that unprotected operations do not create an audit trail * [Fusion] Record the remaining policy groups as unanswered when a policy is unresolved * [Fusion] Test that an unresolved policy leaves the remaining audit entries unanswered * [Fusion] Fix the recording audit provider counting requests on an immutable array * [Fusion] Share the audit trail of a request batch through the batch state instead of a feature on every item * [Fusion] Treat cancellation without a canceled request as a fault and keep the original fault when the audit commit fails * [Fusion] Share the audit trail of a request batch through a holder feature instead of the Core request context * Remove the batch state from the request context * [Fusion] Report a failing audit scope failure and a failing fault recording without replacing the original fault * [Fusion] Test that a failing audit scope failure and a failing fault recording do not replace the policy fault * [Fusion] Apply the policy engine names to the audit trail
…equest arrays (#43) * [Fusion] Distinguish absent from null context data keys in the escalation test transport description * [Fusion] Keep deferred activation in condition flags instead of per-request arrays
…ider (#44) * [Fusion] Drive the executor eviction window from an injected TimeProvider * [Fusion] Use FakeTimeProvider in the executor eviction tests
…the token expires (#51) * Add a generic unauthorized connection status and let event stream request errors keep 401 and 403 * [Fusion] Add the ReevaluatesPerEvent capability flag to IPolicy * [Fusion] Reevaluate opted-in policies per subscription event and end the stream when the token expires * [Fusion] Refuse a WebSocket connection without identity with close code 4401 when requests are rejected on unauthenticated * [Fusion] Arm the expiry timer before renewing the token in the renewed token subscription test * [Fusion] Pool the state machine of the expiring event stream * [Fusion] Remove the gateway socket session interceptor and keep anonymous WebSocket connections accepted * [Fusion] Keep the denied descriptors of a subscription in a frozen set * [Fusion] Make ReevaluatesPerEvent a default interface member of IPolicy * [Fusion] Keep a selection denied at subscribe denied for the stream and record that the decision stands * Close the WebSocket as unauthorized when a subscription stream ends requesting 401 * [Fusion] Close the WebSocket with 4401 when the token of a subscription expires * [Fusion] Return the denied descriptors of an evaluation as a frozen set * [Fusion] Rename the subscription test that records the standing subscribe decision * [Fusion] Freeze the denied descriptors once per authorization evaluation * Reduce the new authorization comments to the contract * Sort the usings and name the unauthorized connection test after its act * [Fusion] Report subscription authorization faults and audit commit failures to the diagnostic events * [Fusion] Record every occurrence of a subscription in a verdict change scope * [Fusion] Refuse a subscription with 401 when the token expired before the source opens * [Fusion] Test frozen and reevaluated subscription policies in the error mode * [AspNetCore] Restore the CloseUnauthorizedAsync signature and add a message overload * [AspNetCore] Accept an integer requested status code and keep multipart responses at OK * [Fusion] Report a failed verdict change scope commit through RequestError and snapshot both error events * [Fusion] Show the failure reason of each audit scope in the subscription authorization tests * [Fusion] Propagate the null of a denied non-null field from its parent when the source delivered a value * [Fusion] Name the subscription authorization tests after their act and cover a flip on a non-null field * [Fusion] Report a mid-stream subscription authorization fault once through SubscriptionEventError * Merge the WebSocket unauthorized stream end tests into one theory * [Fusion] Test that a verdict change commit throwing cancellation ends the subscription with a fault * [AspNetCore] Send a fault result that ends a subscription stream as an error message on WebSocket * [Fusion] Fix a mid-stream subscription authorization fault aborting the response instead of ending it with an error result * [Fusion] Pin the status code of the subscription fault result in the authorization tests * [AspNetCore] Stop sending a subscription stream after an error result with a requested status code * [Fusion] Expand aggregate errors and use the context error handler in the subscription fault result * [Fusion] Apply the policy engine names to subscription authorization * [Fusion] Rebuild the subscription policy variables from the client values when a verdict changes * [Fusion] Hold the operation plan's policy plan in SubscriptionPolicies * [Fusion] Decide subscription policies once at subscribe and apply the outcome to every event * [Fusion] Let the policy middleware end subscriptions on token expiry
* [Fusion] Add the fixtures of the subscription authorization transport tests * [Fusion] Add the server-sent events subscription authorization tests * [Fusion] Add the WebSocket subscription authorization tests * [Fusion] Prove the WebSocket stays usable after an authenticated subscribe denial * [Fusion] Drop the test-host-only exception message assertion from the SSE fault abort test * [Fusion] Make the SSE test client reader non-nullable and group its status members * [Fusion] Pin the error event and complete of a mid-stream policy fault in the SSE subscription tests * [Fusion] Pin the absent challenge of the cookie scheme in the SSE subscription refusal snapshots * [Fusion] Pin the Bearer challenge in the SSE subscription refusal snapshots * [Fusion] Apply the policy engine names to the subscription transport tests * [Fusion] Remove the per-event subscription transport tests * [Fusion] Put the base list of the subscription transport test base on its own line
…e to policy names (#71) * [Fusion] Rename the remaining authorization names of the policy engine to policy names * [Fusion] Apply the policy option names to the error semantics matrix tests
…lan to policy readers (#73) * [Fusion] Make OperationPlan.Policies non-nullable and pass only the plan to policy readers * [Fusion] Pass the empty policy plan in the delivery path tests * [Fusion] Read and write an empty policy plan in the operation plan JSON
… audit scope context (#93) * [Fusion] Rename the audit namespace to Auditing * [Fusion] Remove the unused context of the audit scope
…tion types to policy (#202)
…med policy directive (#206)
This was referenced Nov 12, 2026
Merged
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.
No description provided.