feat(pairing): add silent SSH auto-approve
This commit is contained in:
@@ -227,6 +227,7 @@ export const NodePairRequestParamsSchema = Type.Object(
|
||||
caps: Type.Optional(Type.Array(NonEmptyString)),
|
||||
commands: Type.Optional(Type.Array(NonEmptyString)),
|
||||
remoteIp: Type.Optional(NonEmptyString),
|
||||
silent: Type.Optional(Type.Boolean()),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
@@ -3276,6 +3276,7 @@ export async function startGatewayServer(
|
||||
caps?: string[];
|
||||
commands?: string[];
|
||||
remoteIp?: string;
|
||||
silent?: boolean;
|
||||
};
|
||||
try {
|
||||
const result = await requestNodePairing({
|
||||
@@ -3288,6 +3289,7 @@ export async function startGatewayServer(
|
||||
caps: p.caps,
|
||||
commands: p.commands,
|
||||
remoteIp: p.remoteIp,
|
||||
silent: p.silent,
|
||||
});
|
||||
if (result.status === "pending" && result.created) {
|
||||
broadcast("node.pair.requested", result.request, {
|
||||
|
||||
@@ -35,6 +35,7 @@ type BridgePairRequestFrame = {
|
||||
caps?: string[];
|
||||
commands?: string[];
|
||||
remoteAddress?: string;
|
||||
silent?: boolean;
|
||||
};
|
||||
|
||||
type BridgeEventFrame = {
|
||||
@@ -396,6 +397,7 @@ export async function startNodeBridgeServer(
|
||||
? req.commands.map((c) => String(c)).filter(Boolean)
|
||||
: undefined,
|
||||
remoteIp: remoteAddress,
|
||||
silent: req.silent === true ? true : undefined,
|
||||
},
|
||||
opts.pairingBaseDir,
|
||||
);
|
||||
|
||||
@@ -14,6 +14,7 @@ export type NodePairingPendingRequest = {
|
||||
caps?: string[];
|
||||
commands?: string[];
|
||||
remoteIp?: string;
|
||||
silent?: boolean;
|
||||
isRepair?: boolean;
|
||||
ts: number;
|
||||
};
|
||||
@@ -185,6 +186,7 @@ export async function requestNodePairing(
|
||||
caps: req.caps,
|
||||
commands: req.commands,
|
||||
remoteIp: req.remoteIp,
|
||||
silent: req.silent,
|
||||
isRepair,
|
||||
ts: Date.now(),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user