feat(qaops): 接通网页通讯录持久化同步与后台接管

This commit is contained in:
姚章浩
2026-10-17 17:36:07 +08:00
parent 6adfdcdd4f
commit cc4906b6a9
25 changed files with 1203 additions and 24 deletions
@@ -0,0 +1,20 @@
package httpapi
import (
"net/http/httptest"
"strings"
"testing"
)
func TestGenericJobCreationCannotBypassDirectorySyncAdminPath(t *testing.T) {
h, err := NewHandler(Config{Store: &fakeJobStore{}})
if err != nil {
t.Fatal(err)
}
req := httptest.NewRequest("POST", "/api/v1/jobs", strings.NewReader(`{"type":"qaops.directory.sync.fixture","payload":{"triggered_by":"forged"},"idempotency_key":"bypass"}`))
res := httptest.NewRecorder()
h.ServeHTTP(res, req)
if res.Code != 400 {
t.Fatalf("reserved sync job bypassed its dedicated admission path: %d", res.Code)
}
}