feat: sync deployed v1.0.0-rc.38-custom.42

Sync production source including routing, billing, Astra detection and public uptime. Update custom build instructions and license packaging.
This commit is contained in:
cneicy committed 2026-09-26 04:49:11 +08:00
1 parent aa6c3f50f4
commit ceddfd3d6b
828 files changed
+122253 -13702

No files matched your search

+15 -1
View File
@@ -2,6 +2,7 @@ package router
import (
"net/http"
"net/http/httptest"
"reflect"
"testing"
@@ -12,7 +13,20 @@ import (
"github.com/stretchr/testify/require"
)
func TestChannelStatusRoutesUseOperatePermission(t *testing.T) {
func TestChannelDefaultBaseURLsRequireReadPermission(t *testing.T) {
assertChannelRoutePermission(t, http.MethodGet, "/default_base_urls", authz.ChannelRead, controller.GetChannelDefaultBaseURLs)
gin.SetMode(gin.TestMode)
engine := gin.New()
registerChannelRoutes(engine.Group("/api"))
recorder := httptest.NewRecorder()
engine.ServeHTTP(recorder, httptest.NewRequest(http.MethodGet, "/api/channel/default_base_urls", nil))
assert.Equal(t, http.StatusUnauthorized, recorder.Code)
}
func TestChannelStatusRoutesUseExpectedPermissions(t *testing.T) {
assertChannelRoutePermission(t, http.MethodGet, "/:id/vllm/status", authz.ChannelRead, controller.GetVLLMChannelStatus)
assertChannelRoutePermission(t, http.MethodGet, "/:id/sglang/status", authz.ChannelRead, controller.GetSGLangChannelStatus)
assertChannelRoutePermission(t, http.MethodPost, "/:id/status", authz.ChannelOperate, controller.UpdateChannelStatus)
assertChannelRoutePermission(t, http.MethodPost, "/status/batch", authz.ChannelOperate, controller.BatchUpdateChannelStatus)
assertChannelRoutePermission(t, http.MethodPut, "/", authz.ChannelWrite, controller.UpdateChannel)