Repository navigation
Fix tenant token generation for non-ASCII search rules - #2230
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe token encoder now converts input to UTF-8 before producing unpadded base64url output. Tests cover Unicode search rules, payload round trips, and JWT-compatible HMAC signatures. ChangesTenant token Unicode support
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to Tenant tokens can now safely include non-ASCII search rules while retaining JWT-compatible payload encoding and signatures. The change is ready to merge. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
I’m a rabbit with tokens to byte, Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2230 +/- ##
==========================================
+ Coverage 98.11% 98.12% +0.01%
==========================================
Files 14 14
Lines 688 693 +5
Branches 109 109
==========================================
+ Hits 675 680 +5
Misses 12 12
Partials 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Keep tests next to the source file they cover and drop the leftover TDD label.
generateTenantTokenthrewInvalidCharacterErrorfor any non-ASCII search rule (e.g. a filter value in Persian), becauseencodeToBase64fed raw JSON tobtoa, which only handles latin1. It now encodes to UTF-8 bytes first and emits base64url, matching what the JWT spec requires (and what the signature part already did). Addstests/tenant-token-unicode.test.ts(no-crash, payload round-trip, HMAC signature verification).Summary by CodeRabbit
Bug Fixes
Tests