-
Notifications
You must be signed in to change notification settings - Fork 89
Add validation for subjects #1017
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ds and add comprehensive test coverage
…zation and remove dot-based validation tests
…bject validation details in comments and documentation
Expanded tests to include separate validations for short (<16 chars) and long (≥16 chars) subject paths, with specific checks for whitespace handling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
scottf
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…n `SubjectValidator`, remove inline checks, and streamline public APIs. Update tests for comprehensive validation coverage.
…s. Split `ProtocolWriterTests` into focused test classes and improve test coverage for whitespace handling and edge cases.
Ensure subject and queue group validation occurs before async operations in `SubscribeAsync`, `SubscribeCoreAsync`, and `RequestManyAsync`. Update tests to verify synchronous exceptions and add comprehensive validation coverage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…nc` implementations. Update tests to improve clarity and replace unused variable names. Resolve BenchmarkDotNet dependency conflict for `net481`.
|
|
|
> dotnet run -c Release --framework net8.0 -- --filter "*SubjectValidation*" |
… subject validation methods.
Add subject/replyTo/queueGroup validation to prevent protocol-breaking input from reaching the wire.
Validation rules:
Opt-In:
Validation is turned off by default to not break any existing installations. You can turn it on:
Exception Handling:
Validation exception is thrown at the point of the calls on the same execution thread. This will give the application immediate feedback and stack trace where the invalid string is used.
Performance Impact Summary:
(*) Long subject results on .NET Framework show measurement variability due to GC timing differences between benchmark runs.
Subject validation adds negligible overhead on .NET 8.0, the primary target runtime. The validation uses
SearchValues<char>with SIMD on .NET 8+ and an optimized manual loop for short subjects (<16 chars).The validation is allocation free on all frameworks.
See comments below for benchmark run results.