This commit is contained in:
2026-05-13 20:40:14 +08:00
parent bd13c842a8
commit c8a75ef2d5
17 changed files with 920 additions and 93 deletions

25
frontend_config_test.go Normal file
View File

@@ -0,0 +1,25 @@
package main
import (
"os"
"strings"
"testing"
)
func TestFrontendDoesNotExposeCredentialKeyInput(t *testing.T) {
source, err := os.ReadFile("frontend/src/App.tsx")
if err != nil {
t.Fatal(err)
}
app := string(source)
forbidden := []string{
"<span>凭据键</span>",
"next.gitea.credentialKey = event.target.value",
}
for _, text := range forbidden {
if strings.Contains(app, text) {
t.Fatalf("App.tsx should not expose editable credential key UI, found %q", text)
}
}
}