mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-20 03:01:34 +00:00
refactor(gateway): retire the standalone node pairing store (#103120)
* refactor(gateway): fold node pairing store into device records * docs+cli: retire standalone node pairing store references * test(infra): respec node pairing as device-backed surface approvals * test(infra): assemble migration token fixtures dynamically * fix(pairing): preserve node surface across device re-approval, strip legacy tokens in CLI JSON * test(gateway): drop retired node token from pairing fixtures * chore(protocol): regenerate Swift models, drop dead pairing-pending module
This commit is contained in:
committed by
GitHub
parent
a661804270
commit
f5806d08e2
@@ -176,7 +176,6 @@ function mergePairedNodeWithEffectiveNode(
|
||||
return {
|
||||
...paired,
|
||||
...effective,
|
||||
token: paired?.token,
|
||||
createdAtMs: paired?.createdAtMs,
|
||||
lastConnectedAtMs: paired?.lastConnectedAtMs ?? effective.connectedAtMs,
|
||||
displayName: effective.displayName ?? paired?.displayName,
|
||||
@@ -224,12 +223,6 @@ async function tryReadNodeList(opts: NodesRpcOpts): Promise<NodeListNode[] | nul
|
||||
}
|
||||
}
|
||||
|
||||
function sanitizePairedNodeForListJson(node: PairedNodeListRow): Omit<PairedNodeListRow, "token"> {
|
||||
const copy: Record<string, unknown> = { ...node };
|
||||
delete copy.token;
|
||||
return copy as Omit<PairedNodeListRow, "token">;
|
||||
}
|
||||
|
||||
/** Register node status, describe, and paired-node list commands. */
|
||||
export function registerNodesStatusCommands(nodes: Command) {
|
||||
nodesCallOpts(
|
||||
@@ -548,7 +541,13 @@ export function registerNodesStatusCommands(nodes: Command) {
|
||||
if (opts.json) {
|
||||
defaultRuntime.writeJson({
|
||||
pending: pendingRows,
|
||||
paired: filteredPaired.map(sanitizePairedNodeForListJson),
|
||||
// Current gateways emit no token, but the permissive parser keeps
|
||||
// unknown fields; strip so an older gateway's legacy node token
|
||||
// never reaches JSON output.
|
||||
paired: filteredPaired.map((row) => {
|
||||
const { token: _token, ...rest } = row as { token?: unknown };
|
||||
return rest;
|
||||
}),
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user