Increase token name length limit from 30 to 50 - #2368
Conversation
Increase token name length limit from 30 to 50
WalkthroughThe maximum allowed length for token names increased from 30 to 50 characters in both AddToken and UpdateToken validation paths. The validation logic, error handling, and control flow remain unchanged. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
controller/token.go (1)
145-151: Length limit increase is correct; consider de‑duplicating the magic numberThe change from 30 → 50 is applied consistently in both AddToken and UpdateToken and matches the PR goal, so behavior-wise this looks good.
To avoid future drift if the limit changes again, consider extracting
50into a shared constant (e.g., in a common config or model layer) and reusing it in both checks, and in any other validation layers (frontend, other services) that enforce the same rule.Please double‑check that any frontend or other API validators are updated to the same 50‑character limit to avoid inconsistent user errors.
Also applies to: 211-217
Increase token name length limit from 30 to 50
There is a need to connect token to other system id with the name filed, but 30 is too small, the type of database table filed is text, so maybe there is no need the limit the length of token name. increase to 50 for now.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.