Repository navigation
Go: refactor API route for EE - #17093
Conversation
Signed-off-by: Jin Hai <[email protected]>
📝 WalkthroughWalkthroughEnterprise protected and unauthenticated routes are centralized in EE router helpers. The admin router retains model and ingestion-task routes, while ChangesEnterprise routing
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested labels: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
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.
🧹 Nitpick comments (1)
internal/admin/router_ee.go (1)
121-125: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove commented-out Go code.
As per coding guidelines, commented-out Go code should be removed.
♻️ Proposed refactor
protected.GET("/users/:username/tokens", r.handler.ListUserAPITokens) - //protected.POST("/users/:username/keys", r.handler.GenerateUserAPIToken) protected.POST("/users/:username/tokens", r.handler.GenerateUserAPIToken) protected.DELETE("/users/:username/tokens/:token", r.handler.DeleteUserAPIToken)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@internal/admin/router_ee.go` around lines 121 - 125, Remove the commented-out protected.POST route for “/users/:username/keys” from the router registration near ListUserAPITokens, leaving the active token routes unchanged.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@internal/admin/router_ee.go`:
- Around line 121-125: Remove the commented-out protected.POST route for
“/users/:username/keys” from the router registration near ListUserAPITokens,
leaving the active token routes unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f79821c0-2a74-497b-8445-03559819e2ed
📒 Files selected for processing (4)
internal/admin/router.gointernal/admin/router_ee.gointernal/router/router.gointernal/router/router_ee.go
💤 Files with no reviewable changes (1)
- internal/admin/router.go
Summary
As title.