Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add default security policy to gateway - #9556

#9556
Merged
michaelstaib merged 8 commits into
mainChilliCream/graphql-platform:mainfrom
mst/gateway-default-securityChilliCream/graphql-platform:mst/gateway-default-securityCopy head branch name to clipboard
Apr 19, 2026
Merged

Add default security policy to gateway#9556
michaelstaib merged 8 commits into
mainChilliCream/graphql-platform:mainfrom
mst/gateway-default-securityChilliCream/graphql-platform:mst/gateway-default-securityCopy head branch name to clipboard

Conversation

@michaelstaib

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings April 16, 2026 07:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a default security policy for the Fusion GraphQL gateway server, making production defaults safer while keeping development behavior permissive.

Changes:

  • Add default security behavior to the gateway server: disable introspection and enforce max field-cycle depth outside Development.
  • Add disableDefaultSecurity toggles to hosting/service registration APIs.
  • Add DefaultSecurityTests plus snapshots to validate production vs development behavior and override mechanisms.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

File Description
src/HotChocolate/Fusion/src/Fusion.AspNetCore/DependencyInjection/FusionServerServiceCollectionExtensions.cs Adds default security policy and new parameter on AddGraphQLGatewayServer.
src/HotChocolate/Fusion/src/Fusion.AspNetCore/DependencyInjection/FusionServerAspNetCoreHostingBuilderExtensions.cs Threads the new security toggle through IHostApplicationBuilder extension.
src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/DefaultSecurityTests.cs Adds tests covering introspection and field-cycle depth enforcement across environments and overrides.
src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/DefaultSecurityTests.*.md Adds snapshots for “field cycle depth not enforced” scenarios.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…ecurity

# Conflicts:
#	src/HotChocolate/Fusion/src/Fusion.AspNetCore/DependencyInjection/FusionServerAspNetCoreHostingBuilderExtensions.cs
…ecurity

# Conflicts:
#	.editorconfig
#	src/HotChocolate/Core/src/Types.Analyzers/IdAttributeOnRecordParameterCodeFixProvider.cs
#	src/HotChocolate/Fusion/src/Fusion.AspNetCore/DependencyInjection/FusionServerAspNetCoreHostingBuilderExtensions.cs
#	src/Nitro/CommandLine/src/CommandLine/Extensions/ParseResultExtensions.cs
#	src/Nitro/CommandLine/src/CommandLine/Services/Console/ActivityTree.cs
#	src/Nitro/CommandLine/test/CommandLine.Tests/Console/NitroConsoleActivityTests.cs
Tests using introspection queries in CreateServices helpers needed explicit DisableIntrospection(disable: false) override after the environment null-check was flipped from == false to != true. Also replace non-deterministic ID snapshots in DefaultSecurity cycle-depth tests with a direct Errors assertion.
@michaelstaib
michaelstaib merged commit bb9701b into main Apr 19, 2026
8 checks passed
@michaelstaib
michaelstaib deleted the mst/gateway-default-security branch April 19, 2026 20:57
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.