Remove legacy key/password aliases and clean up workspace

Drop the Hose key/password compatibility path from the config schema, credential reads, CLI messages, tests, and docs; appKey/appSecurity are now the only accepted fields. Isolate seal-renew tests from the real enterprises directory so renewals never write local config. Remove the tracked pkg/ report spec and local artifacts, and rewrite .gitignore with complete sections.
This commit is contained in:
gitea committed 2026-11-19 16:10:21 +08:00
1 parent 8d6b65d3d5
commit 35f761e8a0
18 files changed
+106 -940

No files matched your search

+5 -21
View File
@@ -739,9 +739,10 @@ describe("sync-test hosecloud integration auto-sync", () => {
expect(writtenIntegrations[0].apiOrigin).toBe("wechat");
});
test("supports key/password fallback in source config when appKey/appSecurity are omitted", async () => {
test("rejects legacy key/password source config instead of falling back", async () => {
const { enterprises } = setupHoseTestEnv();
// Overwrite hose-prod.json to use key / password instead of appKey / appSecurity
// Legacy key/password aliases are no longer part of the schema; the file
// must be skipped on load rather than silently used for sync.
const prodCorpWithKeyPassword = JSON.parse(readFileSync(join(enterprises, "hose-prod.json"), "utf-8"));
delete prodCorpWithKeyPassword.source.appKey;
delete prodCorpWithKeyPassword.source.appSecurity;
@@ -749,25 +750,8 @@ describe("sync-test hosecloud integration auto-sync", () => {
prodCorpWithKeyPassword.source.password = "fallback-secret-012";
writeFileSync(join(enterprises, "hose-prod.json"), JSON.stringify(prodCorpWithKeyPassword, null, 2));
await runCli(["corps", "bind-test", "hose-prod", "hose-test", "--confirm"]);
let capturedBody: any;
mockHoseSyncRequests({
onConfigWrite: (isProd, body) => {
if (!isProd) capturedBody = body;
}
});
const result = await runCli(["corps", "sync-test", "hose-prod", "--yes"]);
expect(result.isError).toBe(false);
const parsed = JSON.parse(result.stdout);
expect(parsed.hosecloudSync.skipped).toBe(false);
expect(parsed.hosecloudSync.synced).toHaveLength(1);
const writtenIntegration = capturedBody?.integrations?.find((i: any) => i.type === "hosecloud");
expect(writtenIntegration?.apiKey).toBe("fallback-key-789");
expect(writtenIntegration?.apiSecret).toBe("fallback-secret-012");
const result = await runCli(["corps", "get", "hose-prod"]);
expect(result.isError).toBe(true);
});
});