Skip to content

Increase token name length limit from 30 to 50 - #2368

Merged
seefs001 merged 2 commits into
QuantumNous:mainfrom
oudi:main
Dec 8, 2025
Merged

Increase token name length limit from 30 to 50#2368
seefs001 merged 2 commits into
QuantumNous:mainfrom
oudi:main

Conversation

@oudi

@oudi oudi commented Dec 4, 2025

Copy link
Copy Markdown
Contributor

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

  • Enhancements
    • Token names can now support up to 50 characters in length, increased from the previous limit of 30 characters. This change applies to both token creation and updates.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Dec 4, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

The 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

Cohort / File(s) Summary
Token name length validation
controller/token.go
Increased token.Name maximum length constraint from 30 to 50 in AddToken and UpdateToken validation paths

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Verify the length change is applied consistently in both AddToken and UpdateToken functions
  • Confirm the error message reference (if any) is still accurate

Poem

🐰 A token's name grows from thirty to fifty,
More characters now—how delightfully nifty!
The validation adjusts with a hop and a bound,
Longer token names are finally around! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely describes the main change: increasing the token name length limit from 30 to 50 characters in the validation logic.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
controller/token.go (1)

145-151: Length limit increase is correct; consider de‑duplicating the magic number

The 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 50 into 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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0b9f6a5 and 6d6e5b3.

📒 Files selected for processing (1)
  • controller/token.go (2 hunks)

@seefs001
seefs001 merged commit 12a5c7c into QuantumNous:main Dec 8, 2025
1 check passed
ennnnny pushed a commit to ennnnny/new-api that referenced this pull request Mar 17, 2026
Increase token name length limit from 30 to 50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants