feat(server-ng): reject incompatible clients at login via protocol version#3454
Open
hubcio wants to merge 1 commit into
Open
feat(server-ng): reject incompatible clients at login via protocol version#3454hubcio wants to merge 1 commit into
hubcio wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3454 +/- ##
============================================
- Coverage 74.68% 74.66% -0.02%
Complexity 937 937
============================================
Files 1256 1257 +1
Lines 124732 125222 +490
Branches 100454 100986 +532
============================================
+ Hits 93151 93492 +341
- Misses 28586 28672 +86
- Partials 2995 3058 +63
🚀 New features to boost your workflow:
|
krishvishal
reviewed
Jun 15, 2026
krishvishal
reviewed
Jun 15, 2026
74b2928 to
b622a11
Compare
…rsion Version mismatches between SDK and server surfaced as runtime decode failures instead of a clear error at login. The VSR login-register body now starts with a required ClientVersionInfo prefix: the packed iggy_binary_protocol crate semver plus sdk name and version. The server gates on a [min, current-minor] range before touching credentials (patch never changes the wire) and rejects with a typed Eviction frame carrying the accepted window; a body without a decodable prefix is rejected with a dedicated MalformedLogin reason instead of the version window. The response advertises the server's protocol and build version; the language-neutral wire spec lives in the version module docs. The SDK decodes eviction and reply headers by byte offset instead of struct casts: response read buffers are not 16-aligned, and offset reads let the client sanity-check the protocol window. The new EvictionReason variants and the EvictionHeader protocol window are appended into reserved space, leaving existing consensus frames and discriminants byte-compatible. The SDK validates password and PAT token lengths before encoding, with the same bounds and errors the servers already enforce, so an oversized secret cannot desync the u8 length prefix; server-ng mirrors the legacy username/password bounds before lookup or hashing. SDK identity is recorded per connection in the SessionManager; get_clients wire exposure is a follow-up. The legacy server is untouched.
b622a11 to
ea88381
Compare
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.
Version mismatches between SDK and server surfaced as runtime decode
failures instead of a clear error at login. The VSR login-register
body now starts with a required ClientVersionInfo prefix: the packed
iggy_binary_protocol crate semver plus sdk name and version. The
server gates on a [min, current-minor] range before touching
credentials (patch never changes the wire) and rejects with a typed
Eviction frame carrying the accepted window; a body without a
decodable prefix is rejected with a dedicated MalformedLogin reason
instead of the version window. The response advertises the server's
protocol and build version; the language-neutral wire spec lives in
the version module docs.
The SDK decodes eviction and reply headers by byte offset instead of
struct casts: response read buffers are not 16-aligned, and offset
reads let the client sanity-check the protocol window. The new
EvictionReason variants and the EvictionHeader protocol window are
appended into reserved space, leaving existing consensus frames and
discriminants byte-compatible.
The SDK validates password and PAT token lengths before encoding,
with the same bounds and errors the servers already enforce, so an
oversized secret cannot desync the u8 length prefix; server-ng
mirrors the legacy username/password bounds before lookup or
hashing. SDK identity is recorded per connection in the
SessionManager; get_clients wire exposure is a follow-up. The
legacy server is untouched.