Sync managed gateway routes on startup and fix layout initialization

This commit is contained in:
opsx committed 2026-10-22 10:49:32 +08:00
1 parent 5ef1cb48cf
commit 0528bc4b9a
7 files changed
+40 -6

No files matched your search

@@ -66,11 +66,16 @@ func TestRenderRejectsInjectedDomainAndRoute(t *testing.T) {
}
func TestRenderIdentityAndSingleAuthPort(t *testing.T) {
_, site, err := RenderWithAuth("vpn.example.com", gin.RoutesInfo{{Method: "GET", Path: "/api/health"}}, 19090)
_, site, err := RenderWithAuth("vpn.example.com", gin.RoutesInfo{
{Method: "GET", Path: "/api/health"},
{Method: "PUT", Path: "/api/system/tls/domain"},
{Method: "PUT", Path: "/api/system/identity"},
{Method: "POST", Path: "/api/system/identity/gateway"},
}, 19090)
if err != nil {
t.Fatal(err)
}
for _, route := range []string{"location = /id/.well-known/openid-configuration", "location = /id/feishu/callback", "location = /id/token", "location ^~ /oauth2/", "proxy_pass http://127.0.0.1:19090;", "location / { return 444; }"} {
for _, route := range []string{"location = /id/.well-known/openid-configuration", "location = /id/feishu/callback", "location = /id/token", "location = /api/system/tls/domain", "location = /api/system/identity", "location = /api/system/identity/gateway", "location ^~ /oauth2/", "proxy_pass http://127.0.0.1:19090;", "location / { return 444; }"} {
if !strings.Contains(site, route) {
t.Errorf("identity route missing: %s", route)
}