windmill-cli 1.872.0 → 1.873.0
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/esm/main.js +40 -7
- package/package.json +1 -1
package/esm/main.js
CHANGED
|
@@ -16806,7 +16806,7 @@ var init_OpenAPI = __esm(() => {
|
|
|
16806
16806
|
PASSWORD: undefined,
|
|
16807
16807
|
TOKEN: getEnv3("WM_TOKEN"),
|
|
16808
16808
|
USERNAME: undefined,
|
|
16809
|
-
VERSION: "1.
|
|
16809
|
+
VERSION: "1.873.0",
|
|
16810
16810
|
WITH_CREDENTIALS: true,
|
|
16811
16811
|
interceptors: {
|
|
16812
16812
|
request: new Interceptors,
|
|
@@ -20159,7 +20159,7 @@ var init_auth = __esm(async () => {
|
|
|
20159
20159
|
});
|
|
20160
20160
|
|
|
20161
20161
|
// src/core/constants.ts
|
|
20162
|
-
var WM_FORK_PREFIX = "wm-fork", VERSION = "1.
|
|
20162
|
+
var WM_FORK_PREFIX = "wm-fork", VERSION = "1.873.0";
|
|
20163
20163
|
|
|
20164
20164
|
// src/utils/resource_folders.ts
|
|
20165
20165
|
import { existsSync } from "node:fs";
|
|
@@ -35841,14 +35841,26 @@ async function pushWorkspaceSettings(workspace, _path, settings, localSettings,
|
|
|
35841
35841
|
if (!opts.includeDatatablePermissions) {
|
|
35842
35842
|
delete localSettings.datatable_permissions;
|
|
35843
35843
|
}
|
|
35844
|
+
if (unreadableSecret(localSettings.webhook) && !await documentKeepsRedactedWebhook(workspace)) {
|
|
35845
|
+
warn("Leaving the webhook unchanged: this server stores the webhook URL in plain text and cannot read an encrypted or redacted one. Upgrade it, or write the URL in plain text.");
|
|
35846
|
+
const remote = await getWorkspaceSettingsDocument({ workspace });
|
|
35847
|
+
if (typeof remote.webhook === "string") {
|
|
35848
|
+
localSettings.webhook = remote.webhook;
|
|
35849
|
+
} else {
|
|
35850
|
+
delete localSettings.webhook;
|
|
35851
|
+
}
|
|
35852
|
+
}
|
|
35844
35853
|
if (await applySettingsDocument(workspace, localSettings)) {
|
|
35845
35854
|
return;
|
|
35846
35855
|
}
|
|
35847
35856
|
for (const key of SETTINGS_MANAGED_ONLY_WHEN_PRESENT) {
|
|
35848
35857
|
delete localSettings[key];
|
|
35849
35858
|
}
|
|
35850
|
-
const
|
|
35851
|
-
|
|
35859
|
+
const webhookUnreadable = unreadableSecret(localSettings.webhook);
|
|
35860
|
+
if (webhookUnreadable) {
|
|
35861
|
+
warn("Leaving the webhook unchanged: this server cannot read an encrypted or redacted webhook URL. Upgrade it, or write the URL in plain text.");
|
|
35862
|
+
}
|
|
35863
|
+
const slackSecretUnreadable = unreadableSecret(localSettings.slack_oauth_client_secret);
|
|
35852
35864
|
if (slackSecretUnreadable) {
|
|
35853
35865
|
warn("Leaving the Slack OAuth client and secret unchanged: this server cannot read an encrypted or redacted secret. Upgrade it, or write the secret in plain text.");
|
|
35854
35866
|
}
|
|
@@ -35895,7 +35907,7 @@ async function pushWorkspaceSettings(workspace, _path, settings, localSettings,
|
|
|
35895
35907
|
return;
|
|
35896
35908
|
}
|
|
35897
35909
|
debug(`Workspace settings are not up-to-date, updating...`);
|
|
35898
|
-
if (localSettings.webhook !== settings.webhook) {
|
|
35910
|
+
if (!webhookUnreadable && localSettings.webhook !== settings.webhook) {
|
|
35899
35911
|
debug(`Updating webhook...`);
|
|
35900
35912
|
await editWebhook({
|
|
35901
35913
|
workspace,
|
|
@@ -36081,6 +36093,26 @@ async function pushWorkspaceSettings(workspace, _path, settings, localSettings,
|
|
|
36081
36093
|
}
|
|
36082
36094
|
}
|
|
36083
36095
|
}
|
|
36096
|
+
function unreadableSecret(secret) {
|
|
36097
|
+
return typeof secret === "string" && (secret.startsWith("$encrypted:") || secret === "__SENSITIVE_AND_UNCHANGED__");
|
|
36098
|
+
}
|
|
36099
|
+
async function documentKeepsRedactedWebhook(workspace) {
|
|
36100
|
+
try {
|
|
36101
|
+
const result = await applyWorkspaceSettingsDocument({
|
|
36102
|
+
workspace,
|
|
36103
|
+
requestBody: {
|
|
36104
|
+
document: { webhook: "__SENSITIVE_AND_UNCHANGED__" },
|
|
36105
|
+
dry_run: true
|
|
36106
|
+
}
|
|
36107
|
+
});
|
|
36108
|
+
return !result.changes.some((c) => c.key === "webhook");
|
|
36109
|
+
} catch (err) {
|
|
36110
|
+
if (err?.status === 404 && !err?.body) {
|
|
36111
|
+
return true;
|
|
36112
|
+
}
|
|
36113
|
+
throw new Error(`Failed to read workspace settings: ${err?.body ?? err}`);
|
|
36114
|
+
}
|
|
36115
|
+
}
|
|
36084
36116
|
async function applySettingsDocument(workspace, document) {
|
|
36085
36117
|
let result;
|
|
36086
36118
|
try {
|
|
@@ -59281,7 +59313,7 @@ var init_openflow = __esm(() => {
|
|
|
59281
59313
|
openflow_default = {
|
|
59282
59314
|
openapi: "3.0.3",
|
|
59283
59315
|
info: {
|
|
59284
|
-
version: "1.
|
|
59316
|
+
version: "1.873.0",
|
|
59285
59317
|
title: "OpenFlow Spec",
|
|
59286
59318
|
contact: {
|
|
59287
59319
|
name: "Ruben Fiszel",
|
|
@@ -90960,7 +90992,8 @@ read or change it.
|
|
|
90960
90992
|
|
|
90961
90993
|
## Secrets
|
|
90962
90994
|
|
|
90963
|
-
\`
|
|
90995
|
+
\`webhook\` (its URL usually carries the receiver's token) and \`slack_oauth_client_secret\` are the
|
|
90996
|
+
secrets. A read shows \`__SENSITIVE_AND_UNCHANGED__\` in place
|
|
90964
90997
|
of a set secret; sending that placeholder back keeps the stored value. A value starting with
|
|
90965
90998
|
\`$encrypted:\` is decrypted with the workspace key, and one encrypted with another workspace's key
|
|
90966
90999
|
is left unchanged with a warning; any other value is taken as plaintext. Never
|