@zksecurity/zkao-cli 0.11.0-next.2 → 0.11.0-next.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +6 -0
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -227,6 +227,7 @@ function removePendingLogins(deviceCodes) {
227
227
  import { spawn } from "child_process";
228
228
  import { hostname } from "os";
229
229
  import { DEFAULT_BASE_URL } from "@zksecurity/zkao-sdk";
230
+ var DEFAULT_LOGIN_SCOPES = ["read", "scans:launch", "findings:write"];
230
231
  function appOrigin(baseUrl) {
231
232
  const url = new URL(baseUrl);
232
233
  const prefix = url.pathname.replace(/\/+$/, "").replace(/\/api\/v\d+$/, "");
@@ -318,6 +319,7 @@ async function login(flags) {
318
319
  const project = flags.project ?? process.env.ZKAO_PROJECT_ID;
319
320
  const start = await postJson(`${origin}/api/auth/device`, {
320
321
  label: hostname(),
322
+ scopes: flags.scopes ?? DEFAULT_LOGIN_SCOPES,
321
323
  ...project ? { project } : {}
322
324
  });
323
325
  printInstructions(start);
@@ -620,6 +622,9 @@ program.command("login").description(
620
622
  "--no-wait",
621
623
  "start the flow, print the URL/code, and exit; finish with --resume"
622
624
  ).option("--resume", "poll a login previously started with --no-wait").option(
625
+ "--scope <scopes...>",
626
+ `scopes to request; the approver can change them (default: ${DEFAULT_LOGIN_SCOPES.join(" ")})`
627
+ ).option(
623
628
  "--timeout <seconds>",
624
629
  "with --resume, wait up to this long for approval (default: poll once)",
625
630
  toInt
@@ -635,6 +640,7 @@ program.command("login").description(
635
640
  project: g.project,
636
641
  baseUrl: g.baseUrl,
637
642
  noBrowser: opts.browser === false,
643
+ scopes: opts.scope,
638
644
  wait: opts.wait !== false
639
645
  });
640
646
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zksecurity/zkao-cli",
3
- "version": "0.11.0-next.2",
3
+ "version": "0.11.0-next.3",
4
4
  "description": "Command-line interface for the zkao Project API",
5
5
  "license": "MIT",
6
6
  "author": "zkSecurity",
@@ -39,7 +39,7 @@
39
39
  "prepublishOnly": "node -e \"if (!(process.env.npm_config_user_agent || '').includes('bun/')) { console.error('Publish with bun publish: npm ships the literal workspace:* dependency and breaks installs.'); process.exit(1); }\""
40
40
  },
41
41
  "dependencies": {
42
- "@zksecurity/zkao-sdk": "0.11.0-next.2",
42
+ "@zksecurity/zkao-sdk": "0.11.0-next.3",
43
43
  "commander": "^12.1.0"
44
44
  },
45
45
  "devDependencies": {