mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-28 02:20:43 +00:00
refactor: unify gateway credential planning
This commit is contained in:
@@ -1,16 +1,10 @@
|
||||
import type { OpenClawConfig } from "../../config/config.js";
|
||||
import { resolveGatewayCredentialsFromConfig } from "../../gateway/credentials.js";
|
||||
import { resolveGatewayDriftCheckCredentialsFromConfig } from "../../gateway/credentials.js";
|
||||
|
||||
export function resolveGatewayTokenForDriftCheck(params: {
|
||||
cfg: OpenClawConfig;
|
||||
env?: NodeJS.ProcessEnv;
|
||||
}) {
|
||||
return resolveGatewayCredentialsFromConfig({
|
||||
cfg: params.cfg,
|
||||
env: {} as NodeJS.ProcessEnv,
|
||||
modeOverride: "local",
|
||||
// Drift checks should compare the configured local token source against the
|
||||
// persisted service token, not let exported shell env hide stale service state.
|
||||
localTokenPrecedence: "config-first",
|
||||
}).token;
|
||||
void params.env;
|
||||
return resolveGatewayDriftCheckCredentialsFromConfig({ cfg: params.cfg }).token;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user