fix(node): correct scoped permissions wire codec#3642
Open
ryankert01 wants to merge 1 commit into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3642 +/- ##
============================================
+ Coverage 73.49% 73.55% +0.06%
Complexity 937 937
============================================
Files 1291 1291
Lines 141568 141575 +7
Branches 117128 117135 +7
============================================
+ Hits 104046 104139 +93
+ Misses 34300 34212 -88
- Partials 3222 3224 +2
🚀 New features to boost your workflow:
|
Scoped permissions omitted list continuation markers, causing the server to reject any user permissions containing streams. Encode and consume the canonical markers, correct absent-permission framing, and cover the wire shape and end-to-end round trip.
0c00e16 to
7c162b8
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.
Which issue does this PR address?
Closes #3643
Rationale
The Node SDK could not create or update users with stream- or topic-scoped permissions because its wire codec did not match the canonical Rust permission format.
What changed?
Nested permission serialization omitted the required continuation marker after each topic and stream, so the server rejected any permission payload with a non-empty
streamsarray. The decoder also read continuation markers without advancing past them, which dropped or misaligned multiple entries.Serialization and deserialization now mirror the Rust codec, and
createUserno longer appends a length and payload when permissions are absent. Canonical byte-vector unit tests cover multiple streams and topics, while the user E2E test verifies scoped permissions through create, update, and get.Local Execution
npm run lintnpm run buildnpm run test:unit(75 passed)node --import @swc-node/register/esm-register --test src/e2e/tcp.user.e2e.ts(9 passed against a local server)cargo test -p iggy_binary_protocol primitives::permissions::tests::roundtrip_with_streams_and_topics -- --exactAI Usage