Skip to content

Add validate-graphql-request policy support#243

Open
tomkerkhove wants to merge 5 commits into
mainfrom
feat/validate-graphql-request
Open

Add validate-graphql-request policy support#243
tomkerkhove wants to merge 5 commits into
mainfrom
feat/validate-graphql-request

Conversation

@tomkerkhove
Copy link
Copy Markdown
Member

Summary

Adds full support for the \�alidate-graphql-request\ policy to the Policy Toolkit.

Changes

  • Config: \ValidateGraphqlRequestConfig, \AuthorizeConfig, \AuthorizeRuleConfig\ records in \src/Authoring/Configs/\
  • Compiler: \ValidateGraphqlRequestCompiler\ handles nested <authorize>\ with <rule>\ child elements
  • Decompiler: \ValidateGraphqlRequestDecompiler\ round-trips XML back to C# config
  • IInboundContext: Added \ValidateGraphqlRequest(ValidateGraphqlRequestConfig config)\ method
  • Tests: 5 DataRow test cases covering all attributes, authorize rules, and edge cases

Policy Reference

validate-graphql-request

Supported Attributes

Attribute Config Property Type
\�rror-variable-name\ \ErrorVariableName\ \string?\
\max-depth\ \MaxDepth\ \int?\
\max-size\ \MaxSize\ \long?\
\max-total-depth\ \MaxTotalDepth\ \int?\
\max-complexity\ \MaxComplexity\ \int?\
\�uthorize > rule\ \Authorize.Rules[]\ \AuthorizeRuleConfig[]\

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

Implement compiler, decompiler, config records, and tests for the
validate-graphql-request policy including authorize child elements
with rule entries.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tomkerkhove tomkerkhove force-pushed the feat/validate-graphql-request branch from 5dd8b43 to 7322fb0 Compare April 17, 2026 14:55
@tomkerkhove tomkerkhove force-pushed the feat/validate-graphql-request branch from d1d946a to 2683e01 Compare April 21, 2026 01:04
@tomkerkhove tomkerkhove force-pushed the feat/validate-graphql-request branch from 2683e01 to 9d96ec7 Compare April 21, 2026 01:58
Comment thread src/Authoring/IInboundContext.cs
<None Include="README.md" Pack="true" PackagePath="\"/>
</ItemGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
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.

revert changes to this file please

<None Include="..\..\docs\images\pkgicon.png" Pack="true" PackagePath="\"/>
<None Include="README.md" Pack="true" PackagePath="\"/>
</ItemGroup>
<Project Sdk="Microsoft.NET.Sdk">
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.

revert changes to this file please

Comment thread test/Test.Core/Compiling/ValidateGraphqlRequestTests.cs
- Add ValidateGraphqlRequest to IFragmentContext for policy fragment support
- Revert formatting-only changes to Compiling.csproj and Testing.csproj
- Add expression inline test cases for fields supporting expressions

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
# Conflicts:
#	src/Compiling/Compiling.csproj
#	src/Testing/Testing.csproj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants