squidcloudctl 3.0.3 → 3.0.4
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.
- package/dist/lib/transfer.js +9 -1
- package/package.json +1 -1
package/dist/lib/transfer.js
CHANGED
|
@@ -138,10 +138,18 @@ async function fetchVaultKey(fileId) {
|
|
|
138
138
|
},
|
|
139
139
|
body: JSON.stringify({ fileId }),
|
|
140
140
|
});
|
|
141
|
+
if (r.status === 500) {
|
|
142
|
+
const t = await r.text().catch(() => '');
|
|
143
|
+
if (/decrypt file key/i.test(t)) {
|
|
144
|
+
throw new Error('VAULT_KEY_DRIFT: the SQUIDVEIL_MASTER_KEY secret has drifted since this file was uploaded - restore it in Supabase > Edge Functions > Secrets to decrypt managed files.');
|
|
145
|
+
}
|
|
146
|
+
}
|
|
141
147
|
const d = (await r.json());
|
|
142
148
|
return d?.success && d.key ? d.key : null;
|
|
143
149
|
}
|
|
144
|
-
catch {
|
|
150
|
+
catch (err) {
|
|
151
|
+
if (err instanceof Error && err.message.startsWith('VAULT_KEY_DRIFT'))
|
|
152
|
+
throw err;
|
|
145
153
|
return null;
|
|
146
154
|
}
|
|
147
155
|
}
|