Happy to ship the first preview of NATS .NET 2.8. The theme of this release is tightening the protocol layer and shrinking the core API surface, so this preview carries two breaking changes. Please try it and report anything odd before we cut the stable.
Package on NuGet: https://www.nuget.org/packages/NATS.Net
Breaking changes:
- Subject validation is on by default. Subjects containing whitespace (space, tab, CR, LF) now throw. This closes a class of CRLF injection issues from malformed subjects. Opt out with
SkipSubjectValidation = trueonNatsOpts. NATS.Client.Core.NKeysandNKeyPairare removed. Signing now goes through theNATS.NKeyspackage (https://www.nuget.org/packages/NATS.NKeys), which lets the nkey/Ed25519 code be versioned independently of the client.
Also includes protocol size checks (64MB incoming payload cap, in line with nats.js), KV watcher cancellation fix, credential loading state reset on failure, and Pin ID handling improvements.
Thanks to everyone who contributed PRs, reviews, bug reports, and flap chasing on this one.
- auth: sign nonce regardless of auth_required (#1109)
- auth: use NATS.NKeys package for nkey signing (#1101) [breaking]
- conn: reset state on credential loading failure (#1107)
- Improve package metadata and README (#1103)
- tests: fix TlsPreferTest flap on net481 (#1108)
- Fix release workflow (#1106)
- Fix test flaps (#1083)
- ci: add contents and actions read permissions to Claude workflow (#1102)
- tls: document Prefer mode plaintext behavior (#1094)
- tests: increase NuidTests thread join timeouts (#1100)
- Improve Pin ID handling (#1099)
- Fix KV watcher cancellation behavior (#1084)
- Clear ArrayPool buffers before returning to pool (#1097)
- Enable subject validation by default (#1093) [breaking]
- Add protocol size checks (#1095)
- Fix Range attribute for MaxBytes property (#1096)
- Add CC reviews (#1092)
Full Changelog: v2.7.3...v2.8.0-preview.1