mirror of
https://github.com/modelstudioai/cli.git
synced 2026-09-14 19:49:23 +08:00
fix(permission): drop explicit undefined return and make revoke --all e2e credential-independent
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user