mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-26 20:35:39 -06:00
refactor(status): remove unused gateway probe exports
This commit is contained in:
@@ -6,7 +6,6 @@ import {
|
||||
resolveGatewayProbeAuthSafeWithSecretInputs,
|
||||
resolveGatewayProbeTarget,
|
||||
} from "../gateway/probe-auth.js";
|
||||
export { pickGatewaySelfPresence } from "./gateway-presence.js";
|
||||
|
||||
/** Resolves gateway probe auth plus any non-secret warning about credential lookup. */
|
||||
export async function resolveGatewayProbeAuthResolution(cfg: OpenClawConfig): Promise<{
|
||||
@@ -24,11 +23,3 @@ export async function resolveGatewayProbeAuthResolution(cfg: OpenClawConfig): Pr
|
||||
env: process.env,
|
||||
});
|
||||
}
|
||||
|
||||
/** Resolves only gateway probe auth material for callers that do not display warnings. */
|
||||
export async function resolveGatewayProbeAuth(cfg: OpenClawConfig): Promise<{
|
||||
token?: string;
|
||||
password?: string;
|
||||
}> {
|
||||
return (await resolveGatewayProbeAuthResolution(cfg)).auth;
|
||||
}
|
||||
|
||||
@@ -74,7 +74,6 @@ function createStatusScanDepsRuntimeModuleMock(
|
||||
}
|
||||
|
||||
type StatusGatewayProbeModuleMock = {
|
||||
pickGatewaySelfPresence: Mock<() => null>;
|
||||
resolveGatewayProbeAuthResolution: StatusScanSharedMocks["resolveGatewayProbeAuthResolution"];
|
||||
};
|
||||
|
||||
@@ -82,7 +81,6 @@ function createStatusGatewayProbeModuleMock(
|
||||
mocks: Pick<StatusScanSharedMocks, "resolveGatewayProbeAuthResolution">,
|
||||
): StatusGatewayProbeModuleMock {
|
||||
return {
|
||||
pickGatewaySelfPresence: vi.fn(() => null),
|
||||
resolveGatewayProbeAuthResolution: mocks.resolveGatewayProbeAuthResolution,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Credential precedence parity tests keep call, probe, status, and auth surfaces
|
||||
// aligned on local/remote gateway token and password resolution.
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { resolveGatewayProbeAuth as resolveStatusGatewayProbeAuth } from "../commands/status.gateway-probe.js";
|
||||
import { resolveGatewayProbeAuthResolution } from "../commands/status.gateway-probe.js";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import { resolveGatewayAuth } from "./auth.js";
|
||||
import { resolveGatewayCredentialsFromConfig } from "./credentials.js";
|
||||
@@ -156,7 +156,9 @@ describe("gateway credential precedence coverage", () => {
|
||||
mode,
|
||||
env,
|
||||
});
|
||||
const status = await withGatewayAuthEnv(env, () => resolveStatusGatewayProbeAuth(cfg));
|
||||
const status = (
|
||||
await withGatewayAuthEnv(env, () => resolveGatewayProbeAuthResolution(cfg))
|
||||
).auth;
|
||||
const auth = resolveGatewayAuth({
|
||||
authConfig: cfg.gateway?.auth,
|
||||
env,
|
||||
|
||||
Reference in New Issue
Block a user