Token validation refuses login-typed messages - #94
Conversation
A HiveSigner-style message typed login proves who signed it and nothing more: HiveSigner answers /api/me for one and refuses it everywhere else, and the Ecency clients never send one (wallet logins send code, HiveSigner issues posting for the scopes they request). It is not a session here either, decided before any key lookup. Everything else is left to the signature checks as before.
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
PR Summary by QodoReject login-typed messages during token validation
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can route each action level your way: inline, summary, both, or drop |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthrough
ChangesLogin token validation
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to Login-typed signed messages are now refused before they can establish API sessions, while other message shapes retain existing validation behavior. The change is covered by focused tests and is ready to merge. Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What
ValidateCoderefuses a signed message whosesigned_message.typeislogin, before any key lookup. Every other shape goes through the signature checks exactly as before.A message typed
loginproves who signed it and nothing more: HiveSigner answers/api/mefor one and refuses it at its token and broadcast routes. Ecency's own clients never send one here: wallet logins sendcode, and HiveSigner issuespostingfor the scopes the web and mobile apps request. Third-party login-scope tokens and the sign-in proof the mobile app now hands to other apps (ecency/vision-mobile#3544) are the only messages of that type, and neither should be a session on this API.Tests
TokenTypeTestspins the refusal (with and without an extra field in the message) and eleven shapes that stay with the signature checks: the other types, a differently-casedLogin, a missing, null, numeric or arraytype, a non-object message. Disabling the check makes the first test fail. Full suite green locally on .NET 10.Summary by CodeRabbit