Conversation
MaxNestingDepth and MaxInputLength move from IQueryKitParseLimits to IQueryKitConfiguration. Every configuration now gives its parse limits in one place, and the parser reads them from any configuration that is not null. IQueryKitParseLimits is removed. BREAKING CHANGE: A class that implements IQueryKitConfiguration directly must implement MaxNestingDepth and MaxInputLength. A library built against v1.14.2 fails with TypeLoadException. Set real values, because a limit of 0 rejects every filter. The interface IQueryKitParseLimits is removed.
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.
For later consideration in a major version. Do not merge now. #122 moved these members off the interface to keep v1.x non-breaking. This PR puts them back.
Summary
public interface IQueryKitConfiguration { ... public int? MaxPropertyDepth { get; set; } + public int MaxNestingDepth { get; set; } + public int MaxInputLength { get; set; } public CaseInsensitiveMode CaseInsensitiveComparison { get; set; } } -public interface IQueryKitParseLimits { int MaxNestingDepth; int MaxInputLength; } -public class QueryKitConfiguration : IQueryKitConfiguration, IQueryKitParseLimits +public class QueryKitConfiguration : IQueryKitConfigurationIQueryKitConfigurationhas no limit members.IQueryKitConfigurationhasMaxNestingDepthandMaxInputLength. The parser reads the limits from any configuration that is not null.IQueryKitParseLimitsis removed.Evidence
A consumer class that implements every v1.14.2 member:
error CS0535: 'MyConfiguration' does not implement interface member 'IQueryKitConfiguration.MaxInputLength'.System.TypeLoadException: Method 'get_MaxNestingDepth' in type 'MyConfiguration' ... does not have an implementation.Tests in
ParseLimitsTests.cs, changed from the restore tests:dotnet teston this branch: all unit and integration tests pass, 0 failures.Merge Danger
Door: one-way
After a release, consumers implement the two members. A later removal is a second break.
Blast Radius: consumers
IQueryKitConfigurationdirectly break. A subclass ofQueryKitConfigurationdoes not break.QueryKitInputLengthExceededException: ... maximum allowed length of 0.The release notes must tell implementers to returnQueryKitSettings.DefaultMaxNestingDepthandQueryKitSettings.DefaultMaxInputLength.IQueryKitParseLimitsstops compiling.