squidcloudctl 3.0.8 → 3.0.10

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.
@@ -10,10 +10,13 @@ async function ensureApiKey() {
10
10
  const created = await apiPost('/keys', {
11
11
  name: `squidcloudctl-fs-${new Date().toISOString().slice(0, 10)}`,
12
12
  });
13
- const key = created?.key || created?.api_key || created?.data?.key;
13
+ // /keys returns { key: {…meta}, raw_key: '<64hex>' } — only raw_key is usable.
14
+ let key = (created?.raw_key || '');
15
+ if (!key && typeof created?.key === 'string')
16
+ key = created.key;
14
17
  if (!key)
15
18
  throw new Error('Could not provision a storage key for SquidFS — create one in Settings → API Keys.');
16
- return key;
19
+ return key.startsWith('cb_') ? key : `cb_${key}`;
17
20
  }
18
21
  export default async function fsMount(...args) {
19
22
  const strArgs = args.filter((a) => typeof a === 'string');
@@ -31,8 +34,20 @@ export default async function fsMount(...args) {
31
34
  argv.push('-bridge', String(opts.bridge || 'https://aouqcwbdoyrccjcrhzzi.supabase.co/functions/v1/squidfs-bridge'));
32
35
  console.log(`\n ${chalk.bold('SquidFS')} ${muted(mountPoint && !opts.webdav ? `mounting at ${mountPoint}` : `WebDAV → http://localhost:${opts.port || 8099}/`)}`);
33
36
  console.log(` ${muted('files stay encrypted end-to-end; edits sync back automatically. Ctrl+C to stop.')}\n`);
37
+ // Also fetch a short-lived auth token for direct API proxy downloads
38
+ let authToken = '';
39
+ try {
40
+ const { sbToken } = await import('../../lib/auth/oauth-session.js');
41
+ if (sbToken)
42
+ authToken = sbToken;
43
+ }
44
+ catch { }
34
45
  const child = spawn(argv[0], argv.slice(1), {
35
- env: { ...process.env, SQUIDCLOUD_API_KEY: apiKey },
46
+ env: {
47
+ ...process.env,
48
+ SQUIDCLOUD_API_KEY: apiKey,
49
+ SQUIDCLOUD_AUTH_TOKEN: authToken,
50
+ },
36
51
  stdio: 'inherit',
37
52
  });
38
53
  writeSession({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "squidcloudctl",
3
- "version": "3.0.8",
3
+ "version": "3.0.10",
4
4
  "description": "SquidCloud CLI (squidcloudctl) — encrypted storage, shares and secrets from your terminal",
5
5
  "main": "dist/bin/squidcloud.js",
6
6
  "bin": {