mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-04 14:50:24 +00:00
perf(secrets): drop bootstrap fallback from target registry
This commit is contained in:
1
extensions/line/secret-contract-api.ts
Normal file
1
extensions/line/secret-contract-api.ts
Normal file
@@ -0,0 +1 @@
|
||||
// Intentionally empty: Line does not expose runtime secret-contract surfaces.
|
||||
1
extensions/signal/secret-contract-api.ts
Normal file
1
extensions/signal/secret-contract-api.ts
Normal file
@@ -0,0 +1 @@
|
||||
// Intentionally empty: Signal does not expose runtime secret-contract surfaces.
|
||||
1
extensions/zalouser/secret-contract-api.ts
Normal file
1
extensions/zalouser/secret-contract-api.ts
Normal file
@@ -0,0 +1 @@
|
||||
// Intentionally empty: Zalo User does not expose runtime secret-contract surfaces.
|
||||
@@ -1,5 +1,4 @@
|
||||
import { iterateBootstrapChannelPlugins } from "../channels/plugins/bootstrap-registry.js";
|
||||
import { listBundledPluginMetadata } from "../plugins/bundled-plugin-metadata.js";
|
||||
import { loadPluginManifestRegistry } from "../plugins/manifest-registry.js";
|
||||
import { loadBundledChannelSecretContractApi } from "./channel-contract-api.js";
|
||||
import type { SecretTargetRegistryEntry } from "./target-registry-types.js";
|
||||
|
||||
@@ -8,37 +7,22 @@ const SIBLING_REF_SHAPE = "sibling_ref"; // pragma: allowlist secret
|
||||
|
||||
function listChannelSecretTargetRegistryEntries(): SecretTargetRegistryEntry[] {
|
||||
const entries: SecretTargetRegistryEntry[] = [];
|
||||
const handledChannelIds = new Set<string>();
|
||||
|
||||
for (const metadata of listBundledPluginMetadata({
|
||||
includeChannelConfigs: false,
|
||||
includeSyntheticChannelConfigs: false,
|
||||
})) {
|
||||
const channelIds = metadata.manifest.channels ?? [];
|
||||
for (const record of loadPluginManifestRegistry({}).plugins) {
|
||||
if (record.origin !== "bundled") {
|
||||
continue;
|
||||
}
|
||||
const channelIds = record.channels;
|
||||
if (channelIds.length === 0) {
|
||||
continue;
|
||||
}
|
||||
if (!metadata.publicSurfaceArtifacts?.includes("contract-api.js")) {
|
||||
if (!metadata.publicSurfaceArtifacts?.includes("secret-contract-api.js")) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
try {
|
||||
const contractApi = loadBundledChannelSecretContractApi(metadata.manifest.id);
|
||||
const contractApi = loadBundledChannelSecretContractApi(record.id);
|
||||
entries.push(...(contractApi?.secretTargetRegistryEntries ?? []));
|
||||
channelIds.forEach((channelId) => handledChannelIds.add(channelId));
|
||||
} catch {
|
||||
// Fall back to the full bootstrap plugin surface for channels that do not
|
||||
// expose a usable secret contract artifact.
|
||||
// Ignore bundled channels that do not expose a usable secret contract artifact.
|
||||
}
|
||||
}
|
||||
|
||||
for (const plugin of iterateBootstrapChannelPlugins()) {
|
||||
if (handledChannelIds.has(plugin.id)) {
|
||||
continue;
|
||||
}
|
||||
entries.push(...(plugin.secrets?.secretTargetRegistryEntries ?? []));
|
||||
}
|
||||
return entries;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user