openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
34 lines (33 loc) • 1.27 kB
JavaScript
//#region src/flows/doctor-gateway-exec-credential.ts
async function hasActiveGatewayExecCredential(e) {
const [{ resolveSecretInputRef: t }, { gatewaySecretInputPathCanWin: n }, r] = await Promise.all([
import("./types.secrets-Djnm0_Tu.mjs"),
import("./credentials-secret-inputs-iW2L6UFC.mjs"),
import("./secret-input-paths-BRIWNRIT.mjs")
]);
const isExecRef = (n) => t({
value: n,
defaults: e.cfg.secrets?.defaults
}).ref?.source === "exec";
const i = e.cfg.gateway?.mode === "remote" ? "remote" : "local";
const a = r.ALL_GATEWAY_SECRET_INPUT_PATHS.some((t) => {
if (!n({
config: e.cfg,
env: e.env ?? process.env,
modeOverride: i,
path: t
})) return false;
return isExecRef(r.readGatewaySecretInputValue(e.cfg, t));
});
if (a || !e.cfg.gateway?.remote?.edgeAuth) return a;
const [{ buildGatewayProbeConnectionDetails: o }, s] = await Promise.all([import("./call-CT5jlfNe.mjs"), import("./edge-auth-CON8RTGR.mjs")]);
const c = e.targetUrl ?? (await o({ config: e.cfg })).url;
const { gatewayEdgeAuthValueForTarget: l, normalizeEdgeAuthHeadersConfig: u } = s;
const d = u(l({
config: e.cfg,
targetUrl: c
}));
return Object.values(d ?? {}).some(isExecRef);
}
//#endregion
export { hasActiveGatewayExecCredential as t };