mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-15 20:27:20 +08:00
Go: more APIs (#16850)
### Summary as title. --------- Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
32
internal/handler/system_ee.go
Normal file
32
internal/handler/system_ee.go
Normal file
@@ -0,0 +1,32 @@
|
||||
//
|
||||
// Copyright 2026 The InfiniFlow Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
package handler
|
||||
|
||||
import (
|
||||
"ragflow/internal/common"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// GetEnableAdmin admin access endpoint
|
||||
// @Description Enable admin access endpoint
|
||||
// @Tags system
|
||||
// @Produce plain
|
||||
// @Router /api/v1/system/enable-admin [GET]
|
||||
func (h *SystemHandler) GetEnableAdmin(c *gin.Context) {
|
||||
common.ErrorWithCode(c, common.CodeNotImplemented, "EnableAdmin not implemented")
|
||||
}
|
||||
@@ -76,7 +76,7 @@ func (h *UserHandler) OAuthLogin(c *gin.Context) {
|
||||
c.Redirect(http.StatusFound, init.AuthURL)
|
||||
}
|
||||
|
||||
// OAuthCallback handles the OAuth/OIDC callback for the configured channel.
|
||||
// OAuthChannelCallback handles the OAuth/OIDC callback for the configured channel.
|
||||
// Mirrors Python's GET /auth/oauth/<channel>/callback: it verifies the
|
||||
// state, exchanges the code for an access token, fetches user info, and
|
||||
// then either logs in an existing user or registers a new one. On every
|
||||
@@ -89,7 +89,7 @@ func (h *UserHandler) OAuthLogin(c *gin.Context) {
|
||||
// @Param code query string true "authorization code"
|
||||
// @Param state query string true "state token"
|
||||
// @Router /api/v1/auth/oauth/{channel}/callback [get]
|
||||
func (h *UserHandler) OAuthCallback(c *gin.Context) {
|
||||
func (h *UserHandler) OAuthChannelCallback(c *gin.Context) {
|
||||
channel := c.Param("channel")
|
||||
// An empty channel segment (/auth/oauth//callback) is a malformed path,
|
||||
// not a real channel. Python's router never matches it and returns 404;
|
||||
67
internal/handler/user_auth_ee.go
Normal file
67
internal/handler/user_auth_ee.go
Normal file
@@ -0,0 +1,67 @@
|
||||
//
|
||||
// Copyright 2026 The InfiniFlow Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
package handler
|
||||
|
||||
import (
|
||||
"ragflow/internal/common"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func (h *UserHandler) OAuthCallback(c *gin.Context) {
|
||||
common.ErrorWithCode(c, common.CodeNotImplemented, "OAuthCallback not implemented")
|
||||
}
|
||||
|
||||
func (h *UserHandler) GitHubAuthCallback(c *gin.Context) {
|
||||
common.ErrorWithCode(c, common.CodeNotImplemented, "GitHubAuthCallback not implemented")
|
||||
}
|
||||
|
||||
func (h *UserHandler) LarkAuthCallback(c *gin.Context) {
|
||||
common.ErrorWithCode(c, common.CodeNotImplemented, "LarkAuthCallback not implemented")
|
||||
}
|
||||
|
||||
func (h *UserHandler) ICBCAuthCallback(c *gin.Context) {
|
||||
common.ErrorWithCode(c, common.CodeNotImplemented, "ICBCAuthCallback not implemented")
|
||||
}
|
||||
|
||||
func (h *UserHandler) AzureAuthCallback(c *gin.Context) {
|
||||
common.ErrorWithCode(c, common.CodeNotImplemented, "AzureAuthCallback not implemented")
|
||||
}
|
||||
|
||||
func (h *UserHandler) AzureAuthLogin(c *gin.Context) {
|
||||
common.ErrorWithCode(c, common.CodeNotImplemented, "AzureAuthLogin not implemented")
|
||||
}
|
||||
|
||||
func (h *UserHandler) Captcha(c *gin.Context) {
|
||||
common.ErrorWithCode(c, common.CodeNotImplemented, "Captcha not implemented")
|
||||
}
|
||||
|
||||
func (h *UserHandler) SendOTP(c *gin.Context) {
|
||||
common.ErrorWithCode(c, common.CodeNotImplemented, "SendOTP not implemented")
|
||||
}
|
||||
|
||||
func (h *UserHandler) VerifyOTP(c *gin.Context) {
|
||||
common.ErrorWithCode(c, common.CodeNotImplemented, "VerifyOTP not implemented")
|
||||
}
|
||||
|
||||
func (h *UserHandler) IsAdmin(c *gin.Context) {
|
||||
common.ErrorWithCode(c, common.CodeNotImplemented, "IsAdmin not implemented")
|
||||
}
|
||||
|
||||
func (h *UserHandler) GetMeta(c *gin.Context) {
|
||||
common.ErrorWithCode(c, common.CodeNotImplemented, "GetMeta not implemented")
|
||||
}
|
||||
Reference in New Issue
Block a user