Skip to content

Go: more APIs - #16850

Merged
JinHai-CN merged 3 commits into
infiniflow:mainfrom
JinHai-CN:fix540
Jul 13, 2026
Merged

JinHai-CN merged 3 commits into
infiniflow:mainfrom
JinHai-CN:fix540

Conversation

@JinHai-CN

Copy link
Copy Markdown
Member

Summary

as title.

Signed-off-by: Jin Hai <[email protected]>
@JinHai-CN JinHai-CN added the ci Continue Integration label Jul 13, 2026
@coderabbitai

coderabbitai Bot commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f5c007cd-af48-497d-9d8f-97da5bda03ca

📥 Commits

Reviewing files that changed from the base of the PR and between 73104a0 and 9db7d26.

📒 Files selected for processing (1)
  • internal/handler/system_ee.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • internal/handler/system_ee.go

📝 Walkthrough

Walkthrough

Adds unimplemented EE authentication and system handlers, renames the OAuth channel callback, and registers new unauthenticated and protected API routes.

Changes

EE endpoint routing

Layer / File(s) Summary
Authentication handler surface
internal/handler/user_auth.go, internal/handler/user_auth_ee.go
Renames the OAuth channel callback and adds stub handlers for provider callbacks, registration, CAPTCHA, OTP, admin, and metadata endpoints.
System admin handler
internal/handler/system_ee.go
Adds the GetEnableAdmin handler, which returns a not-implemented response.
API route registration
internal/router/router.go
Updates OAuth routing, registers EE authentication endpoints, adds protected user routes, and wires /api/v1/settings/enable-admin to the system handler.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

I’m a rabbit with routes in a row,
Stubbed endpoints now answer “not so.”
OAuth hops neatly through,
Admin paths join the queue,
And the carrots of wiring all grow!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is related to the change, but it's too generic to identify the main update. Use a concise title that names the main feature area and the added EE API endpoints or route changes.
Description check ❓ Inconclusive The description is just a placeholder and does not explain the PR's purpose or context. Replace it with a brief summary of what the PR adds and why, including the relevant background context.
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

@JinHai-CN
JinHai-CN marked this pull request as ready for review July 13, 2026 06:32
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jul 13, 2026
@JinHai-CN
JinHai-CN marked this pull request as draft July 13, 2026 06:33
@JinHai-CN
JinHai-CN marked this pull request as ready for review July 13, 2026 06:33

@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: 1

🤖 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.

Inline comments:
In `@internal/handler/system_ee.go`:
- Around line 25-32: Update the Swagger annotations above GetEnableAdmin to
match the registered GET route: use /api/v1/settings/enable-admin and the
settings tag instead of the system path and tag. Revise the description to
accurately describe the read-oriented behavior implied by GetEnableAdmin and the
GET method, without changing the handler implementation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 212447d8-6ae9-44e2-b3cf-5cf2c059ff70

📥 Commits

Reviewing files that changed from the base of the PR and between d549194 and 73104a0.

📒 Files selected for processing (4)
  • internal/handler/system_ee.go
  • internal/handler/user_auth.go
  • internal/handler/user_auth_ee.go
  • internal/router/router.go

Comment on lines +25 to +32
// GetEnableAdmin admin access endpoint
// @Description Enable admin access endpoint
// @Tags system
// @Produce plain
// @Router /v1/system/enable-admin [GET]
func (h *SystemHandler) GetEnableAdmin(c *gin.Context) {
common.ErrorWithCode(c, common.CodeNotImplemented, "EnableAdmin not implemented")
}

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Swagger @Router annotation doesn't match the actual route path.

The annotation declares @Router /v1/system/enable-admin [GET], but the router registers this handler at /api/v1/settings/enable-admin (router.go line 279: user := v1.Group("/settings") → user.GET("/enable-admin", ...)). The @Tags system is also inconsistent since the route lives under /settings, not /system. This will produce misleading generated API documentation.

Additionally, the @Description ("Enable admin access endpoint") sounds like a state-changing action, while the GET method and GetEnableAdmin naming suggest a read. Clarify the intent so the HTTP method and annotation align.

📝 Proposed fix for Swagger annotations
 // GetEnableAdmin admin access endpoint
-// `@Description` Enable admin access endpoint
-// `@Tags` system
+// `@Description` Get the enable-admin setting
+// `@Tags` settings
 // `@Produce` plain
-// `@Router` /v1/system/enable-admin [GET]
+// `@Router` /api/v1/settings/enable-admin [GET]
 func (h *SystemHandler) GetEnableAdmin(c *gin.Context) {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// GetEnableAdmin admin access endpoint
// @Description Enable admin access endpoint
// @Tags system
// @Produce plain
// @Router /v1/system/enable-admin [GET]
func (h *SystemHandler) GetEnableAdmin(c *gin.Context) {
common.ErrorWithCode(c, common.CodeNotImplemented, "EnableAdmin not implemented")
}
// GetEnableAdmin admin access endpoint
// `@Description` Get the enable-admin setting
// `@Tags` settings
// `@Produce` plain
// `@Router` /api/v1/settings/enable-admin [GET]
func (h *SystemHandler) GetEnableAdmin(c *gin.Context) {
common.ErrorWithCode(c, common.CodeNotImplemented, "EnableAdmin not implemented")
}
🤖 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/handler/system_ee.go` around lines 25 - 32, Update the Swagger
annotations above GetEnableAdmin to match the registered GET route: use
/api/v1/settings/enable-admin and the settings tag instead of the system path
and tag. Revise the description to accurately describe the read-oriented
behavior implied by GetEnableAdmin and the GET method, without changing the
handler implementation.

@JinHai-CN
JinHai-CN merged commit 9f403ac into infiniflow:main Jul 13, 2026
3 checks passed
This was referenced Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant