fix(permission): drop explicit undefined return and make revoke --all e2e credential-independent

This commit is contained in:
故璃
2026-08-16 23:48:19 +08:00
parent 8e6af6c669
commit 79a0d2db9a
2 changed files with 3 additions and 1 deletions
@@ -48,7 +48,6 @@ export function validatePermissionChange(flags: {
if (models.length > MAX_MODELS_PER_REQUEST)
return `--model accepts at most ${MAX_MODELS_PER_REQUEST} models per call.`;
}
return undefined;
}
/**
@@ -99,10 +99,13 @@ describe("e2e: permission", () => {
});
test("permission revoke --all 缺 --yes 拒绝执行", async () => {
// --yes 护栏在 run() 开头、任何网络调用之前抛出;带 dummy key 让用例不依赖环境凭证(否则 auth stage 先报 AUTH(3))。
const { stderr, exitCode } = await runCommandE2e(PERMISSION_ROUTES, [
"permission",
"revoke",
"--all",
"--api-key",
"e2e-dummy-key",
]);
expect(exitCode).toBe(2);
expect(stderr).toContain("Refusing");