mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-20 22:35:00 +00:00
fix: switch pairing setup codes to bootstrap tokens
This commit is contained in:
@@ -8,14 +8,14 @@ import {
|
||||
} from "../config/types.secrets.js";
|
||||
import { assertExplicitGatewayAuthModeWhenBothConfigured } from "../gateway/auth-mode-policy.js";
|
||||
import { resolveRequiredConfiguredSecretRefInputString } from "../gateway/resolve-configured-secret-input-string.js";
|
||||
import { issueDeviceBootstrapToken } from "../infra/device-bootstrap.js";
|
||||
import { resolveGatewayBindUrl } from "../shared/gateway-bind-url.js";
|
||||
import { isCarrierGradeNatIpv4Address, isRfc1918Ipv4Address } from "../shared/net/ip.js";
|
||||
import { resolveTailnetHostWithRunner } from "../shared/tailscale-status.js";
|
||||
|
||||
export type PairingSetupPayload = {
|
||||
url: string;
|
||||
token?: string;
|
||||
password?: string;
|
||||
bootstrapToken: string;
|
||||
};
|
||||
|
||||
export type PairingSetupCommandResult = {
|
||||
@@ -34,6 +34,7 @@ export type ResolvePairingSetupOptions = {
|
||||
publicUrl?: string;
|
||||
preferRemoteUrl?: boolean;
|
||||
forceSecure?: boolean;
|
||||
pairingBaseDir?: string;
|
||||
runCommandWithTimeout?: PairingSetupCommandRunner;
|
||||
networkInterfaces?: () => ReturnType<typeof os.networkInterfaces>;
|
||||
};
|
||||
@@ -388,8 +389,11 @@ export async function resolvePairingSetupFromConfig(
|
||||
ok: true,
|
||||
payload: {
|
||||
url: urlResult.url,
|
||||
token: auth.token,
|
||||
password: auth.password,
|
||||
bootstrapToken: (
|
||||
await issueDeviceBootstrapToken({
|
||||
baseDir: options.pairingBaseDir,
|
||||
})
|
||||
).token,
|
||||
},
|
||||
authLabel: auth.label,
|
||||
urlSource: urlResult.source ?? "unknown",
|
||||
|
||||
Reference in New Issue
Block a user