paperclip-github-plugin 0.9.2 → 0.9.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/manifest.js +1 -1
- package/dist/ui/index.js +32 -6
- package/dist/ui/index.js.map +2 -2
- package/package.json +1 -1
package/dist/manifest.js
CHANGED
|
@@ -642,7 +642,7 @@ var PULL_REQUEST_ASSET_API_ROUTE_URL_PATH = `/api/plugins/${GITHUB_SYNC_PLUGIN_I
|
|
|
642
642
|
var require2 = createRequire(import.meta.url);
|
|
643
643
|
var packageJson = require2("../package.json");
|
|
644
644
|
var SCHEDULE_TICK_CRON = "* * * * *";
|
|
645
|
-
var MANIFEST_VERSION = "0.9.
|
|
645
|
+
var MANIFEST_VERSION = "0.9.4"?.trim() || typeof packageJson.version === "string" && packageJson.version.trim() || process.env.npm_package_version?.trim() || "0.0.0-dev";
|
|
646
646
|
var manifest = {
|
|
647
647
|
id: GITHUB_SYNC_PLUGIN_ID,
|
|
648
648
|
apiVersion: 1,
|
package/dist/ui/index.js
CHANGED
|
@@ -28400,13 +28400,39 @@ async function resolveOrCreateCompanySecret(companyId, name2, value) {
|
|
|
28400
28400
|
function isPluginSecretReferencesDisabledError(error) {
|
|
28401
28401
|
return getActionErrorMessage(error, "").toLowerCase().includes("plugin secret references are disabled");
|
|
28402
28402
|
}
|
|
28403
|
+
var PLUGIN_CONFIG_SECRET_KEY_PATTERN = /secret|token/iu;
|
|
28404
|
+
function isPlainConfigRecord(value) {
|
|
28405
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
28406
|
+
}
|
|
28407
|
+
function shouldStripPluginConfigValue(key, value) {
|
|
28408
|
+
const normalizedKey = key.replace(/[^a-z0-9]/giu, "").toLowerCase();
|
|
28409
|
+
if (PLUGIN_CONFIG_SECRET_KEY_PATTERN.test(normalizedKey)) {
|
|
28410
|
+
return true;
|
|
28411
|
+
}
|
|
28412
|
+
if (!isPlainConfigRecord(value)) {
|
|
28413
|
+
return false;
|
|
28414
|
+
}
|
|
28415
|
+
return value.type === "secret_ref" || typeof value.secretId === "string";
|
|
28416
|
+
}
|
|
28417
|
+
function stripPluginSecretRefValue(value) {
|
|
28418
|
+
if (Array.isArray(value)) {
|
|
28419
|
+
return value.map((entry) => stripPluginSecretRefValue(entry));
|
|
28420
|
+
}
|
|
28421
|
+
if (!isPlainConfigRecord(value)) {
|
|
28422
|
+
return value;
|
|
28423
|
+
}
|
|
28424
|
+
const nextEntries = [];
|
|
28425
|
+
for (const [key, entryValue] of Object.entries(value)) {
|
|
28426
|
+
if (shouldStripPluginConfigValue(key, entryValue)) {
|
|
28427
|
+
continue;
|
|
28428
|
+
}
|
|
28429
|
+
const nextValue = stripPluginSecretRefValue(entryValue);
|
|
28430
|
+
nextEntries.push([key, nextValue]);
|
|
28431
|
+
}
|
|
28432
|
+
return Object.fromEntries(nextEntries);
|
|
28433
|
+
}
|
|
28403
28434
|
function stripPluginSecretRefConfig(config) {
|
|
28404
|
-
|
|
28405
|
-
githubTokenRefs: _githubTokenRefs,
|
|
28406
|
-
paperclipBoardApiTokenRefs: _paperclipBoardApiTokenRefs,
|
|
28407
|
-
...safeConfig
|
|
28408
|
-
} = config;
|
|
28409
|
-
return safeConfig;
|
|
28435
|
+
return stripPluginSecretRefValue(config);
|
|
28410
28436
|
}
|
|
28411
28437
|
async function writePluginConfig(pluginId, config) {
|
|
28412
28438
|
await fetchJson(`/api/plugins/${pluginId}/config`, {
|